Prompt engineering
Crafting the words of a request so the model understands the task, the format and the constraints.
- Works on one piece of text
- Done by a person, then reused
- Wording, structure, examples, format
- Enough for single-turn tasks
Prompt engineering words the instructions. Context engineering decides every token the model reads on a turn — instructions included.
A model answers from what is in front of it and nothing else. For a single question, good wording is most of the job. For an agent that calls tools across dozens of turns, the instructions are a small slice of the input — and the rest has to be built, budgeted and checked every time. This guide shows what each discipline covers, why long contexts fail, and the techniques teams use to fix them.
Updated · 8 sources
Prompt engineering is writing and refining the instructions a language model receives. Context engineering is deciding everything the model sees on each turn — instructions, tool definitions, retrieved documents, memory and tool results — and how much of each fits. In context engineering vs prompt engineering, the second contains the first: Anthropic calls context engineering “the natural progression of prompt engineering”.
The two differ in what they work on, when the work happens and who does it. Prompt engineering is mostly done once, by a person, at design time. Context engineering is done on every turn, by software.
Crafting the words of a request so the model understands the task, the format and the constraints.
Choosing and assembling everything the model reads on each turn, inside a finite token budget.
Each step below moved more of the model’s input out of a hand-written prompt and into material gathered at run time — until the prompt was the smallest part.
A larger context window is not a larger attention span. Research and the model providers’ own documentation agree: as the input grows, recall falls — and position, distractors and noise all make it fall faster.
Accuracy and recall degrade as the token count grows. Claude’s documentation names it and says curating what is in context matters as much as how much space there is.
Facts placed mid-context are used least. Important material belongs at the start or near the question.
In Chroma’s tests even a single near-miss distractor lowered accuracy, and four lowered it further.
Bloated tool sets with overlapping purposes leave the model unsure which to call — Anthropic lists this among the most common failures.
Every technique below does one of four things: puts less in, puts it in later, puts it in a better place, or moves work to a separate context. Most production agents use several at once.
The tool result joins the context, and the next turn is built again from the top.
A claims handler on a claim page types “why is this one stuck?”. The prompt alone cannot answer it — the model does not know who is asking, which claim “this one” is, or what happened to it. The engineered context does.
SYSTEM
You are a helpful claims assistant.
Answer clearly and concisely.
If unsure, say so.
USER
why is this one stuck?
→ The model must guess, or ask
which claim is meant.SYSTEM role, rules, output format
USER M. Ortiz · claims handler
PAGE Claim CL-2291 · status Pending
RECENT opened CL-2291; viewed notes
MEMORY summary of 14 earlier turns
TOOLS names + one line each
RETRIEVED CL-2291 history:
“awaiting police report since 3 Oct”
USER why is this one stuck?What changed. The instructions are almost the same. What changed is everything around them: who is asking, the page, a summary of the conversation, the tools that exist and one retrieved fact — each chosen for this turn, within a budget.
The more turns, tools and sources a system has, the less of its behaviour the prompt decides. Place your system on the scale, then answer one question.
Does the model’s input change from turn to turn?
On Botminds the prompt is one input to a build that runs the same way for every agent, every turn — from named sources, held to budgets, and open to preview before any model reads it.
Read the full design in context engineering on Botminds, and how instructions, tools and knowledge come together in the anatomy of an agent.
In context engineering vs prompt engineering, prompt engineering is writing good instructions, and context engineering is deciding everything else the model sees on each turn — tools, retrieved documents, memory and tool results — and how much of each fits. Context engineering includes prompt engineering.
No. Clear instructions still matter — Anthropic’s guide spends a section on writing system prompts at the right altitude. What changed is that, for agents, instructions are a small share of the input, so the rest needs its own discipline.
Harness engineering improves an agent by changing the software around the model — tools, context, checks and recovery — rather than the model itself. Context engineering is one part of the harness; prompt engineering is one part of context engineering.
An agent asked “why is this one stuck?” on a claim page gets who is asking, the claim on screen, recent actions, a summary of earlier turns and the claim’s history retrieved for that turn. The instructions barely change; the assembled context answers the question.
Context rot is the fall in accuracy and recall as a model’s input grows. Claude’s documentation names it, and Chroma measured it across 18 models in 2025. It is why curating the context matters as much as the size of the window.
Yes. Retrieval-augmented generation is one way to bring material into the context. Context engineering also decides when to retrieve, how much to keep, where to place it and what to drop — and covers memory and tool results, which RAG does not.
Find the smallest set of high-signal tokens that makes the desired outcome likely: instructions at the right altitude, a few canonical examples, compact non-overlapping tools, just-in-time retrieval, compaction, structured notes and sub-agents for long tasks.
No. Research such as Lost in the Middle shows models use information in the middle of long inputs worst, and more documents add little after a point. A bigger window raises the ceiling; it does not choose what goes in.
Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.