---
title: "Context Engineering"
description: "Curating high-signal context (AGENTS.md, CONTEXT.md, ADRs) to maximize agent reasoning performance."
section: "concepts"
type: "concept"
created: "2026-08-22"
updated: "2026-08-24"
confidence: "high"
tags: ["agents", "context-engineering", "workflow"]
canonical: "https://pyweb.dev/wiki/context-engineering"
---
# Context Engineering

[matt pocock](/wiki/matt-pocock)'s framing: context is the game. AGENTS.md, CONTEXT.md, feedback loops,
plan mode — the agent's performance is bounded by what's in its context window.
"Never run /init" — hand-craft your agent instructions because the defaults are generic
and generic context produces generic results.

## The artifacts
- **AGENTS.md** — project-scoped instructions for the agent: layout, toolchain, pitfalls,
  workflow. Lives at the workspace root. This is the first thing loaded (see [agents md spec](/wiki/agents-md-spec)).
- **CONTEXT.md** — the domain model: shared vocabulary, entities, relationships.
  Created lazily by domain modeling workflows. Prevents the agent from reinventing terms.
- **ADR directory** (`docs/adr/`) — architecture decision records. Why decisions were made,
  not just what they are.
- **Modular Capabilities** — composable skills and bounded tool configurations loaded on demand (see [progressive disclosure](/wiki/progressive-disclosure)).
- **Visual Specifications** — clear, low-noise architectural and workflow diagrams ([editorial diagrams and visual explanations](/wiki/editorial-diagrams-and-visual-explanations)) that provide structured multi-hop context without prompt bloat.

## The principle
Agents don't lack intelligence; they lack context. A brilliant agent with a generic
context will produce generic code. An average agent with precise context (domain model,
conventions, pitfalls, feedback loops) will produce precise code. Invest in context
the way you'd invest in infrastructure.

## Overlap with Karpathy
[andrej karpathy](/wiki/andrej-karpathy)'s [llm wiki pattern](/wiki/llm-wiki-pattern) is the same principle at the knowledge level:
compile once, interlink, keep current. This wiki is context engineering in action.

## Related
- [context budget audit](/wiki/context-budget-audit) — the measured, instrumented practice of this principle at the harness layer.
[llm wiki pattern](/wiki/llm-wiki-pattern), [grilling doctrine](/wiki/grilling-doctrine), [idea to ship flow](/wiki/idea-to-ship-flow), [error analysis and evals](/wiki/error-analysis-and-evals), [hamel husain](/wiki/hamel-husain), [progressive disclosure](/wiki/progressive-disclosure).

---

## Agent Navigation

cluster: person (170 pages) | betweenness: 1152.7

### References (outbound)
- [Matt Pocock](https://pyweb.dev/wiki/matt-pocock.md)
- [AGENTS.md Specification](https://pyweb.dev/wiki/agents-md-spec.md)
- [Progressive Disclosure](https://pyweb.dev/wiki/progressive-disclosure.md)
- [Editorial Diagrams and Visual Explanations](https://pyweb.dev/wiki/editorial-diagrams-and-visual-explanations.md)
- [Andrej Karpathy](https://pyweb.dev/wiki/andrej-karpathy.md)
- [Context Budget Audit](https://pyweb.dev/wiki/context-budget-audit.md)
- [LLM Wiki Pattern](https://pyweb.dev/wiki/llm-wiki-pattern.md)

### Referenced by (inbound)
- [Agent Harness Engineering](https://pyweb.dev/wiki/agent-harness-engineering.md)
- [Agent-Native Infrastructure](https://pyweb.dev/wiki/agent-native-infrastructure.md)
- [AGENTS.md Specification](https://pyweb.dev/wiki/agents-md-spec.md)
- [AI Coding Taxonomy & Agent Experience](https://pyweb.dev/wiki/ai-coding-taxonomy.md)
- [Automated Eval Engineering](https://pyweb.dev/wiki/automated-eval-engineering.md)
- [Closed-Loop Agent Improvement](https://pyweb.dev/wiki/closed-loop-agent-improvement.md)
- [DeepSeek Harness](https://pyweb.dev/wiki/deepseek-harness.md)
- [Editorial Diagrams and Visual Explanations](https://pyweb.dev/wiki/editorial-diagrams-and-visual-explanations.md)
- [Error Analysis and Evals](https://pyweb.dev/wiki/error-analysis-and-evals.md)
- [Five Debts of Agentic Engineering](https://pyweb.dev/wiki/five-debts-of-agentic-engineering.md)
- [Hoard and Recombine](https://pyweb.dev/wiki/hoard-and-recombine.md)
- [LLM Message Protocol](https://pyweb.dev/wiki/llm-message-protocol.md)
- [LLM Wiki Pattern](https://pyweb.dev/wiki/llm-wiki-pattern.md)
- [Multi-Agent Orchestration](https://pyweb.dev/wiki/multi-agent-orchestration.md)
- [Software Engineering Fundamentals for Agents](https://pyweb.dev/wiki/software-engineering-fundamentals-for-agents.md)
- [Subagents and Context Management](https://pyweb.dev/wiki/subagents-and-context-management.md)
- [Cathryn Lavery](https://pyweb.dev/wiki/cathryn-lavery.md)
- [Drew Breunig](https://pyweb.dev/wiki/drew-breunig.md)
- [Hamel Husain](https://pyweb.dev/wiki/hamel-husain.md)
- [Lalit Maganti](https://pyweb.dev/wiki/lalit-maganti.md)
- [Viv Trivedy](https://pyweb.dev/wiki/viv-trivedy.md)
- [LLM Wiki Ecosystem: Spec vs. Implementations](https://pyweb.dev/wiki/llm-wiki-ecosystem-analysis.md)

### Evidence (verified primary sources)
- [aihero-dev-homepage-2026](https://pyweb.dev/wiki/raw/articles/aihero-dev-homepage-2026.md) | origin: https://www.aihero.dev/ | ingested: 2026-08-22 | sha256: 231157fed45f82922924a050e09b5b81a443891814fc1d72c874d864a6075419
- [mattpocock-skills-repo-2026](https://pyweb.dev/wiki/raw/articles/mattpocock-skills-repo-2026.md) | origin: https://github.com/mattpocock/skills | ingested: 2026-08-22 | sha256: 1a38fb49eb8ebbaf1c4397d21232a405ba8565744e0c8306cf5beec4f94b4224

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
