What Is Context Engineering (and Why It Is Replacing Prompt Engineering)
Summary
Context engineering, popularized in June 2025 by Shopify CEO Tobi Lutke and amplified by Andrej Karpathy, is the practice of designing all information a language model sees before generating a response, extending beyond just the prompt. This encompasses system instructions, conversation history, retrieved documents, tool definitions, memory, and dynamically loaded context. A 2026 report indicates 82% of IT and data leaders find prompt engineering alone insufficient, with 95% planning context engineering training. While prompt engineering optimizes only the instruction layer, context engineering manages all six layers of the LLM's context window. This shift is driven by the rise of multi-step AI agents, increasingly capable models, and larger context windows that paradoxically require more precise context management to avoid "lost in the middle" issues. Key components include structured system instructions, multi-tier memory (static, dynamic, learned), Retrieval-Augmented Generation (RAG), intelligent tool orchestration, and dynamic context window management techniques like compaction and just-in-time loading, exemplified by Anthropic's Agent Skills system.
Key takeaway
For AI Engineers building or managing multi-step AI agents, you must shift beyond prompt engineering to comprehensive context engineering. Your focus should be on dynamically managing all six layers of the LLM's context window, including memory, retrieval, and tool orchestration, to prevent "lost in the middle" failures and optimize agent performance. Implement just-in-time context loading, like Anthropic's Agent Skills, to ensure your agents receive only the most relevant information, precisely when needed, avoiding token waste and improving decision-making.
Key insights
Context engineering, managing all LLM inputs, is replacing prompt engineering for complex, multi-step AI agent workflows.
Principles
- LLM context window functions as RAM.
- Right context beats more context.
- Manage context as a finite resource.
Method
Implement just-in-time context loading by scanning lightweight skill metadata, then dynamically loading full instructions and referenced files only when relevant to the current task.
In practice
- Use CLAUDE.md for static project conventions.
- Implement claude-mem for cross-session memory.
- Study Anthropic Agent Skills for dynamic loading.
Topics
- Context Engineering
- AI Agents
- LLM Context Management
- Retrieval-Augmented Generation
- Tool Orchestration
- Prompt Engineering
Best for: AI Engineer, Machine Learning Engineer, MLOps Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by AutoGPT.