Definition

Context engineering is the practice of deliberately crafting what information an AI agent sees, when it sees it, and how that information is structured — going beyond prompt engineering to encompass the full information environment of the agent at each decision point. The term was coined by Dex at HumanLayer and has been endorsed by Shopify CEO Tobi Lütke and Andrej Karpathy.

Key Points

  • Coined by Dex at HumanLayer; endorsed by Shopify CEO Tobi Lütke and Andrej Karpathy
  • Goes beyond prompt engineering: prompt engineering optimizes a single prompt, context engineering optimizes the entire information environment across a conversation
  • A single word like “Yes” means completely different things depending on conversation history
  • Context can include cross-channel signals: failed phone calls, previous support transcripts, real-time events
  • Rich context in a simple agent beats a complex agent without context
  • The concept distinguishes itself from prompt engineering by focusing on what information is available, not just how to phrase instructions
  • agent-loop — The loop iterates over context at each step; context engineering determines what the loop feeds into
  • rag — RAG is one mechanism for providing context at retrieval time
  • memex — Memex explores how agents build and use persistent context
  • llm-as-os — Karpathy’s OS framing positions context as the agent’s memory system
  • second-brain — A second brain is a form of persistent context engineering for human knowledge workers
  • tobi-lutke — Shopify CEO who endorsed the context engineering concept
  • humanlayer — Organization that coined the term “context engineering”

Implications

This matters because it reframes what makes agents good. The quality of an agent is not primarily determined by the model or framework, but by the quality of the context it operates in. This shifts investment from model selection and framework choice toward information architecture, event logging, and cross-channel signal integration. It also suggests that the best agent improvements come from better context, not bigger models.

Context as the Missing Piece in Software Factories (2026-10-12)

The software-factory debate adds the strongest production-scale datapoint for this thesis. PostHog’s counter-position to both Horthy’s humans-up-front fix and Mollick’s twilight triggers is that the missing piece is context: agents make better design choices when they can see what a product engineer sees — usage data, complaints, incidents. Their evidence: 63% of changed lines land in files that already exist and “fix” is the largest commit type at 40%, so agents working from production signals repeat the codebase’s maintenance patterns well; without those signals, even well-reviewed loops accumulate architecture debt (HumanLayer’s lights-off outage). 1

Implication: this vault’s context-engineering framing now has an industrial-scale corroboration — the discipline is not just prompt-scope context but production feedback (usage, incidents, complaints) wired into the agent’s environment. For founders, it reframes “give agents more context” as “give agents the same signals the product team acts on.” The full synthesis (taxonomy, production numbers, failure evidence) lives in the vibecoding wiki at [[software-factories]].

The Name Kept Changing, the Job Didn’t (2026-10-26)

Drew Breunig’s AGNTCon talk “Context Fails & Fixes” (out/2026) adds the naming timeline and the failure-mode census. The sequence: 2023 “prompt engineering” (choosing the right words for a single model call) → 2025 “context engineering” (the system dynamically assembles the context) → 2026 “harness engineering” (the assembly work moves into deterministic code). His framing: “our job is to choose when to be deterministic (what to put in code) and when to be probabilistic (when to let the model drive).” The name tracks where the assembly work lives, not a change in the underlying job. 2

The four long-context failure modes — poisoning (a bad fact the model can’t get past; Gemini 2.5 spent hours trying to give the FireRed iced-tea guard tea while playing the lemonade-era game), distraction (past ~100k tokens the Gemini agent repeated actions from history instead of synthesizing new plans; in Do as I Say, Not as I Do, every model tested eventually followed contradictory example turns over its instruction), confusion (extraneous facts shift the model’s assumptions about you), and clash (tools and skills inside the harness start fighting each other) — are still the whole taxonomy. No new fix was invented; long context didn’t kill any of them.

The practical datapoint for operators: Breunig’s personal warning point is ~200k tokens — above that, his advice is to delete the context and start fresh. “Someone says, ‘My coding agent’s doing something weird. Claude’s been nerfed.’ And I ask, ‘How big is your context?’”

Implication: for this vault, “context budget” (first open question below) now has a named datapoint from an operator of long-running agents, and the prompt→context→harness timeline explains why the harness-engineering family of pages exists at all. The two new agentic-era failure modes live in harness-engineering, and the newest one gets its own page: context-inertia.

Open Questions

  • How large can context get before it hurts performance? Is there a context budget?
  • How do you prioritize which context to include when context exceeds the window?
  • What are the privacy implications of accumulating cross-channel context?
  • Is there a standard format or protocol for context, or does every agent invent its own?

Sources

3

Footnotes

  1. raw/articles/software-factories-how-ai-agents-ship-code-start-to-finish.md ↩

  2. raw/vibecoding/articles/state-of-context-engineering-dbreunig-2026-10-24.md ↩

  3. raw/articles/adgapar-loop-conversation-ai-agents.md ↩