An icon of an eye to tell to indicate you can view the content by clicking
Signal
Original article date: Jul 10, 2026

Context Engineering Is Replacing Prompt Engineering — Here's the Framework That Explains Why

5 min read

The way we build AI systems is shifting. Prompt engineering — the craft of writing better instructions — is being replaced by something more fundamental: context engineering, the practice of designing everything a language model sees before it generates a response.

The term was popularized in June 2025 by Shopify CEO Tobi Lütke. By 2026, it has become the dominant framework for practitioners building agents and autonomous workflows.

Why Prompt Engineering Is No Longer Enough

In the chatbot era, the prompt was nearly everything. You gave the model an instruction; it responded. That model of interaction is now a small fraction of real AI use.

Today's agents run multi-step workflows across dozens of tool calls, maintain memory across sessions, retrieve documents mid-task, and coordinate with other agents. The system instruction is now just 5% of what a model sees. The other 95% is context — and engineering that context is where the leverage lives.

The Six Layers of Context

Context engineering operates across six layers:

  • System instructions — the foundational rules, persona, and format guidelines
  • Conversation history — what has been said, compressed or filtered to fit the window
  • Retrieved documents — relevant content injected based on the current task
  • Tool definitions — the shapes and descriptions of what the agent can call
  • Memory from past sessions — persistent state carried across interactions
  • Dynamic context — information loaded mid-task based on what the agent needs right now

Common Failure Modes

The article identifies three core failure modes in agent systems — all rooted in context, not instructions:

  • Contradictory tool descriptions that cause the model to call the wrong tool
  • Context window overflow that causes the model to lose track of earlier decisions
  • Stale context that causes the model to act on outdated information

Patterns like conversation compression, tool output clearing, and scratchpad memory (writing notes to an external file and reading them back) are the practical tools for managing these failures.

Key takeaways:

  • If you're still only optimizing prompts, you're working on 5% of the problem
  • The shift from prompt to context engineering mirrors the shift from chatbots to agents
  • Context window management — what to include, compress, or discard — is now a core engineering discipline

Read the full article on AutoGPT