What is context engineering? A guide for PMs
Context engineering is the practice of designing everything a model receives on each call: instructions, conversation history, retrieved documents, tool results and memory. It broadens prompt engineering, which focuses on how an instruction is worded, to the question of what goes into the context window and what is left out. The term caught on in 2025 as agents spread, since they pile up a lot of information over the course of a task.
Definition written by Alex Dionisio, Senior Product Manager. Updated November 13, 2026.
Why it matters for a PM
Answer quality depends first on what the model can see. An assistant flooded with text loses focus and costs more; one missing a key fact makes things up. Many context decisions are product decisions: which user data to pass along, how much history to keep, what to summarize, which sources come first. The PM has a view to bring here, not just engineering.
Example
A support assistant initially receives the customer's full history and the entire help center. Answers are slow and sometimes off topic. The team switches to an account summary, the last three exchanges, the help articles closest to the question and the refund policy. Answers get sharper, and each call uses far fewer tokens.
How is context engineering different from prompt engineering?
In a post from its engineering team published in September 2025, Anthropic describes context engineering as the natural progression of prompt engineering. Prompt engineering is about writing and organizing instructions, especially the system prompt. Context engineering covers everything that lands in the context window on each call, including what never came from a prompt: tool definitions, external data, message history. Writing a prompt is a one-off task; curating context happens again on every turn, because an agent running in a loop keeps generating new information that might matter next.
Why not send everything? Because a model gets worse at finding a fact buried in a long context; Claude's documentation calls this loss of reliability context rot. Anthropic compares the model's attention to a budget that each token spends a little of. Hence its rule of thumb: pass along as little as possible, and only material that genuinely serves the task.
What goes into an agent's context, and how do you choose?
With the Claude API, every piece you send takes up room: the system prompt, every message (tool results, images and documents included), the tool definitions, and the response being generated, thinking included. A good system prompt sits at the right altitude, avoiding both brittle rules that try to script every case and guidance so vague it assumes context the model does not have. Tools work best when they are few and do not overlap: if a human engineer cannot say which one to use, the agent will not do better. As for examples, a handful of varied, representative cases beats a long list of edge cases.
Then comes timing. You can retrieve information before the call, with RAG for instance, or let the agent fetch it when it needs it, using lightweight references such as file paths. The second approach saves room in the window but takes longer. Claude Code mixes both: its CLAUDE.md files are loaded up front, and everything else is opened as the work proceeds.
How do you manage a growing context, and what does it cost?
For long tasks, Anthropic describes three techniques. Compaction summarizes a conversation nearing the limit and restarts from that summary; the Claude API offers it server side, and clearing old tool results is a lighter version of it. Structured note-taking has the agent write notes stored outside the window and read them back later. Sub-agents handle a focused task in a clean window and return only a condensed summary.
Every choice has a price. More context means more billed tokens on every call and often a slower answer; overly aggressive compaction drops a detail whose importance only shows up later. Settle these trade-offs on a set of test cases, tracking quality, token usage and latency together.
A few questions to ask the team: what exactly does the model receive on each call, shown on a real example? How much of it actually helps the answer? What happens when a task hits the limit? Which personal data passes through the context without needing to?
Key points
- Context is a scarce resource: every item added has to earn its place.
- Summarizing, filtering and ordering information matters as much as phrasing the instruction.
- An agent's context grows at every step, so plan what to keep, compress or drop.
- Persistent instruction files, such as a CLAUDE.md, are a simple form of context engineering.
Common mistakes
- Assuming a bigger context window fixes everything and pouring every available document into it.
- Sending the model personal data the task does not need.
- Changing the context without measuring the effect on a set of test cases.
Go further with Module
The courses and lessons that cover this concept:
Guides on this topic
- Claude Code for Product Managers
What a PM can do with Claude Code, the method and the guardrails, with a starter CLAUDE.md.
- RAG vs fine-tuning: how to choose
What each approach solves, the decision criteria and how to evaluate, with a decision grid.