What is context engineering?
Context engineering is the practice of deciding which tokens an AI model sees at each step, including instructions, tool definitions, examples, conversation history and retrieved data, so that the model has what it needs and little else.
Prompt engineering asks how to word an instruction. Context engineering asks what should be in the model's view at all. For an agent that runs dozens of steps, the instruction is a small part of the context; the rest is tool definitions, tool results, history, retrieved documents and notes.
Getting that mix right is now treated by the labs as the core skill in building agents, because a model with too little context guesses and a model with too much loses track.
What context engineering covers
System prompt at the right altitude
Specific enough to guide behaviour, without brittle if-else logic or vague advice.
A small, clear tool set
Few tools with distinct jobs and clear descriptions, loaded on demand when there are many.
A few diverse examples
Examples that show the expected behaviour, rather than long lists of edge cases.
Just-in-time retrieval
References and metadata first, full content only when the step needs it.
History management
Compaction, tool result clearing and notes written outside the window for long runs.
Scoped handoffs
Each subagent gets the minimum context for its job and returns a condensed result.
What the labs say
Anthropic's "Effective context engineering for AI agents" (September 2025) frames context engineering as the successor to prompt engineering and context as a finite attention budget. Google's main statement on the topic (December 2025) treats the working context as a compiled view over a richer stateful system, built by ordered processors, with a stable prefix kept for caching.
Both point to the same practical moves: keep durable state outside the window, load detail just in time, and give each agent or subagent only what its step needs.
How Motiontic's engineers apply it
Motiontic's engineers log the full context of each step during development and read it, because most agent bugs are visible there: a tool result that buried the instruction, a missing record, two tools with overlapping descriptions. Changes to context are then scored with evals rather than judged by eye.
Prompt engineering compared with context engineering
| Prompt engineering | Context engineering | |
|---|---|---|
| Focus | Wording of the instruction | Everything in the model's view at each step |
| Scope | One request | Many steps across an agent run |
| Main levers | Phrasing, examples, format | Tools, retrieval, history, memory, subagents, caching |
| Typical failure | Model misreads the instruction | Model lacks a fact or loses it in noise |
Common questions
What is the difference between context engineering and prompt engineering?
Prompt engineering tunes the wording of instructions. Context engineering manages the whole set of tokens the model sees, including tools, history, retrieved data and memory, across every step of an agent run.
Why does context engineering matter for agents?
Agents run many steps and accumulate tool output and history. Without curation, the context fills with low-value tokens, recall drops and costs rise. Context engineering keeps each step focused.
What are common context engineering techniques?
Just-in-time retrieval, compaction, clearing stale tool results, structured notes outside the context window, minimal non-overlapping tools, and subagents that return condensed results.
Related
Context Engineering vs Prompt Engineering
Wording the instructions, compared with curating every token the model sees.
Context rot
Why agents get worse the longer they run, and what keeps context clean.
Agent memory
Session state for the task at hand, plus stored knowledge the agent recalls later.
Prompt caching
Paying less for the part of the prompt that does not change between calls.
Harness engineering
Designing the environment an agent works in, so its output can be checked and shipped.
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.