Prompt chaining: how to split a big task into prompts that work
TL;DR: Prompt chaining means breaking a task into a sequence of smaller prompts, where the output of each step becomes the input of the next. It beats one big prompt when the job has distinct stages, such as research, outline, draft and review, and when you want to check or fix the work between stages.
What prompt chaining is
Prompt chaining is doing a job in several prompts instead of one, passing each result to the next step. Instead of asking for "a 1,200-word article on our new pricing" in one go, you ask for research notes, then an outline built from the notes, then a draft built from the outline, then a review of the draft.
Anthropic describes it as breaking a task into a sequence of steps where each model call processes the output of the previous one, with checks you can add between steps to make sure the work is still on track. OpenAI's Agents SDK documentation describes the same idea for agents, using almost the same example: do research, write an outline, write the blog post, critique it, then improve it.
You can chain prompts by hand in any chat assistant by pasting one answer into the next prompt. Developers do it in code, where each step is a separate API call. The design questions are the same either way.
When a chain beats one big prompt
Chain when the job has stages that need different kinds of attention, or when you need to check the work in the middle. Anthropic's guidance puts the trade-off plainly: chaining costs time, because there are more calls, and buys accuracy, because each call has an easier job.
| Situation | Better choice | Why |
|---|---|---|
| Short task with one output (an email, a summary) | One prompt | Nothing to check between steps; a chain only adds time |
| Research, then write | Chain | You can catch wrong or missing facts before they are written up |
| Long document with a set structure | Chain | Approving the outline first saves rewriting the draft |
| Draft that must meet clear criteria | Chain | A separate review step judges the draft more honestly than the writer |
| Many inputs processed the same way (reviews, tickets) | Chain | Extract from each one first, then combine the clean results |
| Steps that each need the full picture to make sense | One prompt | Splitting loses context the model needs |
One honest note: models with built-in reasoning now handle much multi-step thinking inside a single call. Anthropic's current guidance says explicit chaining is still useful when you need to inspect the intermediate outputs or enforce a fixed sequence of steps. That is the test: if you would never look at the middle steps, one well-written prompt may be enough.
How to design the steps
Each step should do one job, with one output you could judge on its own. If you can't say what a good result for a step looks like, the step is too vague or too big.
- Write the job as a list of verbs. Gather, decide, outline, draft, check, fix. Each verb is a candidate step.
- Merge steps that don't need checking. If you would never look at a step's output, fold it into the next one. Fewer steps mean less time and fewer hand-offs to break.
- Give each step only what it needs. The drafting step needs the approved outline and the facts. It doesn't need the twenty sources the research step read.
- Fix the output format of each step. A list, a table or labelled sections are easier to pass on and check than free prose.
- Decide what happens on failure. Retry the step, send it back with the reviewer's notes, or stop and ask a person.
How to design the hand-offs
Most broken chains break at a hand-off: the next step gets too much, too little, or something it can't tell apart from instructions. Three habits prevent it.
- Wrap passed-in work in tags. Put the previous output inside
<outline>or<notes>tags and refer to it by name: "Write the draft from the outline in the outline tags." The model then knows which text is material and which is instruction. - Carry the source forward when facts matter. A review step can't catch an invented number unless it can see the original material. Pass the source notes along with the draft.
- Keep the goal in every step. Each prompt should restate the reader and the purpose in one line. A step that only sees "turn this outline into prose" has lost why the piece exists.
Deciding what each step sees, and what it doesn't, is a small case of context engineering: giving the model the right information at the right moment.
A worked chain: research to outline to draft to review
Here is a four-step chain for a customer-facing article, such as a help page or a blog post explaining a product change. Run each prompt, check the output, and paste it into the next one.
I am writing an article for [audience] about [topic]. The goal: after reading, they should [what they should understand or do].
From the material below, list every fact the article could use, one per line, each with where it came from. Then list the questions a reader would ask that the material doesn't answer. Don't write any of the article.
<material>
[paste your notes, product docs, announcement, support tickets]
</material>Check: are the facts right, and is anything important missing? Fill the gaps it lists before you go on. This is the cheapest point in the chain to fix a wrong fact.
Using only the notes below, write an outline for an article for [audience]. Goal: [same goal as step 1].
Give a working title, then four to six sections. For each section: a heading, the one point it makes, and which notes it uses. Put the answer the reader most wants in the first section.
<notes>
[paste the checked notes from step 1]
</notes>Check: does the order make sense, and does every section earn its place? This is the gate. Anthropic's own example of chaining includes this exact move: write an outline, check it meets your criteria, then write the document from it.
Write the article from the outline below for [audience]. Goal: [goal]. Follow the outline's order and headings. Use only facts from the notes; if a section needs a fact that isn't there, write [MISSING: what is needed] instead of inventing it.
Style: plain words, short sentences, [length] words in total.
<outline>
[paste the approved outline]
</outline>
<notes>
[paste the notes again]
</notes>Review the draft below against these criteria. For each one, say pass or fail and quote the line that fails:
1. Every fact appears in the notes.
2. The first section answers [the reader's main question].
3. No sentence over 25 words.
4. Nothing a [audience] wouldn't understand without a definition.
Then list the changes needed, most important first. Don't rewrite the draft.
<notes>
[paste the notes]
</notes>
<draft>
[paste the draft]
</draft>Then send the draft and the list of changes back for one revision. Anthropic calls this draft, review, refine loop the most common chaining pattern, and advises making each step a separate call so you can look at, check or branch from any point. Running the review in a fresh chat also helps: the reviewer then judges only the draft and the criteria, not the conversation that produced it.
Two more chains for everyday work
Customer feedback into a report
- Extract. For each review or ticket: "List the product, the problem in under 15 words, and the customer's own words as a short quote. If there is no problem, write 'none'." Run it on batches small enough that nothing gets skipped.
- Group. "Here are the extracted problems. Group them into themes. For each theme give a name, the number of items and two quotes. Don't merge themes that need different fixes."
- Write. "From the themes below, write a one-page summary for [leadership team]: the top three problems by count, what customers said, and one suggested next step for each. Use only the counts and quotes given."
Why it works: the counting happens on clean, short lines instead of hundreds of raw messages, and you can check any number in the report against step 2.
A sales email that stays accurate
- Brief. Paste text from the prospect's website and your notes: "Summarize what this company does, who it sells to and anything that changed recently. Only what the text says."
- Angle. "Given this brief and our product [one paragraph], suggest three reasons they might care now, ranked, with the line of the brief each one rests on." Pick one.
- Draft. "Write a first email of under 100 words using angle [chosen angle]. One question at the end."
- Check. "Compare this email to the brief. List any claim about their company that the brief doesn't support."
How to check each step
A chain is only better than one prompt if you actually use the stops between steps. There are three ways to check, from cheapest to most thorough.
| Check | Good for | Example |
|---|---|---|
| A rule in code or a quick look | Format, length, required fields | Is it valid JSON? Under 120 words? Every section present? |
| A model review step | Criteria a rule can't test | Does every claim appear in the notes? Is the tone right for the reader? |
| A person | Judgment and anything with real stakes | Approve the outline; sign off on numbers before they go to a client |
Anthropic calls these checks gates: a point where the chain only continues if the output passes. Put them where a mistake would be expensive to carry forward, usually right after research and right after the outline. Write review criteria as checks a step can pass or fail, not as "make it better", which gets you a rewrite instead of a verdict.
Common mistakes
- Too many steps. Every step adds time and a hand-off that can fail. Five sharp steps beat twelve vague ones.
- Passing everything forward. Long, mixed inputs bury the part that matters. Pass the output the next step needs, plus the source when facts must be checked.
- No check between steps. A chain run end to end without looking is one big prompt with extra cost.
- Letting the reviewer rewrite. Ask the review step for a verdict and a list of changes. Rewriting in the same step mixes judging with writing and hides what changed.
Chaining is one technique among several. To see it next to few-shot, role and other techniques on the same task, see prompt engineering examples. If you work mostly in Claude, the Claude prompting guide has Claude-specific advice.
Let the right experts write your prompt
Prompt Expert is an AI prompt generator that brings the right experts to every job. They ask a few questions, read your website and files, and write the prompt for ChatGPT, Claude or Gemini with your real facts, working together when a job needs more than one.
See how it worksQuestions
What is prompt chaining?
Prompt chaining is splitting a task into a sequence of prompts, where each prompt's output becomes the next prompt's input. For example: research notes, then an outline, then a draft, then a review.
What is an example of prompt chaining?
Writing an article in four prompts: one to pull facts from your material, one to outline from those facts, one to draft from the approved outline, and one to review the draft against a checklist.
Is prompt chaining better than one long prompt?
It is better when the task has distinct stages or you need to check work in the middle. For short tasks with a single output, one clear prompt is faster and just as good.
Can I use prompt chaining in ChatGPT or Claude without code?
Yes. Run the first prompt, check the answer, and paste it into the next prompt. Starting a new chat for review steps means the reviewer sees only the draft and the criteria, not the conversation that produced it.
What is the difference between prompt chaining and chain of thought?
Chain of thought is one prompt asking the model to reason step by step before answering. Prompt chaining uses several separate prompts, so you can see and check the output of each step.
Sources
- Anthropic: Prompting best practices (chain complex prompts)
- Anthropic: Building effective agents (prompt chaining workflow)
- OpenAI Agents SDK: Orchestrating multiple agents