7 Steps to Build a Parallel Development Workflow with Claude Code Agent Teams

This guide shows how to replace the traditional serial code‑review‑test‑PR‑doc cycle with a team of Claude Code agents that run five tasks in parallel, covering agent levels, environment setup, model routing, security permissions, cost control, and a side‑by‑side performance comparison.

AI Architecture Hub
AI Architecture Hub
AI Architecture Hub
7 Steps to Build a Parallel Development Workflow with Claude Code Agent Teams

You normally write code, then perform code review, testing, submit a pull request, and finally update documentation, completing each task sequentially. By assigning each of these tasks to a dedicated Claude Code agent, you can work on the next feature while the agents handle the current work.

Step 1 – Understand the three agent levels

Level 1: Sub‑agent – runs inside the current session, feeds back results, cannot communicate with other agents, suited for repetitive tasks such as code review, testing, and documentation.

Level 2: Agent view – a full‑screen control panel showing all sessions, allows dispatching tasks, viewing progress, and integrating any agent. Sessions persist after the terminal is closed.

Level 3: Agent team – a master agent coordinates team members, members can communicate, share a task list, and collaborate on cross‑file, dependent work.

Most users never go beyond Level 1; this guide jumps straight to Level 3.

Step 2 – Enable the experimental agent‑team feature

export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Add the line to ~/.zshrc (macOS) or ~/.bashrc (Linux) for permanent effect.

Step 3 – Write your first team command

The core difference from a regular command is that you describe the full project requirement; the master agent then decomposes the work into sub‑agents. Example:

我需要搭建一套用户认证系统。创建独立智能体分别负责:
1. 后端:使用 Express.js 编写登录、注册和令牌刷新接口路由
2. 前端:开发带校验功能的 React 登录与注册表单
3. 测试:为所有认证接口编写集成测试
4. 审查:检查其他智能体编写的所有代码,排查安全问题

The master agent splits the requirement, creates team members, and each member works in an isolated context while you can monitor their status.

Step 4 – Configure model routing to save cost

Running five Opus agents would consume five times the token budget. Use Opus for the master (complex reasoning) and Sonnet for the members (execution‑type tasks):

# 主智能体:Opus(需进行架构逻辑推理)
# 成员智能体:Sonnet(专注执行类任务)
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-5-20250929"

The master continues to use your current model (Opus recommended for complex tasks), while all members automatically use the cheaper Sonnet model, reducing cost dramatically.

Step 5 – Manage the team via the agent view

After starting the team, switch to the control panel: claude agents The full‑screen UI displays all session states, e.g.:

┌─────────────────────────────────────────────┐
│ 智能体视图                                   │
├──────────┬──────────┬───────────────────────┤
│ 后端     │ 前端     │ 测试       │ 审查       │
│ ██████░░ │ ████░░░░ │ ░░░░░░░░░ │ 等待依赖   │
│ 72%      │ 48%      │ 排队中     │           │
├──────────┴──────────┴───────────────────────┤
│ > 派发新任务                                 │
└─────────────────────────────────────────────┘

Dispatch new tasks to the team.

View any agent’s progress without interrupting it.

Provide input when an agent requests it.

Close your laptop – agents keep running because sessions persist.

Step 6 – Decision framework

Not every task needs a full team; simple tasks waste tokens. Choose the appropriate mode:

Single‑command, single‑file fix → regular Claude Code session (no agents).

Three independent tasks without dependencies → use the agent view to dispatch all at once and review results together.

Repetitive workflow (review, test, docs) → configure sub‑agents with YAML for stable execution.

Cross‑file, dependent feature development → use an agent team with a master coordinating members.

Night‑time batch processing of back‑log → run in headless mode with --max-budget-usd budget limit.

Wrong scheduling wastes time and tokens; independent tasks should not be run under a team‑wide coordination, and dependent tasks should not be isolated in a single agent view.

Step 7 – Add security safeguards

Parallel agents can expose multiple attack surfaces. Define a permissions JSON and set a budget limit:

{
  "permissions": {
    "allow": ["Read","Glob","Grep","Edit","Write(src/**)","Write(tests/**)","Bash(npm test *)","Bash(npx tsc *)","Bash(git add *)","Bash(git commit *)"],
    "deny": ["Read(**/.env*)","Read(**/.ssh/**)","Bash(rm -rf *)","Bash(sudo *)","Bash(git push *)","Bash(npm publish *)"],
    "defaultMode": "acceptEdits"
  }
}

Set the team budget:

claude -p "搭建认证系统" --max-budget-usd 15.00

Five agents at $3 each give a total cap of $15, preventing any single agent from consuming unlimited resources.

Step 8 – Effect comparison

Before (single developer)

Only one task can be completed at a time.

Writing, reviewing, testing, and submitting are executed serially.

A four‑part feature takes an entire day.

Context switches cause confusion and overhead.

After (agent team)

Four agents work in parallel (backend, frontend, test, review).

The same feature finishes in about two hours.

Each agent has a clean, focused execution context.

You only need to perform the final review and merge.

The tool and subscription are identical; the difference is an environment variable and the “create independent agents” command.

Thank you for reading!

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI agentscost optimizationsecurityparallel workflowClaude Codeteam automation
AI Architecture Hub
Written by

AI Architecture Hub

Focused on sharing high-quality AI content and practical implementation, helping people learn with fewer missteps and become stronger through AI.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.