1. When one prompt becomes two 22 min
Lesson notes
You have a prompt that mostly works. Then it fails on one class of input — not randomly, but predictably. The failures share a shape. That shape is the signal that you have a single prompt doing two cognitive jobs at once.
The diagnostic
Write one sentence describing what a correct output looks like. If that sentence requires the word "and" more than once, you have written multiple prompts badly disguised as one. The failure you see is a symptom of that overload, not a bug in any individual step.
A single prompt should perform one cognitive operation: extract, classify, summarize, reformat, or judge. When a prompt extracts and classifies and formats, each operation competes for the model's attention. The one that gets the least context usually fails first.
Here is a prompt that tries to do too much at once:
# prompts/triage-monolith-v1.txt
Read the following support ticket. Extract the factual claims the customer is making.
Then classify each claim as billing, access, or bug. Then write a one-sentence summary
of the ticket that a support agent can act on immediately.
<ticket>{{ticket_body}}</ticket>
That prompt has three verbs: extract, classify, summarize. Under normal inputs it works. Under a ticket containing five claims across two categories, the classification step collapses — the model picks the dominant category and applies it to all claims rather than classifying them individually. The extraction step was fine. The summary step was fine. The classification step failed because it received too little context relative to the complexity of the input.
The failure is predictable. The remedy is to isolate the cognitive steps.
A concrete 2-step chain
Step 1 — extract claims from a support ticket. This prompt does nothing else.
# prompts/extract-claims-v1.txt
Return the factual claims in the following support ticket as a JSON array of strings.
No analysis. No categories. No formatting. Only the claims, exactly as the customer stated them.
<ticket>{{ticket_body}}</ticket>
# → step 1 output
{
"claims": [
"I was charged twice on March 4th",
"I never received a confirmation email",
"My account still shows the failed plan"
],
"ticket_id": "t-8841"
}
Step 2 — classify the claims. This prompt receives the output of step 1 and does nothing else.
# prompts/classify-claims-v1.txt
Given the following claims extracted from a support ticket, classify each as one of:
billing, access, or bug.
Return JSON: [{"claim": "...", "category": "billing|access|bug"}]
Claims: {{claims_json}}
# → step 2 output
[
{"claim": "I was charged twice on March 4th", "category": "billing"},
{"claim": "I never received a confirmation email", "category": "access"},
{"claim": "My account still shows the failed plan", "category": "billing"}
]
Step 1 produces a stable intermediate artifact. Step 2 operates on that artifact. Each step is independently testable. If triage output is wrong, you can run step 2 in isolation against a known-good claims_json input and find out immediately whether the problem is in extraction or classification. You cannot do that with the monolith.
Why the chain is worth the seam
A chain introduces latency and a handoff point where state can corrupt. That cost is real. Accept it only when a single prompt's failure mode is categorical — meaning it fails on an identifiable class of input, not sporadically. Sporadic failures suggest a different problem: ambiguous instructions, missing examples, or model capability limits. A chain does not fix those.
When not to chain
If you cannot name the failure mode precisely, do not chain yet. Characterize the failure first. Add the second step only when you can say: "Step 1 fails when the ticket contains multiple unrelated issues" or "Step 1 confuses extraction with judgment." The chain should solve a named problem, not obscure an undiagnosed one.
The clearest signal that a chain is premature: you cannot write the one-sentence description of what each step's output looks like without using "and."
Cross-reference
prompt-engineering-101 m4/l17 introduced chaining as a concept. This lesson is about when the seam is worth the cost and how to make the handoff stable. l2 of this module covers what that handoff looks like in practice — the schema that holds state between steps.
If you get stuck
The most common mistake is splitting a prompt before the failure mode is well-characterized. You end up with two prompts, neither of which isolates the real problem. Before you split: collect five examples of the failure. Write one sentence that describes what they have in common. That sentence is the spec for the step boundary.
If you have fewer than five examples of the failure, you do not have enough signal to characterize it. Run more inputs through the monolith prompt and log the outputs before you split anything.
Deliverable
One prompt in your current workflow that fails on a predictable class of input. Write the 2-step version. Name the intermediate artifact each step produces. Write the one-sentence description — for each step — that would have told you where to put the boundary. If you cannot write those two sentences, the split is not ready.
Try these prompts
- Take this single prompt and split it into two: "Read the support ticket. Extract the claims, classify each as billing or access, and write a one-sentence summary."
- Name the intermediate artifact that step 1 would produce in a chain that extracts claims from a support ticket before classifying them.
- Write the one-sentence description of what step 1 produces and step 2 receives for a chain that first extracts facts from a document and then answers a question using only those facts.