Context engineering changes what arrives at the model (retrieval knobs, history compaction, tool-output routing, schema enforcement).
Think of it like cooking. Prompt engineering is rewriting the recipe: changing the words, adding more example steps, telling the chef in clearer English what to do. Context engineering is changing the kitchen: which ingredients are on the prep table, how much pantry stock the cook can see, whether the spice rack got reorganized, what shape the serving plate is. The recipe in a different kitchen produces a different dish. In this question, anything that changes what is on the prep table (retrieval, history compaction, tool outputs, output schema) is the kitchen. Anything that changes the recipe text itself (system prompt wording, chain-of-thought examples in the instruction) is the recipe.
Detailed answer & concept explanation~6 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 minutes: name the composition vs wording line, walk each of the six options through it, call out option 5 as the interesting case, and reference the playground vs production framing.
| Activity | Layer | Where the change lives |
|---|---|---|
| Rewording the system prompt | Prompt | The system prompt string |
| Adding few-shot examples | Prompt | The user or system prompt string |
| Tuning rerank top-k | Context | The retrieval pipeline config |
| History compaction strategy | Context | The conversation-management layer |
| Tool-output summarization | Context | The tool-result post-processing pipeline |
| Pydantic schema for output | Context | The constraint-decoding or validation backend |
Real products, models, and research that use this idea.
- Anthropic's prompt engineering guide is explicitly about string-authoring patterns (XML tagging, role priming, output formatting); their context engineering recommendations live in separate docs about prompt caching, tool use, and long-context strategies.
- LangChain Prompt Hub stores prompt templates (prompt engineering); LangChain's retrievers, memory, and output parsers are context-engineering primitives.
- Vercel AI SDK separates generateText (prompt-level) from RAG examples and Vercel KV memory integration (context-level) in its documentation.
- Claude Code's CLAUDE.md is prompt engineering (a system-prompt file); its tool registry, file-reading routing, and compaction policy are context engineering.
- OpenAI's playground is a prompt-engineering surface; the Assistants API with file_search, code_interpreter, and structured outputs is a context-engineering surface.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you tell whether a quality regression is a context problem or a prompt problem?
QWhy is prompt caching a context-engineering concern even though it touches the prompt?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating chain-of-thought examples in the prompt as context engineering because they 'add content.' They live in the instruction string, that is prompt engineering. The line is composition versus wording.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.