Claude Tool Use: 3 Recipes That Ship + 2 Failure Modes (June 2026)
Three production Claude tool use recipes tested on Sonnet 4.6, Opus 4.7, and Haiku 4.5 with current pricing. Plus the two failure modes nobody warns you about. June 2026.
Every prompt recipe. Copy, paste, ship.
19 posts
Three production Claude tool use recipes tested on Sonnet 4.6, Opus 4.7, and Haiku 4.5 with current pricing. Plus the two failure modes nobody warns you about. June 2026.
Three Claude prompt-caching recipes with real cost math for Sonnet 4.6, Opus 4.7, and Haiku 4.5. Plus two patterns where caching quietly costs you 25% more than not using it.
Three production-grade Claude structured output recipes for June 2026. Invoice extraction on Sonnet 4.6, support triage on Haiku 4.5, NL to SQL on Opus 4.7. Real cost per call. Three failure modes the docs do not warn you about.
Wrap a good prompt in one route handler: validate input, call the model, validate output, return typed JSON. No agent framework, no vector DB, no queue. A prompt plus a POST endpoint is a shippable feature. Add the rest only when a real user complains. Ship the prompt, not the platform.
Step one: ask for JSON. Step two: if JSON.parse throws, send the broken string plus the parser error back and ask only for a corrected version. Don't re-explain the task. Models fix syntax far more reliably than they self-correct semantics. Two steps, near-zero unparseable output.
Before you ship a generated answer, run one cheap second call that checks it against the source. Ask: is every claim in the answer supported by the provided context? Get back yes/no plus the first unsupported claim. Reject on no. Five lines of glue, catches the bulk of confident fabrications.
Route every call to Haiku 4.5 first. Ask it one thing: can you answer this with high confidence? If yes, ship its answer. If no, replay the same request to Opus 4.7. You pay premium tokens only on the hard 10–20%. Net cost drops ~70% with no quality loss on easy traffic.