Concepts / practice
Context engineering stable
Context engineering · Practice; term popularized in 2025
- Type
- practice
- Published
- Reviewed
What it is
Prompt engineering was about the words in one prompt. Context engineering is about everything in the window: the system prompt, tool definitions, retrieved documents, memory, conversation history and the outputs of previous steps. The job is to keep that set small and relevant on every turn, because attention degrades as context fills and cost grows linearly.
The main techniques
- Progressive disclosure: load a description first and the full content only when needed. Agent Skills are this principle as a file format.
- Static instructions for invariants: things the agent must always know go in AGENTS.md or CLAUDE.md, not in retrieval, because agents fail to fetch context they should have fetched.
- Just-in-time retrieval: fetch documents when the task calls for them rather than preloading.
- Compaction: summarize old history once the window fills, keeping decisions and dropping transcripts.
- Sub-agents: give a subtask its own clean window and return only the result.
- Tool hygiene: fewer, well-described tools beat many overlapping ones. Trim MCP tool lists.
When it matters
Any agent that runs more than a few steps. Long-running coding and research agents live or die on this.
Watch out for
- Measure. Context changes are easy to feel good about and hard to prove without evals.
- Memory systems add context too. A memory that always loads is a system prompt by another name.
Related
- Agent Skills Agent Skills (SKILL.md)
- AGENTS.md & CLAUDE.md Agent instruction files
- Evals Agent evaluation
- MCP Model Context Protocol
In the guide
- 2. Delegate the right work How to size a task an agent can finish, write the spec so it does, ask for a plan before code, and know which work to keep for yourself.