Why three steps is the right starting point
A research agent built in three steps is simple enough to understand completely and complex enough to produce real output. Step one defines the question. Step two gathers structured answers. Step three synthesizes them into a final result.
A research agent is a structured prompt system that breaks a broad question into discrete tasks, runs each task in sequence, and combines the results into a single output. The agent does not browse the web on its own — it uses Claude's knowledge and the context you feed it at each step.
Three steps keeps the design visible. You can read every prompt, understand why each step exists, and fix problems without digging through layers of abstraction.
The prompt file structure
Store all three prompts in a single markdown file. Each prompt is a section with a clear header.
# STEP 1 — DECOMPOSE
You are a research planner. Given a topic, list 5 specific questions
that a thorough answer to that topic would need to address.
Topic: {{TOPIC}}
Output: numbered list, no preamble.
# STEP 2 — ANSWER
You are a research analyst. Answer each question below concisely.
Use bullet points. Cite reasoning, not sources.
Questions: {{STEP1_OUTPUT}}
# STEP 3 — SYNTHESIZE
You are a technical writer. Write a 300-word summary that answers
the original topic using the research below.
Topic: {{TOPIC}}
Research: {{STEP2_OUTPUT}}
Replace {{TOPIC}} with your subject before running. Pass {{STEP1_OUTPUT}} and {{STEP2_OUTPUT}} by copying the output of each step into the next prompt.
Running it manually first
Run the system manually before you automate it. Paste step one into Claude, copy the output, paste it into step two, and so on. Manual runs let you spot weak prompts before you wire them together. If step two gives vague answers, adjust the instruction and re-run before you build the pipeline.
Automating the three steps
Once the prompts are working, automate the pipeline with a short script.
import anthropic, re
client = anthropic.Anthropic()
topic = "practical uses of Claude agents for freelance developers"
with open("research_prompts.md") as f:
raw = f.read()
def run_step(prompt: str) -> str:
msg = client.messages.create(
model="claude-opus-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}]
)
return msg.content[0].text
step1_prompt = raw.split("# STEP 2")[0].replace("{{TOPIC}}", topic)
step1_out = run_step(step1_prompt)
step2_prompt = raw.split("# STEP 2")[1].split("# STEP 3")[0].replace("{{STEP1_OUTPUT}}", step1_out)
step2_out = run_step(step2_prompt)
step3_prompt = raw.split("# STEP 3")[1].replace("{{TOPIC}}", topic).replace("{{STEP2_OUTPUT}}", step2_out)
final = run_step(step3_prompt)
print(final)
When to add a fourth step
Add steps when you have a clear reason. A fourth step that formats the output for a specific audience — a Slack message, a client brief, a technical spec — is a good addition. A fourth step added just to feel more complete is not.
One step to take right now
Write the three prompts for a topic you research manually every week. Run them by hand once. If the output is useful, automate the pipeline with the script above. You'll have a repeatable research system before end of day.