What is context engineering?

Short answer

Context engineering is designing everything a language model sees while it works on a task: instructions, documents, memory, tool results, examples and rules, and deciding what to leave out. The term spread in June 2025, when Shopify’s Tobi Lütke and Andrej Karpathy argued it describes the real skill better than “prompt engineering.”

Mikhail Savchenko

Where the term came from

In June 2025 Shopify’s chief executive Tobi Lütke wrote that he preferred “context engineering,” describing it as “the art of providing all the context for the task to be plausibly solvable by the LLM” (Lütke’s post). About a week later Andrej Karpathy backed him: in serious LLM applications, context engineering is “the delicate art and science of filling the context window with just the right information” for the next step (Karpathy’s post; chapter “Memory and Context”).

In September 2025 Anthropic put the job even more briefly: “finding the smallest possible set of high-signal tokens” (Anthropic). The key word is “smallest.”

Why not just dump everything in

Context is the desk onto which the right folders have been laid out from the archive. The amount models can take has grown from a few pages to a million tokens and more, and with it the temptation to pour the whole archive onto the desk (chapter “Memory and Context”). It is not worth it. The 2023 paper “Lost in the Middle” showed that models use information at the start and end of a long input far better than what sits in the middle (arXiv). In July 2025 Chroma tested 18 models and found that all of them get less reliable as input grows, even on simple tasks, and called it context rot (Chroma; same chapter).

The second trouble is old mixed with new. Put last year’s salon price list in the store next to this year’s and search returns both, so the agent is equally likely to quote a client either price (same chapter).

What it looks like in practice

An agent is always on its first day: every conversation starts from a blank page, and everything it needs to know about the project has to be handed over again, in writing (chapter “Architecture as a System of Prohibitions”). What has to be designed is its whole information environment: what it knows from the start, when and where it learns the rest, what it is allowed to do, which tools it sees and what stays in memory after the task (chapter “Memory and Context”).

On my own projects a cheap model inside good memory turned out far smarter than expected, while an expensive one arriving from a blank page spent its first half hour stepping on rakes someone had already written down (chapter “Intelligence Does Not Live in the Model”). The first two modules of my vibe coding course teach exactly this to people who do not program: stating a task and building a project environment around the model.

More questions

What is the difference between context engineering and prompt engineering?
A prompt is one part of the context, the text of the request. Context engineering covers the rest: which documents, rules, memory and tool results the model sees at this step, and what is better kept away from it.
What is context rot?
Chroma’s name for the effect in which models become less reliable as their input grows longer, even on simple tasks. In its 2025 test it applied to all 18 models checked.
Does a bigger context window solve the problem?
No. A million-token window lets you put more in, but models use the middle of a long input worse and lose reliability as it grows. Choosing what to show remains the job of a person or of the system around the model.
Nobody Writes Code Anymore

Book

Nobody Writes Code Anymore

Software development once writing became free

Writing code became almost free. What is scarce now is knowing what not to write.