What Is Context Engineering, and How Do You Do It in Claude?
Context engineering means choosing what's in front of Claude when it answers: instructions, files, history, tool definitions and tool results. Anthropic's advice is to find the smallest possible set of high-signal tokens that makes the result you want most likely. So pick the material deliberately. A bigger context window doesn't remove the need to choose.
Before you start on this task, tell me what you actually need. Task: [what I want] I could give you: [list the files, data and background] For each item, say: essential, useful, or not needed, with one line on what it would change in your answer. Then list anything missing that I haven't offered. Only after I reply, do the task, using just the material I send.
- System prompt
- Messages
- Tool results
- Images and documents
- Tool definitions
- Output, including thinking
- the whole folder
- the full chat history
- every tool connected
- the 2 files that matter
- a short handoff
- only the tools it will use
Try it now
- 1Take a task you're about to run, and list everything you were going to paste.
- 2Send the prompt above and let Claude sort that list.
- 3Open a new chat and give it only the essential items.
- 4You'll know it worked if the answer is at least as good as before. If it's missing something, add that one item back.
Use it when
Use it when answers get vague or pick up the wrong facts as a chat grows, when you're setting up a project or agent that will run for a long time, or when you're paying for a pipeline and want to know what each request carries.
Skip it when
For a one-off question with a short document, this is overkill. Just paste it and ask. And don't over-trim where the job is to read everything, such as finding a clause across a whole contract. There the whole document is the signal.
Why it works
Current models have a 1M-token window, but Anthropic's docs warn that more context isn't automatically better. As the token count grows, accuracy and recall degrade, which they call context rot. Its engineering guide describes context as a finite resource with diminishing returns, and each new token draws down a limited attention budget. Everything counts toward the window: the system prompt, messages, tool results, images, documents, tool definitions, and the output itself, including thinking.
Example
You're asking Claude to write a renewal email to a customer. You could paste the whole account history: 40 support tickets, the contract and three call transcripts. What changes the email is the renewal date, the current plan, the last open complaint and who signed. Give it those four things and the most recent call summary, and keep the rest ready in case it asks.
Going further
Anthropic's guide suggests just-in-time retrieval: keep lightweight identifiers such as file paths, stored queries or links, and load the content with tools when needed. That's slower than having everything preloaded, so many systems use a hybrid. For system prompts, it advises starting minimal and adding instructions in response to failures you actually observed. For examples, it prefers a small set of diverse, canonical cases over listing every edge case. Cached prompts still occupy the window, since caching changes what you pay, not whether the tokens count.
Common mistakes
- Treating the 1M-token window as a target and uploading everything because it fits.
- Connecting every available tool, when their definitions are context too, before any work starts.
- Keeping one chat going across unrelated topics, so old material keeps competing with the new task.
- Writing a long list of edge-case rules up front, rather than adding one each time something fails.
Sources
Checked 6 November 2026. Products change often, so confirm details with the vendor.