85 agentic tools audited for security incidents · Talk to the lab →
MotionticBook a call
Compare

Context engineering vs prompt engineering: the prompt is one part of what the model sees

Prompt engineering is the craft of wording instructions to a model, while context engineering is the wider job of deciding everything the model sees at each step, including instructions, tools, examples, history and retrieved data, so an agent stays accurate across a long task.

Checked

Prompt engineering grew up around single requests: one prompt, one answer. Agents run for many steps, and at each step the model reads a context that has grown with tool results, history and retrieved documents. The wording of the instructions is a small share of that.

Anthropic describes context engineering as the successor to prompt engineering. Google frames context as a compiled view built from a richer stored state. Both treat what the model sees as a budget to manage, not a box to fill.

Why context became the problem

Anthropic describes a finite attention budget: every token in the window spends some of it, and recall degrades as context grows, which it calls context rot. Chroma's Context Rot study tested 18 models and found that performance degrades as input length grows.

For an agent, that means more context is not automatically better. A run that keeps every tool result in the window gets slower, costlier and less accurate as it goes.

The core moves

  • Just-in-time retrieval

    Keep lightweight references such as file paths, queries and links, and load the content only when needed (Anthropic).

  • Compaction and notes

    Summarise older history, and have the agent write structured notes outside the window that it can re-read later (Anthropic).

  • Separate storage from the working view

    Keep sessions, memory and large objects in storage, and build the per-call context from them with explicit, ordered steps (Google).

  • Scope each subagent

    Give each subagent the minimum context it needs and have it return a condensed result (Anthropic, Google).

  • A stable prefix

    Keep the start of the context stable so it can be cached (Google).

Where prompt engineering still matters

Instructions still need to be written well. Anthropic advises system prompts at the right altitude, between brittle if-else rules and vague guidance, and treating tool descriptions as prompts in their own right, tested and refined with evals. Prompt engineering became one part of context engineering rather than disappearing.

How Motiontic applies it

Motiontic's engineers treat context as part of the harness: what loads up front, what loads on demand, what is compacted and what is cached. Each change is measured against an eval set from the client's real tasks, on accuracy, tokens per task and latency, so context decisions are made on numbers.

Prompt engineering compared with context engineering

Prompt engineering compared with context engineering
Prompt engineeringContext engineering
ScopeThe instructionsInstructions, tools, examples, history and retrieved data
Unit of workOne promptEvery step of a multi-step run
Main failureAmbiguous or brittle instructionsContext rot, missing facts or bloated windows
TechniquesWording, examples, output formatsJust-in-time retrieval, compaction, notes, scoped subagents, caching
Where it livesA prompt fileThe agent harness
How it is measuredOutput quality on sample promptsTask success, tokens per task and latency on evals

Common questions

What is the difference between context engineering and prompt engineering?

Prompt engineering is about wording the instructions. Context engineering decides everything the model sees at each step of a task, including tools, history and retrieved data. Anthropic describes context engineering as the successor to prompt engineering.

Is prompt engineering obsolete?

No. Well-written instructions and tool descriptions still matter. They are now one part of context engineering, which also covers what data is loaded, when, and how history is compacted.

What is context rot?

Context rot is the drop in a model's recall and accuracy as its context window fills. Chroma's study of 18 models found performance degrades as input length grows, which is why agents load context selectively.

Does a larger context window remove the need for context engineering?

No. A larger window holds more, but reliability still drops as input grows, and every token adds cost and latency. Context engineering decides what belongs in the window at each step.

How is context engineering measured?

Against an eval set of real tasks, tracking task success, tokens per task and latency. A context change that saves tokens but lowers task success is a regression.

Running agents that have to hold up?

Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.