Context engineering is the deliberate practice of assembling the right information for a human or an AI agent before it acts — deciding what to include, what to leave out, when to deliver it, and in what form. Where prompt engineering tunes the instruction, context engineering curates the surrounding knowledge the instruction operates on.
It has emerged as a distinct discipline because the limiting factor in AI-assisted work is rarely the model’s capability and usually the quality of what it was given to work with. An agent that writes code competently will still make the wrong change if it never saw the decision behind a pattern or the invariant it must not break. The work, then, is upstream of the model: making the relevant decisions, gotchas, and constraints available at the moment they are needed.
In a codebase, context engineering means knowledge that is anchored to the files it concerns and retrievable by path, so the context delivered before an edit is the context that edit actually requires — not a generic dump, and not a blank slate. The goal is precision: the smallest set of true, relevant facts that lets the next actor proceed without re-deriving what the team already knows.