Context engineering: Context engineering is the practice of choosing what an AI model sees when it works on a task: instructions, documents, examples, tool results, and history, and how they are arranged. It extends prompt engineering from wording to the whole input.
Prompt engineering is about how you phrase a request. Context engineering is about everything else the model reads before it answers: the system instructions, the files you attach, the examples you include, the results of any tools it called, and the earlier turns of the conversation. The term took off in 2025 as builders of AI agents realized that the quality of an agent's output depended less on clever wording and more on feeding it the right material at the right moment.
The core idea is that a context window is a limited, expensive resource. Stuff it with everything and the model gets distracted, slows down, and starts missing details. Starve it and the model guesses. Good context engineering means giving the model what it needs for this step, nothing it does not, in a structure it can follow: the brief first, the source material clearly labeled, the constraints last.
You do this already if you use a Claude Project, a custom GPT, or a Gemini Gem: the instructions and knowledge files you load are context engineering. So is choosing to paste the style guide instead of describing it, or trimming a 60-message thread down to the five messages that matter before asking for a summary.
Example at work
An operations manager building an assistant to answer warehouse policy questions loads the current handbook, the last two policy memos, and five example question-and-answer pairs, then adds one instruction: "If the handbook does not cover the question, say so and name the section that comes closest." Answers improve more from that setup than from any rewording of the questions.
Why it matters
Most disappointing AI results come from missing or messy context, not from a bad prompt. Thinking about what the model can see, and what it cannot, is the fastest way to get better answers from any tool.
Related terms
- Prompt engineeringPrompt engineering is the practice of writing and refining instructions to get reliable, high-quality output from an AI model. It covers giving context, showing examples, specifying format, and iterating on what did not work.
- Context windowThe context window is the maximum amount of text, measured in tokens, that a language model can consider at one time. It includes your prompt, any pasted documents, the conversation so far, and the model's reply.
- System promptA system prompt is a set of instructions given to an AI model before a conversation starts that defines its role, tone, rules, and boundaries. Vendors write one for their products; you can add your own in custom instructions, projects, and custom assistants.
- Retrieval-augmented generation (RAG)Retrieval-augmented generation (RAG) is a technique in which an AI system first searches a set of documents for relevant passages and then gives those passages to a language model to answer from. It lets an assistant use your own, current information.
- Long contextLong context describes an AI model's ability to take in and work with very large inputs, from a whole contract to an entire codebase, in a single request. It is set by the size of the model's context window, measured in tokens.