What is context engineering?

Context engineering is the practice of deciding what a model sees at each step: instructions, tools, retrieved data and history. Tobi Lütke and Andrej Karpathy popularised the name in June 2025, though others used it earlier. In a coding agent it covers CLAUDE.md, AGENTS.md, files read and tool output. It governs what the agent reads and says nothing about checking its output.

Origin Tobi Lütke popularised the name in a post on X (opens in a new tab) on 19 June 2025 and Andrej Karpathy backed it in a post of 25 June (opens in a new tab), but neither coined it: Ankur Goyal had used it on 20 April 2025 (opens in a new tab) and Cognition’s Walden Yan on 12 June 2025 (opens in a new tab).

Also on Wikidata (opens in a new tab)

Last updated
By
Published
In Polish
Inżynieria kontekstu
Closest ladder level
All levels, free guide
Also searched as
context engineering for agents, context engineering for coding agents, agentic context engineering

Then $19.99 a month or $99.99 a year. Cancel from your account page. 30-day refund on a first purchase.

On this page Why it mattersContext engineering vs vibe codingContext engineering vs prompt engineeringHow each tool does itQuestionsSources

Why it matters.

A coding agent works from whatever sits in its context window on each turn, and that window fills with instruction files, file reads and command output. When it fills, older material is compacted and instructions the agent was following can quietly disappear. Context engineering treats this as a design problem: keep what every session must know in a short instruction file, and let the agent look up the rest when a task needs it. Better context raises the odds of a correct change but does not check it, so pair it with tests, hooks or review.

Context engineering vs vibe coding

Context engineering decides what the agent reads; vibe coding is the habit of accepting what it writes without reading it, so the two answer different questions.

Context engineering compared with vibe coding: what it names, who writes the code, who checks it, what stops the loop, where the name came from and where it breaks
QuestionVibe codingContext engineering
What it names A way of working: accept the model’s output without reading it A discipline: decide what the agent sees at each step
Who writes the code The model The agent
Who checks it Nobody reads the diff; the human judges behaviour by eye Not part of the term: it covers the input, not the output
What stops the loop The human decides it works Nothing of its own
Where the name came from Andrej Karpathy, post on X, 2 February 2025 Popularised by Tobi Lütke (19 June 2025) and Karpathy (25 June 2025); used earlier by Ankur Goyal (20 April 2025)
Where it breaks Anything others maintain; Karpathy called it fine for “throwaway weekend projects” A well-fed agent can still be wrong: execution “still depends on how well the LLM interprets them” (Böckeler, 5 February 2026)

Vibe coding in Karpathy’s original sense. The contrast is this site’s reading: no source sets the two side by side, apart from Thoughtworks’ sponsored piece quoted in the FAQ. Source: Vibe coding vs agentic engineering, 2026-10-10.

Context engineering vs prompt engineering

Sources agree that the prompt is one part of the context and disagree on what to call the relationship.

Four sources, their dates, and how each relates context engineering to prompt engineering
SourcePublishedHow it relates the two
Cognition (Walden Yan) 12 June 2025 Context engineering is “the next level” of prompt engineering
LangChain (Harrison Chase) 23 June 2025 “prompt engineering is a subset of context engineering”
Gartner 28 July 2025 “Context engineering is in, and prompt engineering is out.”
Anthropic Applied AI team 29 September 2025 “the natural progression of prompt engineering”
The line that prompt engineering is “out” is Gartner’s, from its summary. Karpathy’s post opens with “+1 for ‘context engineering’ over ‘prompt engineering’.”

Source: Vibe coding vs agentic engineering, 2026-10-10.

How each tool does it.

Cursor, Claude Code and Codex each name this their own way. Each note carries the date it was checked.

Cursor

Applies Rules from .cursor/rules/; the @cursor/sdk 1.0.32 runtime also loads a root AGENTS.md on every request, and CLAUDE.md only when third-party configuration loading is on.

The Cursor IDE is expected to use the same rule service, but that was not re-verified because cursor.com could not be reached.

Cursor token management guide, Cursor SDK 1.0.32, 2026-09-26

Claude Code

Loads CLAUDE.md at launch from the project root and ~/.claude/, and reads AGENTS.md only when a project has no CLAUDE.md (v2.1.277+); /context lists the memory files that loaded.

Claude Code memory guide, Claude Code 2.1.283, 2026-09-26

Codex

Adds AGENTS.md to every session before it acts: one global file from ~/.codex/ plus at most one project file per directory, from the repository root down; codex debug prompt-input prints what loaded.

Codex AGENTS.md guide, Codex CLI 0.157.1, 2026-09-26

Questions about context engineering.

How is context engineering different from vibe coding?

Context engineering decides what the agent reads; vibe coding is accepting what it writes without reading it. Our reading: the two sit on different axes, so a team can curate its context well and still vibe code. The nearest published contrast is Thoughtworks’ sponsored piece in MIT Technology Review (5 November 2025), which describes a transition “from vibe coding to what’s being termed context engineering”.

Who coined context engineering?

No one person did. Ankur Goyal used the phrase on 20 April 2025 and Cognition’s Walden Yan on 12 June 2025. Tobi Lütke popularised it on 19 June 2025, calling it “the art of providing all the context for the task to be plausibly solvable by the LLM”, and Andrej Karpathy added a “+1” on 25 June. Karpathy did not write the line “prompt engineering is out”; that is Gartner’s.

What is the difference between context engineering and prompt engineering?

Prompt engineering is writing and organising the instructions for a model call. Context engineering is the wider job of curating everything the model sees on each turn, including tools, retrieved data and history; Anthropic calls it “iterative” and says curation happens “each time we decide what to pass to the model”. Sources differ on whether prompting is a predecessor or a subset, and agree it is one part of the context.

How do I do context engineering with Claude Code, Codex or Cursor?

Start with the instruction file each tool reads: CLAUDE.md in Claude Code, AGENTS.md in Codex, Rules in Cursor. Keep it short, because every line is paid for on every task, then check what loaded: /context in Claude Code, codex debug prompt-input in Codex. Cursor’s @cursor/sdk 1.0.32 runtime also loads a root AGENTS.md unconditionally.

Read the guides in the same words.

Open every guide with the 7-day free trial. Each term is defined once here, and the guides use it the same way.

Then $19.99 a month or $99.99 a year. Cancel from your account page. 30-day refund on a first purchase.