Overview
Have Claude Code turn a product requirements document into a written spec and task list in plan mode, then hand each task to custom subagents set to a lower-cost model, reviewing every change before it is committed.
Problem or Objective
- Which tools help write a spec before an agent writes code?
- Which agents build a non-trivial feature with you?
- Which agents take on multi-step tasks in the background and report back when they finish or need approval?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code
- Prerequisites
- Claude Code with a Pro, Max, Ultra, Team or Enterprise plan or a Console account, and a repository with a test command.
How It Works
Put the product requirements document in the repository. Start Claude Code in plan mode and ask it to read the document and the codebase and write a spec: scope, data changes, interfaces, risks and a numbered task list where each task names its files and its test. Edit the spec until you agree with it. Then define a custom implementer subagent in the project with model set to haiku (or another lower-cost model), a short system prompt that says to follow the spec and change only the files a task names, and only the tools it needs. Ask the main session to delegate tasks to that subagent one at a time, run the tests after each, and summarise what changed. Review each diff yourself, send back anything that misses the spec, and commit tasks only after you approve them. Keep the larger model in the main session for checking the work against the spec.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code.
- Connect the toolsConnect the tools this workflow relies on: Claude Code.
- Check the prerequisitesClaude Code with a Pro, Max, Ultra, Team or Enterprise plan or a Console account, and a repository with a test command.
- Gather your detailsCollect what the prompt asks for: Requirements document, Where to write the spec, Implementer subagent name, Lower-cost model, Test command.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Plan from a PRD, then delegate tasks
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Read the product requirements in [Requirements document] and the relevant code. In plan mode, write a spec to [Where to write the spec] with scope, data changes, interfaces, risks and numbered tasks, each naming its files and test. Wait for my approval of the spec. Then delegate the tasks one at a time to the [Implementer subagent name] subagent, which runs on [Lower-cost model]. After each task, run [Test command], show me the diff and the results, and wait for my approval before committing. Do not push or merge anything.You approve the spec before any code is written, and approve each task's diff and test results before it is committed. Nothing is pushed or merged by Claude Code.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Anthropic's subagent docs say each subagent has its own context window, system prompt, tool access and permissions, that you can set its model to a lower-cost one such as Haiku to control costs, and that its requests count toward the same usage limits. The overview says Claude Code can run agents in parallel with a lead agent assigning subtasks. Whether the cheaper model gives good enough code for your tasks is for you to judge.
Limitations and Considerations
A lower-cost model may make more mistakes on hard tasks, so keep tasks small and review every diff and test result before committing. Subagent requests count toward the same usage limits as your main session. Limit each subagent's tools to what its tasks need. Claude Code needs a Pro, Max, Ultra, Team or Enterprise plan or a Console account. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)code.claude.com
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Create custom subagents - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 26 Nov 2026, 23:47 UTC
What this source supports
- Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions; its requests count toward the same usage limits as your main conversation.
- Control costs by routing tasks to faster, lower-cost models like Haiku.
- model: the model to use, such as sonnet, opus, haiku, a full model ID, or inherit.
- When you are in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent while the main conversation remains read-only.
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Spawn multiple Claude Code agents that work on different parts of a task simultaneously. A lead agent coordinates the work, assigns subtasks, and merges results.
- Claude Code by Anthropic | AI coding agent and assistant (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- You can access Claude Code with a Claude Pro, Max, or Ultra plan, a Team or Enterprise plan, or a Claude Console account.

