What It Is
Terminology · LLM Engineering · AI Agents · Language Models · Benchmarking · AI · ExplainerThe term and its practice, January 2023 to September 2026
Second of five · the layer around the prompt
Enough, or Less? Context Engineering Said Both in One Week
Context engineering is the work of choosing everything a language model sees before it answers — instructions, documents, tool definitions, conversation history — and not only the prompt. The phrase is on record by January 2023, as one half of prompt engineering. It gained traction in June 2025, when Shopify’s chief executive called it the art of providing all the context a task needs; within a week, others were warning that too much context makes a model worse. In July Chroma measured that across eighteen models, and in September Anthropic’s formal definition made the smallest possible set of high-signal tokens the goal. By 2026 the same two words also name a company’s whole knowledge layer.
- 878days from the earliest use of the phrase found (January 2023) to Tobi Lütke’s post (June 2025)
- 6days between “all the context” and Andrej Karpathy’s warning that too much context hurts
- 18models Chroma tested; in every one, reliability fell as input grew
- 1,000context engineers Cognizant said in August 2025 it would deploy within a year
Four definitions, in under three years Side by side, they do not agree on whether the job is adding context or cutting it.
Riley Goodside · 23 Jan 2023
“Selecting and preparing relevant context”
- In full: I think prompt engineering can be divided into “context engineering”, selecting and preparing relevant context for a task, and “prompt programming”, writing clear instructions.
- A comment on Hacker News, quoted by Simon Willison the same day. It is the earliest use of the phrase found — not proof that nobody wrote it earlier.
Tobi Lütke · 19 Jun 2025
“Providing all the context”
- In full: the art of providing all the context for the task to be plausibly solvable by the LLM.
- He begins “I really like the term” — an endorsement of a phrase already in use. A week earlier, Walden Yan of Cognition had called context engineering “effectively the #1 job of engineers building AI agents”.
Andrej Karpathy · 25 Jun 2025
“Just the right information for the next step”
- “Too little or of the wrong form and the LLM doesn’t have the right context for optimal performance. Too much or too irrelevant and the LLM costs might go up and performance might come down.”
- From “the task” to “the next step”: the choosing happens every turn, not once per job.
- And a limit on the term itself: context engineering is “just one small piece of an emerging thick layer of non-trivial software”.
Anthropic · 29 Sep 2025
“The smallest possible set of high-signal tokens”
- Formally: the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference, including all the other information that may land there outside of the prompts.
- Prompt engineering now sits inside it: context engineering is its “natural progression”, and “the curation phase happens each time we decide what to pass to the model”.
- A vendor’s definition, written by its Applied AI team for building on its own platform.
How firmly each part stands Sorted by standing. A dated document, a measurement and a vendor’s own figure are different kinds of fact.
| Standing | What | On what |
|---|---|---|
| Documented | The phrase in January 2023, as the half of prompt engineering that is “selecting and preparing relevant context for a task” | Riley Goodside’s Hacker News comment, 23 Jan 2023, dated by the site; attributed to him by Simon Willison the same day |
| Documented | Lütke’s “all the context” at 03:01 UTC on 19 June 2025, and Karpathy’s “too little … too much” at 15:54 UTC on 25 June, six days apart; Karpathy’s post quotes Lütke’s | Both posts on X, read in full; the times also follow from the posts’ own ID numbers |
| Documented | “Context rot” named on 18 June 2025: as context grows, “the output quality falls off rapidly” | A pseudonymous Hacker News comment, dated by the site. The naming is documented; the commenter’s own experience is anecdote |
| Documented | Anthropic’s formal definition, and “the smallest possible set of high-signal tokens” as its guiding principle | Anthropic’s Applied AI team, 29 Sep 2025, read in full |
| Documented | There is still no Wikipedia article for context engineering; it is a section inside “Prompt engineering” | Wikipedia, revision of 21 Sep 2026 |
| Measured | 18 LLMs, task held constant and only input length varied: performance “grows increasingly unreliable as input length grows”; focused prompts of about 300 tokens beat full ones of about 113,000 in every model | Kelly Hong, Anton Troynikov and Jeff Huber, Chroma technical report, 14 Jul 2025, read in full — research by a company that sells a retrieval database, with its code released |
| Self-reported | Context editing plus a memory tool: 39% better than baseline on an internal agentic-search test, and 84% fewer tokens over 100 turns | Anthropic’s own announcement, 29 Sep 2025; not independently checked |
| Surveyed, method not stated | 79% of IT and AI infrastructure leaders call context very important; 81% still handle it ad hoc or exploratively | Redis, 30 Jul 2026 — a vendor’s survey whose page states no sample size or method |
| Our reading | Sufficiency and scarcity were both published in the first week; the formal definition later chose scarcity | Assembled from the dated posts above. No source consulted remarks on it |
Timeline
From a comment to a job title Every date is a publication. When people changed how they worked is not measured by any of them.
- 23 Jan 2023Half of prompt engineering. Riley Goodside, on Hacker News, splits prompt engineering into “context engineering” — selecting and preparing relevant context — and “prompt programming”. The earliest use of the phrase found.
- 19 Dec 2024The work, without the popular word. Anthropic calls “an LLM enhanced with augmentations such as retrieval, tools, and memory” the basic building block of agentic systems.
- 7 Apr 2025“Everything is context engineering.” Dex Horthy’s 12-Factor Agents guide on GitHub, by its commit date.
- 12 Jun 2025The number-one job. Walden Yan of Cognition calls context engineering “the next level” of prompt engineering, done “automatically in a dynamic system”.
- 18 Jun 2025The problem gets a name. A Hacker News commenter suggests “context rot”: as context grows, “the output quality falls off rapidly”.
- 19 Jun 2025All the context. Tobi Lütke prefers the term to prompt engineering: providing all the context for the task to be plausibly solvable. Simon Willison, Harrison Chase and Philipp Schmid all quote it within eleven days.
- 22 Jun 2025Three days later, the case against. Drew Breunig: “longer contexts do not generate better responses”, and four ways contexts fail — poisoning, distraction, confusion, clash.
- 23 Jun 2025A framework vendor’s definition. LangChain’s Harrison Chase: dynamic systems giving the right information and tools in the right format; prompt engineering is “a subset” of it.
- 25 Jun 2025Six days later, both at once. Andrej Karpathy quotes Lütke and redefines it: just the right information for the next step — too little hurts, and so does too much.
- 27 Jun 2025Sticking power. Simon Willison: the term “may have sticking power”, because “inferred definitions are the ones that stick” and this one’s is likely to be closer to what is meant.
- 14 Jul 2025Somebody measures it. Chroma’s Context Rot report: eighteen models, none of them handling long input as reliably as short. Its title uses the name first seen on Hacker News 26 days earlier.
- 17 Jul 2025A discipline, on paper. Lingrui Mei and colleagues publish a survey presenting it as “a formal discipline”, drawing on over 1,400 research papers.
- 29 Aug 2025A job title. Cognizant says it will deploy 1,000 context engineers within a year, defining context as a company’s “pool of knowledge”.
- 29 Sep 2025The smallest possible set. Anthropic’s formal definition makes scarcity the guiding principle, 102 days after “all the context”. The same day it ships context editing and a memory tool.
- Feb 2026Two more measurements. Damon McMillan finds a model’s capability matters far more than the format of its context; LOCA-bench finds agents degrade as their context grows, and that context management helps.
- 30 Jul 2026A vendor asks the buyers. Redis’s survey: nearly all the IT and AI infrastructure leaders it asked say context decides whether AI works; few say they have built the systems to supply it.
- Sep 2026Still a section, not an article. Wikipedia has no page for context engineering; it is a section inside “Prompt engineering”, an article last revised on 21 September.
The Argument
Not an inversion — a choice Both tests were on the table in the first week. The formal definition picked one.
There are two ways to fail a model with context, and the June 2025 posts named both. Lütke’s definition is a sufficiency test: have you given the model everything it needs for the task to be “plausibly solvable”? Harrison Chase’s, four days later, asks the same — can it “plausibly accomplish the task”. The other test is scarcity. Three days after Lütke, Drew Breunig argued that longer contexts do not produce better answers and listed four ways they go wrong; six days after Lütke, Karpathy wrote that too little context hurts and so does too much. The failure already had a name, “context rot”, from a Hacker News comment the day before Lütke’s post. What came later was evidence and a decision. Chroma held each task constant, varied only the length of the input, and found reliability falling in all eighteen models it tested; its report ends by calling context engineering “essential for reliable performance”. Anthropic cited that report and gave a mechanism: a transformer relates every token to every other, n tokens make n² pairs, and attention is stretched thinner as the window fills — a gradient, not a cliff. Its definition then made the second test the rule: find the smallest possible set of high-signal tokens, while warning that minimal does not mean short. Nothing here shows that Chroma’s report changed anyone’s definition. The dates show only the order: named, measured, then formalised. The scope moved too. In 2023 context engineering was one part of prompt engineering; by 2025 LangChain and Anthropic both put prompt engineering inside it.
- too little · too muchboth named by Karpathy, six days after “all the context”
- 18models in which Chroma found long input handled less reliably than short
- n²pairwise relationships from n tokens — Anthropic’s account of why attention thins
What Others Add
What practitioners do about it Anthropic’s guide is the most detailed account; the table after it adds what others published.
- 1Write at the right altitudeBetween hard-coded, brittle logic and vague guidance that assumes shared context. Aim for the minimal set that fully specifies the behaviour — minimal does not mean short.
- 2Keep the tool set smallSelf-contained, robust to error, minimally overlapping. If a human engineer cannot say which tool fits a situation, the model cannot be expected to do better.
- 3Fetch late, not earlyKeep lightweight identifiers — file paths, stored queries, links — and load data at run time. Metadata is signal:
test_utils.pyintestsmeans something different from the same name insrc/core_logic/. - 4For long jobs, throw things awayCompaction (summarise a full window and restart from the summary), structured note-taking (notes kept outside the window and read back), and sub-agents (explore with tens of thousands of tokens, return one to two thousand).
Beyond one vendor’s guide What others building agents published, and what was measured. The last column says what kind of evidence each is.
| Who | What they add | What kind of evidence |
|---|---|---|
| Manus, Jul 2025 | Treat the KV-cache hit rate as the key metric: input outweighs output about 100 to 1, and cached input was ten times cheaper. Mask tools rather than removing them; use the file system as memory; have the agent keep and update a todo.md; leave failed actions in the context so the model can learn from them. | The company’s own account of its own agent |
| Anthropic, Sep 2025 | Context editing clears stale tool results; a memory tool keeps files outside the window. Reported: 39% better on an internal agentic-search test with both, 29% with editing alone, 84% fewer tokens over 100 turns. | Self-reported, unaudited |
| Damon McMillan, Feb 2026 | 9,649 experiments on 11 models: the format of the context (YAML, Markdown, JSON, TOON) made no significant difference overall; a 21-point gap between frontier and open models dwarfed every format or architecture effect. | Single-author preprint; abstract read |
| LOCA-bench, Feb 2026 | As an agent’s environment grows, its performance generally degrades; advanced context-management techniques “can substantially improve” its success rate. | Preprint by Weihao Zeng, Yuzhen Huang and Junxian He; abstract read, no figure carried |
Two things deserve separating from the vendors’ framing. The first is the loop. Simon Willison’s definition — “an LLM agent runs tools in a loop to achieve a goal” — and Anthropic’s own “tools in a loop” explain why the problem grew when it did: every turn of the loop adds tool output to the window, so the choosing has to happen every turn. The second is the prediction. Anthropic expects agentic design to “trend towards letting intelligent models act intelligently, with progressively less human curation”. That is a forecast by a party with an interest in it, and it should be read as one. The measurements point both ways. McMillan found a model’s capability mattered far more than how its context was formatted, which fits the forecast; Chroma and LOCA-bench found long and growing context still degrading performance, which is why the curation exists. Both can hold at once: curation may get easier and stay necessary.
- 100 : 1input to output tokens in Manus’s agent, by its own count
- 1–2ktokens a sub-agent returns from tens of thousands explored, per Anthropic
- 21percentage points between frontier and open models in McMillan’s study — larger than any format effect
Conclusion
What to take away Three things, and the last is how little can be said about where the word came from.
Ask which test someone means
“Provide all the context” and “find the smallest possible set of tokens” are both published definitions of this term, and they point in opposite directions. The position with the most evidence behind it holds both: missing context makes a task unsolvable, and surplus context measurably degrades the model. “Context engineering” on its own does not say which failure is being fixed.
In 2026 it names three different jobs
A developer choosing tokens turn by turn (Anthropic); a team building the system that assembles context (LangChain, Philipp Schmid); and a company organising its knowledge for agents (Cognizant, Redis). The figures behind the third — Cognizant’s 1,000 engineers, Redis’s percentages — come from firms selling that work, and Redis’s page does not say how many people it asked.
Nobody found here coined it
The earliest use found is Riley Goodside’s, in January 2023, 878 days before Lütke’s post. Lütke wrote that he liked the term; Harrison Chase wrote that his definition built on others’. Wikipedia, in September 2026, still gives it a section rather than an article. “Earliest found” is all that can be said.
What could not be verified
Unconfirmed report — that Gartner told AI leaders in July 2025 that “context engineering is in, and prompt engineering is out”. The line is attributed to Gartner by Redis’s 2026 survey; Gartner’s own document could not be opened.
Take-home and sources
- Riley Goodside, Hacker News (23 Jan 2023)
- Simon Willison (23 Jan 2023)
- Erik S. and Barry Zhang, Anthropic (19 Dec 2024)
- Dex Horthy, 12-Factor Agents, GitHub (7 Apr 2025)
- Walden Yan, Cognition (12 Jun 2025)
- Workaccount2, Hacker News (18 Jun 2025)
- Tobi Lütke, X (19 Jun 2025)
- Drew Breunig (22 Jun 2025)
- Harrison Chase, LangChain (23 Jun 2025)
- Andrej Karpathy, X (25 Jun 2025)
- Simon Willison (27 Jun 2025)
- Philipp Schmid (30 Jun 2025)
- Kelly Hong, Anton Troynikov and Jeff Huber, Chroma (14 Jul 2025)
- Mei et al., arXiv (17 Jul 2025)
- Yichao Ji, Manus (18 Jul 2025)
- Cognizant (29 Aug 2025)
- Simon Willison (18 Sep 2025)
- Rajasekaran, Dixon, Ryan and Hadfield, Anthropic (29 Sep 2025)
- Anthropic, context management (29 Sep 2025)
- Damon McMillan, arXiv (5 Feb 2026)
- Zeng, Huang and He, arXiv (8 Feb 2026)
- Redis (30 Jul 2026)
- Wikipedia, “Prompt engineering” (revision of 21 Sep 2026). All read 28 Sep 2026. This term is one of five covered by the standing topic LLM engineering, which sets it beside the other four.