Context engineering
Context engineering controls which instructions, examples, tools, retrieved facts, messages, and summaries reach the model at each step. The objective is not maximum context; it is the smallest current set that makes the desired behavior likely and reviewable.
Questions to answer
Resolve these before adding tools, frameworks, or automation.
- Which information must always be present and which should load on demand?
- What is the provenance and freshness of retrieved context?
- How will context growth, conflict, distraction, and loss be detected?
Implementation lifecycle
Build the evidence in this order
- 01
Inventory
List every source of tokens and the decision each source is meant to support.
- 02
Curate
Rank, retrieve, summarize, and expire context based on relevance and authority.
- 03
Measure
Compare task quality, latency, token use, and failure modes under realistic context loads.
Artifacts to maintain
- context budget
- retrieval policy
- compaction rules
- provenance metadata
Continue through AgentAtlas
Evidence ledger
Primary documentation behind this guide
Anthropic
Effective context engineering for AI agents
A model for curating limited context across instructions, tools, external data, history, and compaction.
Anthropic
How Claude remembers your project
Repository instruction hierarchy, project memory, scoped rules, and how persistent context is discovered and loaded.
Next topic
Tools and MCP