Context engineering
Also called Context management · Context curation
Deciding what goes into the context window, when, and in what order, so the agent sees what the task needs and nothing else.
Context engineering is the discipline of choosing what the model sees on each request: which instructions, which files, which tool results, which examples, and how much history. Where prompt engineering is about the wording of a request, context engineering is about the selection, ordering, timing, and budget of everything around it. The context window is finite and every token in it competes for the model's attention, so what you leave out matters as much as what you put in.
Most bad sessions are context problems, not model problems. The agent read the wrong files, or all the files, or a stale summary; the instructions file is a novel; the useful constraint is buried under three hundred lines of test output. The same model with a well-shaped window behaves like a different, sharper tool, which is why two people on the same harness get such different results.
The practical moves are simple. Point instead of paste: a context pointer beats a wall of text. Load on demand through tools rather than up front. Keep AGENTS.md short and let progressive disclosure carry the rest. Clear between tasks so one task's debris does not fill the next task's window. Push bulky work, like a large search or a log read, into a subagent whose context is thrown away when it reports back. Treat the window as a budget you spend on purpose.
- Claude CodeSubagents,
/clear,/compactwith instructions, and@filementions are the everyday context-engineering controls. - AntigravityThe knowledge base and per-task workspaces decide what each agent sees; keep tasks scoped so each window stays small.
- Codex
AGENTS.mdscoping by directory keeps instructions local to the code they apply to.
“I gave it everything: the whole repo, the design doc, the old thread. It's worse than before.”
“That's a context engineering problem. You filled the window with things it has to read past.”
“So what do I include?”
“The two files it will edit, the test that should pass, and a pointer to the doc. Let it fetch anything else.”
Course 01 puts every one of these terms to work: you install Claude Code, run the loop, and ship a real project — permission modes, compaction, hooks and all.
Start Course 01 →