# Prompt chaining

> Canonical: https://skillalmanac.com/glossary/prompt-chaining | Last verified: 2026-11-25 | Index status: index-eligible

Prompt chaining splits a task into a sequence of prompts, where each language model call takes the output of the previous one as its input. It replaces one large request with smaller, checkable steps.

Also called: chain prompts, chained prompts, prompt chain, chaining prompts.

## In plain language

Prompt chaining means doing a job in stages instead of asking for everything at once. For example, you ask the AI to draft a report, then in a second request ask it to check the draft against a list of rules, then in a third to fix what the check found. Each stage hands its result to the next, like an assembly line. The benefit is that you can look at the result after each step and fix a problem early. Separate requests can add overhead, but total waiting and usage depend on the calls and the single-request alternative. An early mistake can carry forward unless a check catches it.

## Technical definition

In a prompt chain, a program or person makes a sequence of model calls, and the output of one call is placed into the prompt of the next. Anthropic's Building effective agents post defines it as decomposing a task into a sequence of steps where each call processes the previous output, and says it suits tasks that can be easily and cleanly decomposed into fixed subtasks. Anthropic's prompting best practices describe self-correction as the most common pattern: generate a draft, have the model review it against criteria, then refine it. Each model stage uses a separate call, with opportunities to log, evaluate or branch between stages. A program or person prearranges the workflow; an agent loop lets the model decide its next action dynamically.

## How it shows up when you use agents

Chaining shows up whenever one model call's output becomes the next call's input. In an application you write it in code: call one extracts facts, call two drafts from those facts, call three reviews the draft. In a coding agent you often get the same effect by hand: ask for a plan, review it, then ask for the implementation. Skills in this catalogue split along these lines, for example writing a plan and then executing it.

Anthropic's prompting guide says current models handle most multistep reasoning internally, and that explicit chaining is still useful when you need to inspect intermediate outputs or enforce a specific pipeline structure. That is the practical test: chain when you want a place to look, log or branch between steps. Do not chain just because a task has several parts: separate calls introduce overhead, and the net latency, usage and billing depend on the design and service.

What breaks when this is misunderstood:

- **Passing a bad output forward.** A later step trusts what it is given. Put a check, such as a validation or review call, between steps where errors would be costly.
- **Using a chain where the path is not known.** Anthropic's post says chaining suits tasks that decompose cleanly into fixed subtasks. When the number of steps depends on what is found, an [agent loop](/glossary/agent-loop) fits better.
- **Losing detail between steps.** Each call sees only what you pass it. Write the handoff so the next step has what it needs.

Next action: write the steps down first, as a list or flowchart, decide what each step receives and returns, and test each step alone before joining them. See also [AI workflow](/glossary/ai-workflow).

## Common confusions

- **Prompt chaining versus chain-of-thought.** [Chain-of-thought](/glossary/chain-of-thought) asks a model to reason in steps inside one response. Prompt chaining uses several separate calls.
- **Prompt chaining versus an agent.** In a chain the steps are fixed in advance. An agent decides its own next step. See [agent loop](/glossary/agent-loop).
- **Prompt chaining versus subagents.** A [subagent](/glossary/subagent) is a separate agent given a task in its own context. A chain is a fixed sequence, and its steps may or may not be agents.
- **Myth: more steps give better results.** More steps give more places to check and more places to fail. Use them where the intermediate result is worth inspecting.

## Worked examples in this catalogue

### [prompt-writing](https://skillalmanac.com/skills/skill-almanac/prompt-writing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Prompts written and linted with a fixed structure, injection rules and a numeric test plan.

Why it exercises the concept: Writing a prompt, linting it and testing it are separate steps. Each can be run as its own call, with the output of one feeding the next, which is the chaining pattern.

### [procedure-to-flowchart](https://skillalmanac.com/skills/skill-almanac/procedure-to-flowchart)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A written step-by-step procedure converted into one Mermaid flowchart, with each decision showing all its stated exits and each path ending.

Why it exercises the concept: A chain is a fixed procedure of steps. Drawing it as a flowchart makes the order, the branches and the stopping points visible before you build it.

### [writing-plans](https://skillalmanac.com/skills/obra/writing-plans)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A spec turned into a step-by-step implementation plan before code is touched.

Why it exercises the concept: The first link of a two-stage chain: its output, a written plan, is the input to the next stage.

### [executing-plans](https://skillalmanac.com/skills/obra/executing-plans)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A written implementation plan worked through inline, with per-step verification and final branch review.

Why it exercises the concept: A possible second stage takes the written plan as input. This is workflow preparation, not evidence that a model chain was run; the skill does not require routine human pauses between tasks.

## Related terms

- [Prompt engineering](https://skillalmanac.com/glossary/prompt-engineering.md)
- [Chain of thought](https://skillalmanac.com/glossary/chain-of-thought.md)
- [AI workflow](https://skillalmanac.com/glossary/ai-workflow.md)
- [Agent loop](https://skillalmanac.com/glossary/agent-loop.md)
- [Prompt template](https://skillalmanac.com/glossary/prompt-template.md)
- [Subagent](https://skillalmanac.com/glossary/subagent.md)

## Sources

- [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents), Anthropic (accessed 2026-11-24)
- [Prompting best practices (section: Chain complex prompts)](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices), Anthropic (Claude Platform Docs) (accessed 2026-11-24)
- [What is prompt chaining?](https://www.ibm.com/think/topics/prompt-chaining), IBM (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
