# Context engineering

> Context engineering is deciding what goes into the window for this step, and what stays out.

Deciding what goes into the window for this step, and what stays out.

Track: Agents
Access: free
Card: https://buildsparkai.com/context-engineering
Plain text: https://buildsparkai.com/context-engineering.md
Last checked: 2026-10-18

## What it is

Context engineering is the choice of which tokens this request holds. Anthropic's context windows guide says the window is all the text a model can reference when it generates a response, including the response itself, and that more context is not automatically better. As the token count grows, accuracy and recall degrade. That page calls this context rot, and says curating what is in context matters as much as how much space you have. Everything in the request counts: the system prompt, messages, tool results, and tool definitions. Anthropic's context editing guide says context is a finite resource with diminishing returns, and that irrelevant content degrades model focus. The manage-tool-context guide says tool definitions and accumulated tool results consume the window, and that a long run can exhaust it before the task is finished.

## Why it matters

**Cost.** Tokens you leave in the request are tokens you send again. Anthropic's context windows guide says a cached prefix still occupies the window: caching changes what you pay, not whether the tokens count. The manage-tool-context page says prompt caching does not reduce the number of tokens in context, but it reduces what you pay for them on a later request. Anthropic reports on that page that a cache write carries a 25% markup over base input pricing. This card does not add a price of its own.

**Quality.** Anthropic's context windows guide says more context is not automatically better, and that accuracy and recall degrade as the token count grows. A step that only needs the latest close time can do worse if the window is full of older notes.

**Risk.** An old tool result stays readable on the next step until you clear it, including text you did not write. Anthropic's manage-tool-context guide says those results can become dead weight, and that context editing can trim them without restarting the conversation.

## Try today

Open one real request. List the instruction, the history, the tool definitions, and the tool results. Cross out anything that does not change this step.

## Common mistake

Leaving every earlier tool result in the window because the window is large. Anthropic's context windows guide says more context is not automatically better.

## Self-check

Which of these is context engineering?

Deciding what goes into the window for this step, and what stays out

## Practice and deep

Coming soon. One real request, with each block marked keep or drop for the next step.

Coming soon. How Anthropic's context editing clears old tool results without restarting the conversation.

## Sources

- [Anthropic, Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows)
- [Anthropic, Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing)
- [Anthropic, Manage tool context](https://platform.claude.com/docs/en/agents-and-tools/tool-use/manage-tool-context)

Opened 2026-10-18. Each page is Anthropic documentation. The 25% cache-write markup is what Anthropic reports on the manage-tool-context page. This card does not add a rate or a usage count.
