Claude prompt caching, explained
Most Claude requests repeat the same instructions and documents. Prompt caching bills that repeated part at a fraction of the price. Here is how it works.
7 posts tagged claude.
Most Claude requests repeat the same instructions and documents. Prompt caching bills that repeated part at a fraction of the price. Here is how it works.
Current Claude models accept up to 1M tokens of context. Filling that space is rarely the answer: what to include, in what order, and what to leave out.
Asking for JSON in the prompt isn't a contract. Structured outputs and strict tool use are, and you still need to check stop_reason and the values.
A prompt is a spec. Five parts in order (role, task, context, examples, output format), tagged with XML, kept in git and tested like code.
Opus, Sonnet and Haiku trade capability against speed and cost. How to pick a tier for each step of a system, and why to test the cheaper one first.
Every system built on Claude comes down to five parts: model, prompt, tools, context and evals. Demos get the first two right; production depends on the rest.
One request, one response: the five fields you send, the three you read back, and why stop_reason is the field first integrations most often get wrong.