Vine

โ† Back
Workflows

Multi-Agent Workflows

Run multiple sub-agents in parallel instead of sequentially.

Run multiple sub-agents in parallel instead of sequentially.

What it is

Sub-agents are independent Claude instances with their own context. The main agent orchestrates, the sub-agents do the actual work in parallel. Result: split complex tasks, run them at the same time, and keep the main context clean and cheap.

Install / Setup

Sub-agents are built into Claude Code (Task tool / sub-agent tool) โ€” nothing to install. You just need the right instruction so Claude actually uses them.

Option 1 โ€” CLAUDE.md rule:

## Sub-agents (IMPORTANT โ€” ALWAYS use)
- Default is a sub-agent โ€” anything beyond a quick Grep/Edit
- Code changes โ†’ sub-agent reads, understands, edits. Main context stays clean.
- Multi-file edits โ†’ multiple sub-agents in parallel
- Research โ†’ sub-agent
- Main context only for: planning, decisions, short status updates
- Parallelize โ€” fire independent sub-agents at the same time, not one after another

Option 2 โ€” Prompt Claude Code:

Add a sub-agent strategy to my ~/.claude/CLAUDE.md: default is sub-agent for anything beyond a quick Grep/Edit, multi-file edits in parallel, main context only for planning/decisions. Check first if there's already something about sub-agents and merge cleanly.

Or ad-hoc in chat:

Fire off 3 parallel sub-agents: one documents all API routes, one checks the DB schemas, one reviews the tests. Summarize the results for me.

Liking this?

Inside the community I show you how I run all of this day-to-day โ€” live sessions, direct feedback on your setup, and my full configs.

Use cases

  • Multi-file refactor โ€” 5 sub-agents edit one file each in parallel instead of 10 minutes sequentially.
  • Codebase recon โ€” A sub-agent "grep + read + understand" hands you a focused result and keeps your main context empty.
  • Competitor analysis โ€” 3 sub-agents analyze 3 competitor sites at once.
  • Test generation for a whole module โ€” One sub-agent per file writing tests, main agent reviews.
  • Docs for a big system โ€” Parallel sub-agents, one per subsystem.

Pro tip

Every sub-agent burns tokens. Don't fire one off for every tiny task. Rule of thumb: if the task is a clearly scoped research/edit with a structured output โ€” sub-agent. If you're steering and deciding the whole time โ€” main context.


๐Ÿš€ Inside the community we build complete automation systems and workflows that actually run your day. โ†’ Join the Claude Code Mastery Community

Updated regularly โ€” follow @vine.codes for more.

Want more?

Learn it straight from me.