{"slug": "claude-cost-optimization-instructions", "title": "claude cost optimization instructions", "summary": "Anthropic has published a set of cost-optimization instructions for Claude, emphasizing a plan-first gate, delegation of exploration to subagents, and defaulting to the cheaper Haiku model for subagent tasks. The guidance also advises against proactive context pruning to preserve prompt cache stability and recommends batching actions and parallelizing independent subtasks.", "body_md": "Plan-first gate. Before the first tool call on any task you expect to take more than ~3 tool calls, output a visible 3-6 bullet plan and execute against it instead of exploring turn-by-turn. If a task that looked simple grows past 3 tool calls without a plan having been stated, stop and write one before the next call — don't let \"I'll just check one thing\" silently turn into an unplanned multi-step investigation.\n\nDelegate-exploration gate. The moment discovery needs more than 2 exploratory lookups to find the right source/location/API (schema searches, grep sweeps, doc reads, table/tool discovery), stop doing it inline and hand the rest of the discovery to a subagent (fork, or Explore for pure search). Bring back only its 1-3 sentence conclusion — not the raw tool output — into the main thread. This applies even when the lookups are individually cheap (e.g. find_tables/schema calls); it's the count that triggers delegation, not the size of any one call.\n\nCheap-model-by-default gate. When spawning a subagent, default to Haiku. Only use Sonnet 5 or higher for that subagent when its task genuinely requires judgment, synthesis, or multi-step reasoning beyond mechanical lookup/transformation — and when you reach for a higher model, note in one clause why the task needs it. Reserve Sonnet 5+ in the main loop for orchestration and judgment calls.\n\nDon't proactively re-summarize or prune context on a fixed cadence — rewriting/discarding earlier turns breaks the prompt cache's stable prefix and forces an expensive full rewrite of everything downstream, often costing more than it saves. Let the harness's automatic compaction handle context growth; if you deliberately compact, do it at natural phase boundaries (e.g. finishing research before starting implementation), not on a tool-call counter.\n\nNever paste full file contents, full command output, or full logs into your reasoning. Use rg -n, sed -n, or head -n 50 / tail -n 50 to pull only the lines relevant to the current step.\n\nBatch related actions into a single turn (e.g. read + edit + verify) instead of one tool call per turn.\n\nPrefer editing files with targeted patches over rewriting whole files.\n\nIf a task naturally splits into independent phases, start a fresh session per phase and carry forward only a short written handoff summary, not the full prior transcript.\n\nMatch agent type to the task: use the narrowest agent suited to the job (e.g. Explore for pure search) instead of defaulting to a general-purpose agent, to cut tool-access and context overhead.\n\nParallelize by default: when subtasks are independent (don't need each other's output), run them concurrently — batched tool calls in one turn, or multiple agent calls in a single message — rather than sequentially.", "url": "https://wpnews.pro/news/claude-cost-optimization-instructions", "canonical_source": "https://gist.github.com/mrdcbrush/7045007d0000d1778d9a3861e5dfb338", "published_at": "2026-08-21 14:47:56+00:00", "updated_at": "2026-08-21 15:14:42.386089+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "developer-tools", "mlops"], "entities": ["Anthropic", "Claude", "Haiku", "Sonnet"], "alternates": {"html": "https://wpnews.pro/news/claude-cost-optimization-instructions", "markdown": "https://wpnews.pro/news/claude-cost-optimization-instructions.md", "text": "https://wpnews.pro/news/claude-cost-optimization-instructions.txt", "jsonld": "https://wpnews.pro/news/claude-cost-optimization-instructions.jsonld"}}