Context engineering
Deliberate construction and management of the information fed into an LLM's context window, treated as a first-class engineering problem spanning retrieval strategy, knowledge structure, memory systems, and token efficiency.
15 sources · May 3, 2026
Compiled by Claude · How this works →
Agents · LLMs · 34 neighbors
Context engineering is the practice of deciding what information an LLM sees, when it sees it, and in what form. It treats the context window not as a passive receptacle but as a surface to be designed, the same way an API schema or a database index is designed.
The clearest articulation of this comes from the LLM-wiki pattern associated with Andrej Karpathy. Rather than retrieving chunks at query time, the model is asked to pre-synthesize raw documents into structured Markdown files that the model can later consume whole. One implementation guide describes ingesting sources, having the model build and maintain the wiki, and running health checks to prevent drift. A developer who built this end-to-end found that cross-document synthesis genuinely outperforms RAG for curated research, but that hallucinations baked in at ingest propagate structurally, making the lint step non-negotiable.
Token efficiency is the other axis. A zero-dependency CLI described in LostWarrior/knowledge-base organizes project context as tiered Markdown files with a machine-readable manifest so agents can navigate a knowledge base without burning excess tokens on irrelevant content.
At the infrastructure level, Anthropic’s Managed Agents architecture decouples the agent harness, session log, and sandbox into independent interfaces, cutting p50 time-to-first-token by roughly 60 percent and p95 by over 90 percent. Separating those concerns is itself a context engineering decision: each component controls its own information surface.
Longer-horizon memory is the open problem. Vectorize’s Hindsight system uses biomimetic data structures and multi-strategy retrieval so agents accumulate and query memory across sessions, moving closer to the kind of persistent context that one-shot context windows cannot provide.