# Context Engineering for a Codebase **Track:** Foundations of AI-Native Development — AI-Native Full-Stack Development — complete (30) **Framework / surface:** web dev (agent context / repo instructions) **Level:** Beginner **Prerequisites:** Build With a Coding Agent **In one line:** Give the agent the right project knowledge, constraints, tools, and examples before giving it more words. ## Theory, aesthetics & inspiration An agent can only act well on what it can perceive, and "context engineering" — the term Shopify's Tobi Lütke put in circulation in mid-2025, with Karpathy's endorsement, as the successor to "prompt engineering" — names the discipline of shaping that perception: architecture notes, naming conventions, run commands, version-matched documentation, examples, and clear task boundaries. The objective is not maximal context but the smallest context that makes correct action likely, because stale or contradictory instructions are worse than missing ones. Durable projects externalize their knowledge into the repository itself — the AGENTS.md convention (2025) is the emerging cross-tool home for it, and existing tests specify expected behavior more precisely than prose ever will. Context is also a security boundary: an agent that can read files should not thereby hold secrets. Good context engineering makes a repository legible to humans and agents at once — a workable definition of maintainable software in an agentic era. **Builder question:** What does an unfamiliar agent need to read or run before it can safely change this repository?