Zing Forum

Reading

Maflow: A Token-Efficient Software Development Workflow with Multi-Agent Collaboration

Maflow is a structured multi-agent workflow that maximizes token efficiency in the planning, implementation, evaluation, and refactoring phases by rationally assigning AI models like Claude and Gemini, avoiding the cost surge caused by long sessions.

Maflow多智能体Token效率ClaudeGemini软件开发工作流AI辅助编程成本控制
Published 2026-04-06 00:45Recent activity 2026-04-06 00:52Estimated read 5 min
Maflow: A Token-Efficient Software Development Workflow with Multi-Agent Collaboration
1

Section 01

Maflow: Introduction to the Token-Efficient Software Development Workflow with Multi-Agent Collaboration

Maflow is a structured multi-agent collaboration workflow that maximizes token efficiency in the planning, implementation, evaluation, and refactoring phases by rationally assigning AI models like Claude and Gemini, addressing the cost surge issue caused by long sessions. Its core concept is "Claude thinks, Gemini builds", combining clear phase division, agent role assignment, and closure protocols to balance token cost control and development quality.

2

Section 02

Background: The Token Cost Trap of Long Sessions

In AI-assisted software development, long sessions have hidden cost traps: in conversations with Claude, the cost of the 100th round is 7 times that of the first round, and the 300th round reaches 20 times. The reason is the accumulation of context windows—more historical information leads to exponential growth in token generation costs, and complex projects can easily exhaust the budget. Maflow designs a structured workflow for this purpose, optimizing token usage through multi-agent collaboration and context management.

3

Section 03

Core Methods and Workflow Design of Maflow

Maflow's core concept is "Claude is scarce—use it to think; Gemini is abundant—use it to build", assigning models based on task characteristics. The workflow has 6 phases: project initialization (developer, zero cost), architecture planning (Architect uses Claude Sonnet/Opus), architecture review (developer), code implementation (Worker uses Gemini Pro/Flash), parallel evaluation (3 Evaluators use Gemini Flash), refactoring (Refactor uses Claude Sonnet), testing and re-evaluation, and final review. It defines 5 agent roles, manages information transfer and status through a template file system (e.g., SPEC.md, ARCHITECTURE.md) and closure protocols (output status at the end of the session), and follows the "minimum necessary knowledge" principle to reduce context waste.

4

Section 04

Evidence and Effects of Token Efficiency

Maflow summarizes four golden rules: each agent reads only necessary files, one task per session, closure protocols replace codebase re-reading, and cheap models handle cheap tasks. These rules keep token costs between 1/5 and 1/10 of traditional single-session methods while maintaining code quality.

5

Section 05

Conclusions and Insights

The value of Maflow lies in the systematic optimization of AI-assisted development. Core insights include: model selection is an architectural decision, context is a scarce resource that needs management, structured forms are better than free forms, and human-AI collaboration is key. It promotes a mindset shift from "letting AI write code" to "collaborating with AI to complete projects", and may become a standard for professional developers in the future.

6

Section 06

Applicable Scenarios and Usage Recommendations

Maflow is suitable for medium-complexity full-stack projects, multi-round iterative codebases, token cost-sensitive teams, and developers using multi-model IDEs; it is not suitable for extremely simple scripts, urgent real-time collaboration, or teams with existing mature AI processes. The usage process includes steps such as cloning the repository, copying templates, filling out SPEC.md, running Architect, reviewing the architecture, executing Worker, closure protocol, evaluation, and cyclic refactoring.