Prompts 7
Prompts that were run, with the real output and a way to check it — grouped by model.
- "maximum context length" error but tiktoken says it fits
tiktoken counts 73,878 tokens but the API says 249,114. Estimate the full request offline: system, tools, schema, history and reserved output.
Ubuntu 24.04 · Python 3.12 · tiktoken 0.14.0 · OpenAI docs as of 2026-10 (no API calls) - Check stop_reason to Tell If a Claude Response Was Cut Off
If json.loads fails on a reply cut off mid-string, read stop_reason first. A Python check for max_tokens truncation, and how to raise the limit or continue.
Python 3.12.3 · Claude Messages API docs as of 2026-10 · checked against sample response JSON - Fix Gemini's answer format with system instructions and examples
When Gemini's answer format changes between runs, put the rules in a system instruction, add two or three examples with an Output: prefix, then re-run to check.
Gemini API docs · 2026-10 - Make Claude quote its sources, then check the quotes with grep
Ask Claude for a summary with a verbatim quote per sentence, confirm each quote exists in the source with grep -F, and re-ask only for the ones that fail.
claude-sonnet-5-5 · Claude Code 2.1.302 · Ubuntu 24.04 · run on 2026-10-19 - Retry Gemini API 429 and 503 Errors with Backoff
429 RESOURCE_EXHAUSTED and 503 UNAVAILABLE need different handling. A Python retry function with backoff and jitter, tested on a fake server.
Ubuntu 24.04 · Python 3.12.3 (stdlib) · tested against a local fake server · error classes per Gemini API docs, 2026-10 - Split ChatGPT custom instructions, memory and projects
Compare the scope of ChatGPT custom instructions, memory and projects in one table, then see what to put in each, with example text and how to delete memory.
ChatGPT · per OpenAI Help Center · 2026-10 - Summarize a Too-Long Claude Chat and Hand It to a New One
When a chat hits its length limit, ask for a handoff note, check its numbers against the original with grep, then paste it into a new chat and keep going.
claude-sonnet-5-5 · Claude Code 2.1.302 (claude -p) · Ubuntu 24.04 · 2026-10-19 · claude.ai UI per official help pages