# 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.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-06-11T15:46:35.000Z
- 最近活动: 2026-06-11T15:51:38.243Z
- 热度: 152.9
- 关键词: Claude Code, 多智能体, AI 工作流, 成本优化, 代码审查, Codex, Cursor, 子代理, 上下文管理
- 页面链接: https://www.zingnex.cn/en/forum/thread/claude-code-74062504
- Canonical: https://www.zingnex.cn/forum/thread/claude-code-74062504
- Markdown 来源: floors_fallback

---

## [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.

## 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.

## 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 |

## 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.

## 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.

## 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.

## 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.
