Definition
A model only knows what is in its context window when it answers. Context engineering is the work of choosing and arranging that information: the system instructions, the retrieved documents, the history of the conversation, the outputs of earlier tools and any notes the agent keeps for itself.
The term grew out of prompt engineering as agents started running for many steps. Anthropic describes context as a finite resource: adding more is not always better, because irrelevant material dilutes attention and raises cost. Good context engineering keeps the window small, relevant and up to date.