
Context engineering: deciding what the model sees
In short: Context engineering is deciding what an LLM sees on every call: instructions, tools, retrieved data, memory and history, kept as small as the task allows.
Context engineering is the practice of deciding what goes into a language model's context window on every call, and in what form: system instructions, tool definitions, retrieved documents, memory, examples and conversation history. Anthropic's September 2025 guide frames it as curating all the tokens present during inference, where prompt engineering covers writing the instructions.
Context engineering in plain words
Prompt engineering is writing a good question. Context engineering is preparing the whole briefing pack, and keeping it current as the meeting goes on.
How it works
Anthropic treats context as a finite resource with an attention budget that every new token draws down. Its stated aim is the smallest set of high-signal tokens that makes the desired outcome likely. In practice that means:
- Keeping instructions short and specific.
- Exposing few, well-described tools.
- Retrieving just enough data, just in time, instead of preloading everything.
- Compacting or summarising old history.
- Moving long work into subagents or notes so the main context stays clean.
Position matters as well as volume. Liu et al., in July 2023, found that models did best when the relevant information sat at the start or end of a long input, and worse when it sat in the middle.
Example
As an illustration, take an agent answering billing questions. Instead of loading all 300 policy pages, it gets a 20-line system prompt, three tools (search_policy, get_account, escalate) and retrieves two relevant policy sections per question. The model is unchanged; its context is smaller and cleaner.
Where you'll meet it
- Agent harness design and coding-agent configuration
- RAG pipelines and their chunking and reranking choices
- Memory systems and compaction strategies
- Subagent setups that hand back condensed summaries
What it changes for you
For developers, it gives a first place to look when an agent misbehaves: missing facts, stale instructions or noise in the context. For teams, context becomes a designed artefact with owners, like an API contract. It is also one reason the same model can look strong in one product and mediocre in another.
Context engineering vs prompt engineering
Prompt engineering focuses on the wording of instructions. Context engineering covers everything the model sees, including what to leave out.
Common mistake
My view: treating more context as more help. Every irrelevant paragraph is a distraction the model has to ignore. The best context is the smallest one that still contains the answer.
Related terms
Context window · Prompt engineering · Context rot · Retrieval-augmented generation · Agent memory
From the archive: Context compaction needs a recovery test · Agent leverage follows context consolidation
The best context is the smallest one that still contains the answer.


