Context engineering is choosing and arranging everything an AI model sees while it works: the instructions, documents, examples, tools, memory and earlier messages. The aim is to give the model what it needs for the task and nothing that crowds it out.
Think of briefing a temp who starts today. A good note on the desk helps, but so does what else is on the desk: the right files, the phone numbers they will need, and no pile of old paperwork to wade through. Prompt engineering is writing the note. Context engineering is setting up the whole desk.
In a sentence: “The support bot kept quoting last year’s returns policy, so we fixed the context engineering: it now pulls the current policy page and drops the old chat history.”
How is context engineering different from prompt engineering?
The plain point: prompt engineering is about the words of the instructions; context engineering is about everything else the model reads too.
| Term | What it covers |
|---|---|
| Prompt engineering | Covers: writing and testing the instructions themselves, especially the system prompt. |
| Context engineering | Covers: the instructions plus the documents, tool descriptions, memory and message history that sit beside them, and what to leave out. |
| Context window | Differs: the space itself, measured in tokens. Context engineering is deciding what goes into that space. |
Anthropic, which makes Claude, draws the line the same way. It says prompt engineering means “methods for writing and organizing LLM instructions for optimal outcomes”, while context engineering covers the whole set of tokens the model reads, including “system instructions, tools, Model Context Protocol (MCP), external data, message history”.1 It calls context engineering “the natural progression of prompt engineering”: the next step, not a replacement.2
The word matters most for AI agents, which run for many steps. Each step adds tool results and messages, so someone has to decide what the model keeps seeing and what gets trimmed.
Why is more context not always better?
The plain point: a model has limited attention, and piling in more text can make it worse at finding what matters.
It is tempting to paste in everything just in case. Anthropic advises against it: context “must be treated as a finite resource with diminishing marginal returns”, and models have an “attention budget” they spend reading it.2 The same article points to context rot: as the context grows, the model gets worse at recalling details from it.2
Its guiding rule is to “find the smallest set of high-signal tokens that maximize the likelihood of your desired outcome”. In everyday words: give the model the few things that really help, not the whole filing cabinet.2
Good context engineering is mostly editing. Decide what the model must see for this task, give it that, and cut what it does not need, including old messages and tools it will never use.
What does context engineering look like in practice?
The plain point: a handful of habits that keep the model’s working set small and relevant.
- Fetch when needed, not all up front. Anthropic describes agents that keep light pointers, such as file names or links, and load the content “just in time”.2 RAG is one common way to do this.
- Summarise long histories. Anthropic calls this compaction: taking a conversation that is close to the context limit and condensing it.2
- Let the agent keep notes. The agent writes progress notes outside the context and reads them back later.2
- Keep the tool list short. Anthropic names “bloated tool sets” as one of the most common failures it sees.2
For a chatbot user, the same idea is simpler: start a fresh chat for a new task, paste only the documents that matter, and put the key facts where the model will see them. Context engineering in practice goes further.
Why it matters to you
The plain point: when an AI gets something wrong, the cause is often what it was given, not how it was asked.
A model can only work with what is in front of it. Andrej Karpathy, a co-founder of OpenAI,3 put it this way in 2026: “What’s in the context window is your lever over the interpreter, and the interpreter is the LLM.”4 In this site’s reading, that makes “what did it see?” the first question to ask when an answer is off: an outdated document, a missing file or a long, cluttered chat explains a lot of bad output.
Questions people ask
Is context engineering replacing prompt engineering?
No, it builds on it. Anthropic calls context engineering “the natural progression of prompt engineering”, and writing clear instructions is still part of the job.2
Does a bigger context window make context engineering unnecessary?
No. A bigger window holds more, but Anthropic warns that recall gets worse as the context fills up, so choosing what goes in still matters.2
Do I need context engineering for everyday chatbot use?
Only in a light form. In this site’s use, three habits cover most of it: one task per chat, paste only what matters, and say which document is the current one.
Where to go next
- The space it fills: what is a context window? and what is context rot?
- The skill it grows from: what is prompt engineering?
- Doing it: context engineering in practice and how to prompt AI agents.
- Fetching documents on demand: what is RAG?
- The words: the AI glossary.
QUICK CHECK · 3 QUESTIONS
Pick an answer to see if you got it. Nothing is recorded.
1. What does context engineering cover that prompt engineering alone does not?
- Only the wording of the system prompt
- Everything else the model reads too, such as documents, tools, memory and earlier messages
- Training the model on new data
Show the answer
Answer: Everything else the model reads too, such as documents, tools, memory and earlier messages. Prompt engineering is about the instructions; context engineering covers everything else the model sees as well.
2. Why is pasting in as much context as possible not always better?
- Models have limited attention, and recall gets worse as the context fills up
- Models refuse to read long documents
- Extra context changes the model permanently
Show the answer
Answer: Models have limited attention, and recall gets worse as the context fills up. Anthropic treats context as a finite resource; as it grows, the model gets worse at recalling details from it.
3. Which habit is an example of context engineering?
- Using more capital letters in a prompt
- Asking the same question several times
- Summarising a long conversation so the model keeps only what matters
Show the answer
Answer: Summarising a long conversation so the model keeps only what matters. Compaction, condensing a long history, keeps the model’s working set small and relevant.
Related terms: AI prompt generator · AI search engine · Chain of thought · Context rot · Context window · Deep research
- 1Anthropic, Effective context engineering for AI agents, Anthropic Engineering, 29 Sep 2025, read at source 19 Oct 2026“Prompt engineering refers to methods for writing and organizing LLM instructions for optimal outcomes”; “Context engineering refers to the set of strategies for curating and maintaining the optimal set of tokens (information)”; “(system instructions, tools, Model Context Protocol (MCP), external data, message history, etc)”. ↑
- 2Anthropic, Effective context engineering for AI agents, 29 Sep 2025, read at source 19 Oct 2026“At Anthropic, we view context engineering as the natural progression of prompt engineering.” ↑a“Context, therefore, must be treated as a finite resource with diminishing marginal returns.” and “LLMs have an “attention budget” that they draw on when parsing large volumes of context.” ↑b“as the number of tokens in the context window increases, the model’s ability to accurately recall information” (sentence continues). ↑c“find the smallest set of high-signal tokens that maximize the likelihood of your desired outcome.” ↑d“agents built with the “just in time” approach maintain lightweight identifiers” (sentence continues). ↑e“Compaction is the practice of taking a conversation nearing the context window limit” (sentence continues). ↑f“Structured note-taking, or agentic memory, is a technique where the agent regularly writes notes” (sentence continues). ↑g“One of the most common failure modes we see is bloated tool sets” (sentence continues). ↑h“At Anthropic, we view context engineering as the natural progression of prompt engineering.” ↑i“Context, therefore, must be treated as a finite resource with diminishing marginal returns.” ↑j
- 3Sequoia Capital, Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan, YouTube, 29 Apr 2026, read at source 13 Oct 2026, video description“Andrej Karpathy (co-founder of OpenAI, former head of AI at Tesla, and now founder of Eureka Labs)”. ↑
- 4Andrej Karpathy, Sequoia Ascent 2026 summary, edited transcript, read at source 13 Oct 2026“Software 3.0 is about programming through prompting. What’s in the context window is your lever over the interpreter, and the interpreter is the LLM.” ↑
Andrej Karpathy, Sequoia Ascent 2026 summary, edited transcript, read at source 13 Oct 2026 (as cited on how to prompt AI agents).
The comparisons and examples on this page (the temp’s desk, the support bot, the three chat habits) are this site’s own ways of explaining, not claims from these sources.
Free printable AI cheat sheets, and AI news every week.
Sixteen one-page AI guides and checklists in one free PDF, no sign-up. And if you want to keep up, the newsletter covers what changed in AI each week, in plain English, with the sources.
SUBSCRIBE FREE ↗ GET THE CHEAT SHEET PACK