Skip to Content
Dominic Sylvester
Essay

Context engineering: less, but better

Reliable agents need relevant, attributable context with clear authority and conflict handling, not an ever-growing pile of text.

  • AI
  • Context engineering
  • Agents

When an agent misses a requirement, adding more information feels like the obvious repair. Sometimes it is. The missing detail might genuinely be necessary.

But an agent can also fail because the relevant instruction is buried among stale notes, duplicated documents, conflicting decisions, and unrelated tool output. Adding another page does not resolve that problem. It enlarges it.

Anthropic describes context engineering as curating and maintaining the information available during model inference, including instructions, tools, examples, retrieved data, and conversation history. Its guiding principle is the smallest set of high-signal information that supports the desired outcome—not simply the shortest prompt.2

The distinction matters. “Less, but better” is a selection discipline, not an argument for starving a model of evidence.

Start with the decision the agent must make

A context bundle should be built around a task. What does the agent need to decide next? What evidence would make that decision defensible? Which constraints must remain visible throughout the work?

For a hypothetical API change, useful context might include the current request schema, the affected handler, compatibility requirements, relevant tests, and the issue describing the desired behavior. A long discussion of an abandoned redesign may be less useful, even if it contains the same keywords.

This is why relevance is not identical to similarity. A search result can look related while answering a different question. Give retrieval a purpose, then check whether the returned material actually serves it.

Anthropic recommends just-in-time retrieval using lightweight references such as paths and links, while acknowledging trade-offs in exploration time and the need for good tools.2 In practice, provide a reliable map and let the agent open the parts needed for the next decision.

Preserve provenance, not just conclusions

A summary saying “the endpoint must remain backward compatible” is useful. A summary that also identifies the accepted design decision and the code revision is much easier to trust and verify.

For consequential context, preserve the source, relevant date or version, scope, and status. Distinguish an approved requirement from a proposal, and a direct observation from an inference.

MCP can deliver tools, resources, and reusable prompts to an AI application. Its architecture explicitly leaves management and use of that context to the application.1 Getting a document through a standard protocol therefore does not establish that the document is current, authoritative, or safe to follow.

Treat retrieved pages and files as evidence unless they are explicitly trusted instructions. Text found in a document should not gain permission to change the task or disclose secrets simply because the model can read it. The application should enforce that boundary rather than relying on the model to infer it.

Resolve conflicts instead of concatenating them

Suppose a requirements document says to preserve an old response field, while a newer issue proposes removing it. Supplying both documents without explanation leaves a decision disguised as context.

The right response depends on authority, not just recency. A newer proposal may not supersede an approved compatibility requirement. A test may describe current behavior without proving that behavior is intended.

Label the disagreement. Identify the person or governing artifact that can resolve it. If authority is genuinely unclear, the agent should pause or state a bounded assumption rather than silently select whichever instruction is easier to implement.

A compact decision record can carry more value than the entire discussion: what was decided, why, which alternatives were rejected, and what remains open. Keep links to the original evidence so compression does not become untraceable rewriting.

Give tools a context budget too

Context design includes tool interfaces and outputs. Anthropic recommends clear tools with minimal functional overlap and token-efficient results, noting that ambiguous tool choices create problems for agents.2

A targeted search result with source paths and useful excerpts can be better than a full repository dump. A query should return the fields needed for the task, not unrelated customer records. Redaction and access controls should apply before sensitive material enters the model’s context.

For long work, keep durable notes outside the active conversation. Record the current objective, completed actions, unresolved issues, source references, and verification status. Anthropic discusses compaction, structured note-taking, and focused subagents as approaches to managing long-running tasks.2

Do not compress away caveats. “Tests passed” is a poor replacement for which tests ran, against which revision, and what they did not cover.

Evaluate selection, not just answer fluency

A context strategy needs tests. Include cases with irrelevant but plausible material, outdated guidance, missing evidence, and conflicting sources. Check whether the agent selects the right evidence, respects authority boundaries, identifies gaps, and reaches a verifiable result.

Anthropic’s broader agent guidance recommends starting simply, evaluating performance, and adding complexity only when justified.3 Apply that to retrieval and memory as well: an elaborate pipeline is not automatically better than a small, maintained set of references.

The target is not a full context window. It is an agent that can explain what supports its next action and recognize when the available information is insufficient. That is the information foundation for agentic development that remains accountable.

Sources

On this page