Zing Forum

Reading

Claude Code Multi-Agent Workflow Template: Cost Stratification and Cross-Tool Collaboration Practice

A multi-agent development workflow template for Claude Code that enables efficient multi-agent collaboration and cross-tool workflows through PM routing, cost-stratified sub-agents, read-only review agents, and Markdown handoff documents.

Claude Code多智能体AI 工作流成本优化代码审查CodexCursor子代理上下文管理
Published 2026-06-11 23:46Recent activity 2026-06-11 23:51Estimated read 7 min
Claude Code Multi-Agent Workflow Template: Cost Stratification and Cross-Tool Collaboration Practice
1

Section 01

[Introduction] Claude Code Multi-Agent Workflow Template: Cost Stratification and Cross-Tool Collaboration Practice

Project Core Information

Original Author/Maintainer: 0x000x7f Source Platform: GitHub Original Link: https://github.com/0x000x7f/claude-code-agent-workflow Release Time: 2026-06-11

Core Insights

claude-code-agent-workflow is a multi-agent development workflow template specifically designed for Claude Code. It addresses context contamination, cost control, and cross-tool collaboration issues in complex AI programming projects through PM Routing Mechanism, Cost-Stratified Sub-Agents, Read-Only Review Agents, and Markdown Handoff Documents, enabling efficient collaboration and quality assurance.

2

Section 02

Background: Why Do We Need Multi-Agent Workflows?

With the popularity of AI programming assistants like Claude Code, developers face two major challenges:

  1. A single long session is prone to inefficiency due to context contamination;
  2. Frequent tool switching (e.g., Codex, Cursor) breaks the workflow.

The core idea of multi-agent workflows is to assign tasks to specialized sub-agents, isolate contaminating work, and improve efficiency.

3

Section 03

Design Principles and Architecture

Three Design Principles

  1. Sub-agents for context control: Isolate contaminating work such as file reading and log output; simple tasks use the main session directly;
  2. File-shared context: All results and plans are stored in Markdown files under the docs/ directory, supporting cross-tool/session sharing;
  3. Expensive models for high-value work: Assign PM, design, and acceptance tasks to strong models, and implementation to low-cost models to maximize cost-effectiveness.

Architecture Design

Main Session (PM/Design) → Explore (Built-in): Codebase Investigation → implementer (Sonnet): Simple/Batch Editing → implementer-heavy (Opus): Multi-file Complex Implementation → docs/handoff/: Handoff to Codex/Cursor → reviewer (Read-only): Diff Acceptance

PM Routing Decision Table

Task Type Responsible Agent
Large-scale file reading/codebase investigation Explore (Built-in)
Implementation plan/design Main Session (Plan Mode)
Simple/定型/Batch Editing implementer (Sonnet)
Multi-file cross-domain implementation implementer-heavy (Opus)
Implementation with heavy design judgment Main Session
Long-term定型 implementation Handoff to Codex/Cursor
Diff review reviewer
4

Section 04

Detailed Explanation of Core Components

implementer (Sonnet)

  • Handles simple,定型, and batch tasks (lint, type error fixing, renaming);
  • Constraint: Minimal difference principle, no behavior changes allowed.

implementer-heavy (Opus)

  • Handles medium-complexity tasks involving multi-file cross-domain work;
  • Works in phases, with small PR granularity.

reviewer (Read-only)

  • Read-only permission, cannot modify code;
  • Outputs approve/request changes decisions;
  • Avoids self-review bias.
5

Section 05

Usage Flow and Validation Process

Usage Flow

  1. /analyze-codebase: Investigate the codebase and divide into phases;
  2. /implement-phase <n>: PM assigns agents → implementation → reviewer acceptance;
  3. /review-diff: Accept any diffs (including those from other tools);
  4. /handoff <topic>: Generate handoff documents for Codex/Cursor.

Validation Process

  • 3 read-only agents for adversarial review;
  • Discovered 18 issues, adopted 6 fixes (empty parameter countermeasures, Windows-safe slug normalization, etc.);
  • All agents passed smoke tests.
6

Section 06

Practical Significance and Limitations

Practical Significance

  1. Cost optimization: Layered model usage reduces costs;
  2. Quality assurance: Specialized review agents improve code quality;
  3. Tool flexibility: Markdown handoff supports cross-tool switching;
  4. Reproducibility: File context makes workflows auditable and reproducible.

Limitations

  • The Bash constraints for reviewers are only at the prompt level;
  • The commands/ directory uses legacy format and may be migrated to skills/ in the future;
  • External tools' interpretation of documents depends on their specifications.
7

Section 07

Summary and Outlook

claude-code-agent-workflow represents a new paradigm for AI-assisted development: shifting from 'a single model doing everything' to 'intelligent routing + specialized division of labor'. This paradigm is particularly valuable for long-term maintenance, high-quality requirements, or team projects. As AI programming tools become more popular, cost awareness and quality assurance mechanisms will become important parts of engineering practice.