How is context engineering different from prompt engineering?#
Prompt engineering shapes the instruction. Context engineering shapes everything else the model sees: retrieved documents, project conventions, prior decisions, tool definitions, compressed history and the material deliberately left out. Andrej Karpathy described it in June 2025 as the art and science of filling the context window with just the right information. More is rarely better. Research on context rot found model performance grows increasingly unreliable as input length grows.
What is the most valuable context to capture?#
Knowledge that exists only in people's heads. Public knowledge is already in the model. What it cannot know is why a service is built the way it is, which constraints are real and which past decision still binds. Capturing that is what makes agent output fit the organisation. The mechanisms differ: RAG for documents, AGENTS.md for standing conventions, grounding for verifiable answers. The autocompact cliff shows what happens when history compression goes wrong.