Context engineering: the skill that replaced prompt engineering

Prompt engineering was about phrasing. Context engineering is about what the model can see, which matters far more, and which costs money on every single turn you get it wrong.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Context engineering is deciding what enters a model working memory and what stays out. For coding agents that means the project memory file, which files get read, how much command output comes back, which tool definitions load, and when to clear. It matters more than phrasing because everything in the window is re-sent on every turn, and because irrelevant context measurably degrades output rather than merely costing extra. Four of the six things in a typical window are under your direct control.

What you need to know
  • The question is what the model can see, not how you phrased the request.
  • Everything in the window is re-sent every turn. Waste compounds quadratically.
  • More context is not better. Irrelevant context competes for attention and stale context actively misleads.
  • A lot loads before you type anything: system prompt, project memory, skill listing, tool names, git state.
  • Naming the files in your prompt is the cheapest technique and the most effective.
  • /clear costs nothing. /compact is itself a large request.

What is actually in the window

Before your first character reaches the model, a coding agent has already loaded several thousand tokens you never see. Knowing the list is most of the skill, because it tells you which levers exist.

A typical coding session, and who controls each part.

ContentTypical sizeControlled by
System prompt and tool definitionsA few thousand tokensThe harness
Project memory (CLAUDE.md / AGENTS.md)500 to 5,000, every turnYou
Skill and command listingsOne line each, at startupYou, by pruning
MCP tool namesNames at startup, schemas on demandYou, by disabling servers
Environment and git stateA few hundred tokensThe harness
Files the agent read1k to 20k eachYou, via prompts
Command and test output200 to 10,000+ per runYou, via scoping
The conversationGrows every turnYou, via clear and compact

Why more is not better

The intuition that a bigger context window means better answers is wrong in a specific and repeatable way. Four separate things go wrong, and only one of them is money.

  1. Irrelevant material competes. A model attending to 180k tokens where 20k were relevant is distributing attention across a great deal of noise.
  2. Stale context actively misleads. A bug you fixed forty minutes ago is still in the conversation, and the agent will reason about it as though it were current.
  3. It costs on every turn. Not once. Every single turn, for the rest of the session.
  4. It is slower. More tokens to process before the first output token appears.

There is a fifth failure, and it is subtle

A conversational constraint can be summarised away. Claude Code auto mode treats a boundary you state in chat, such as "do not push until I review", as a block signal, and Anthropic notes that the boundary is re-read from the transcript on every check, so compaction can remove the message that stated it. Their own advice is that a hard guarantee needs a deny rule in settings, not a sentence in the conversation. The same logic applies to any constraint you care about: if it must survive an hour of work, put it in a file, not in a message.

The arithmetic that makes it worth doing

Context waste does not add. It multiplies by the number of turns after the point at which you added it.

A 2,000-token block of dead weight added at turn 1 of a 30-turn session.

Where it landsTimes re-sentTokens billed
A one-off question12,000
Turn 25 of 30612,000
Turn 1 of 303060,000
Project memory file, every sessionEvery turn, foreverUnbounded

Caching softens this considerably. On the Anthropic API, as of August 2026, a cache read costs 0.1x the base input rate, so a stable prefix is re-sent at a tenth of list price. Two caveats keep it from being a free pass. Cache writes cost more than plain input (1.25x at the five-minute TTL, 2x at the one-hour TTL), so churning your prefix is worse than never caching it. And the cache expires: for Claude Code as of August 2026 the lifetime is one hour on a subscription and five minutes on an API key, a cloud provider, or once you are drawing on usage credits.

Eight techniques that work

#TechniqueWhy it works
1Name the files and symbolsRemoves the exploration phase, which is the most expensive part of any task
2Clear between unrelated tasksStops paying for and reasoning about stale material
3Keep project memory short and surprisingIt is sent every turn; obvious lines are pure waste
4Scope command outputRun one test file, not the suite
5Filter noisy output in a hookA grep for ERROR turns a 10k-token log into a few hundred
6Delegate verbose work to a subagentThe logs stay in its window; only a summary comes back
7Move workflow instructions into skillsSkills load on demand; memory-file lines load always
8Compact at task boundariesA clean thing to summarise produces a clean summary

The project memory test

For every line in a CLAUDE.md or AGENTS.md, ask: would a competent engineer new to this repository get this wrong? If no, delete it. The agent already knows what your framework does; it does not know that your integration tests need Postgres 16 exactly. Anthropic suggests keeping the file under about 200 lines for the same reason.

The same file, two ways.

WasteWorth its tokens
"This is a TypeScript project using React""src/legacy/ is generated. Edit the .proto, then make gen."
"Write clean, maintainable code""Errors wrap with %w. Bare returns fail review."
"We value good test coverage""make test takes 6 minutes. Use go test ./internal/x/... while iterating."
"Follow the existing style""Do not add dependencies without asking. The lockfile is reviewed."

Two commands people confuse

They are not variants of each other.
/clear     drops the conversation and starts fresh
           cost: nothing. use it between unrelated tasks

/compact   summarises the conversation into a shorter form
           cost: a large request, because it reads what it summarises
           use it mid-task, when you need continuity

/context   shows what is currently occupying the window
           use it before you guess at what to prune
What clear, compact and context each do to the conversation, and what each one costsTHREE INSTRUMENTS, ONE OF THEM IS NOT FREEcommandthe conversationaftercost/clearemptynothingit has to read all of this first/compacta summaryone large request/contextnothing, only reportsCompacting a large context is itself one of the biggest requests in the session.

Measuring whether it worked

Context engineering is unusually measurable, which distinguishes it from most advice about working with models. Every signal below comes out of data the CLIs already write to disk.

SignalMeans
Cost per task fallingFewer exploration turns. It worked
Cache read share risingStable prefix. Good hygiene
One repo costing 3x its peersThat repo is hard to navigate. Fix its memory file
Input tokens climbing across similar tasksContext creep. Clear more often
Cache write share risingYou are churning the prefix. Something volatile moved to the front
Edit rejection rate risingSomething recently added to context made things worse

Questions people ask

Deciding what enters a model working memory and what stays out. For coding agents that means project memory files, which files get read, how much command output returns, which tool schemas load, and when to clear the conversation.

Prompt engineering is about phrasing a request. Context engineering is about what the model can see when it reads that request, which for agents matters considerably more because the window is re-sent on every turn.

No. Irrelevant material competes for attention, stale context actively misleads, everything in the window is re-paid for on every turn, and more tokens means slower time to first output.

Context has accumulated enough irrelevant material to compete with the part that matters, and old decisions you have since reversed are still being reasoned about. Clearing between unrelated tasks fixes it immediately.

Naming the specific files and symbols in your prompt. It removes the exploration phase, which is the most expensive part of any agent task and the main driver of turn count.

Anthropic suggests under about 200 lines for CLAUDE.md. It is sent on every turn, so anything the agent could have inferred is pure waste and dilutes the lines that matter. Move long workflow instructions into skills, which load on demand.

Clear between unrelated tasks: it costs nothing. Compact mid-task when you need continuity: it costs a large request, because the model has to read the whole conversation to summarise it.

Much less than they used to. Claude Code defers MCP tool schemas by default, so only names load at startup and schemas arrive on demand. Run /context to see actual consumption rather than pruning servers on the basis of older advice.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Claude Code: manage costs effectively
  2. Claude Code memory (CLAUDE.md)
  3. Anthropic prompt caching
  4. AGENTS.md specification
Try it

Measurable,
not theoretical.

Continuum shows cost per repository and the cache versus fresh input split per session, so context work can be verified rather than assumed.

free app · your subscriptions · local-first