Context Engineering
Context engineering is the practice of deciding what information goes into a large language model's (LLM's) context window, and in what order and form, each time the model is called. It covers everything the model reads: instructions, tool definitions, retrieved documents, conversation history, external data and working notes. Anthropic describes it as the natural progression of prompt engineering: prompt engineering focuses on writing good instructions, while context engineering manages the whole set of tokens the model sees, aiming for the smallest set of high-signal information that produces the desired result.[2] The term came to prominence in 2025 as teams started building AI agents that run over many steps.[2][3]
What does Context Engineering mean in simple terms?
Context engineering is setting up the desk before an AI starts work: deciding which documents, tools and notes to lay out. Think of an open-book exam, where the result depends on which books are open to which pages. Prompt engineering polishes the question itself; context engineering goes further and designs the reference material, the tools and the record of earlier work. The longer an AI works, the messier the desk gets, so tidying up along the way (summaries and notes) is part of the job too.[2]
How can Context Engineering be explained with an analogy?
In an open-book exam, the score depends less on memory than on which materials you have open on the desk.
Where is Context Engineering used?
Anthropic — Separate contexts for a multi-agent research system
In June 2025 Anthropic explained how it built the Research feature in Claude. A lead agent plans the work and starts several subagents, each searching in its own context window and passing back only the most important findings.[1] In that June 2025 system, context was truncated once it exceeded 200,000 tokens, so the lead agent saves its plan to external memory, and agents summarize finished phases before moving on.[1] In September 2025 Anthropic published a broader guide to context engineering based on this kind of work.[2]
Result: On Anthropic's internal research evaluation, the multi-agent system (Claude Opus 4 lead with Claude Sonnet 4 subagents) outperformed a single Claude Opus 4 agent by 90.2% (company-reported, June 2025).[1]
Manus — Designing around the KV cache
In July 2025 the AI agent company Manus described how it shapes its agent's context. It keeps the start of the prompt stable and only appends new actions and observations at the end, because identical prefixes can reuse previously computed results (the KV cache), which reduces cost and response time.[3] Manus also masks tools that should not be used instead of removing them, and uses the file system as external memory so that long web pages or documents can be dropped from the context while their URLs or file paths are kept.[3]
Result: Manus noted that with Claude Sonnet, cached input cost USD 0.30 per million tokens versus USD 3 uncached, a tenfold difference (pricing cited by Manus in July 2025).[3] Current Anthropic documentation shows the cache-read discount varies by model.[6]
ACE research — Updating context instead of rewriting it
Researchers proposed ACE (Agentic Context Engineering), a method in which an agent keeps a context "playbook" and improves it with small, structured additions and updates based on its own successes and failures (arXiv, October 2025; ICLR 2026).[4] They warn about "context collapse" when a model rewrites its whole accumulated context at each step: in one AppWorld case the context shrank from 18,282 tokens to 122 tokens in a single step, and accuracy fell from 66.7 to 57.1, below the 63.7 baseline without adaptation.[4]
Result: The authors report an AppWorld average-accuracy gain of 17.1 percentage points (42.4% to 59.5%) for ReAct with DeepSeek-V3.1-671B in the tested online-adaptation setting from context updates learned from execution feedback (research results, not a production deployment).[4]
Chroma — Longer inputs, weaker performance
In its July 2025 "Context Rot" technical report, the vector database company Chroma tested 18 LLMs, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3 models, while keeping each task fixed and changing only the input length.[5] Performance degraded as input grew, often in uneven ways. On a conversational memory test, every model did markedly better with a focused prompt of about 300 tokens than with the full prompt of about 113,000 tokens.[5]
Result: Measured evidence that a large context window does not mean information is used evenly, which supports selecting and trimming context.[5]
Try it today
- Pick one AI task you do often and list what goes into the prompt in three groups: instructions, reference material, and history.
- Remove reference documents that the answer does not actually use, aiming to cut the material roughly in half. Dropping the idea that "more is better" is the first step.[5]
- For repeated work, separate the parts that change each time (the question, the data) from the parts that stay the same (rules, format, examples), and keep the fixed parts at the start. This also helps prompt caching where it is available.[3][6]
- For long, multi-step work, write a short note of "decisions so far" at intervals and attach it to the next request.[2]
- Run the same task twice with only the context changed, compare the results, and save the better setup as a team template.
Limits and direction
There is no single recipe yet. The best setup differs by model and task, and as Chroma's tests show, adding more context can itself lower performance.[5] More context also means more tokens to pay for: Anthropic reports that its multi-agent systems use about 15 times as many tokens as chat interactions.[1] Summaries carry their own risk, because aggressive compression can lose details whose importance appears only later.[2][4] In practice, much of the work is deciding what to leave out.
Research is moving toward automation, such as methods like ACE in which an agent revises its own context from feedback.[4] Agent designs increasingly treat the file system and external memory as an extension of the context, with tools such as structured notes and compaction.[2][3] For businesses, this means getting good results from AI depends not only on writing good prompts but also on how well work information, documents and data are organized.
Which sources explain Context Engineering?
- Anthropic — How we built our multi-agent research system (2025-06-13) — https://www.anthropic.com/engineering/multi-agent-research-system
- Anthropic — Effective context engineering for AI agents (2025-09-29) — https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- Manus — Context Engineering for AI Agents: Lessons from Building Manus (2025-07-18) — https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus
- arXiv — Zhang et al., Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models (v1 2025-10-06, ICLR 2026) — https://arxiv.org/abs/2510.04618
- Chroma — Context Rot: How Increasing Input Tokens Impacts LLM Performance (2025-07-14) — https://www.trychroma.com/research/context-rot
- Claude Platform Docs — Prompt caching (accessed 2026-10-13) — https://platform.claude.com/docs/en/build-with-claude/prompt-caching
Tell us what you think
Your feedback helps us improve the content.