从Claude Code入手看Agent框架设计思路 (English)
从Claude Code入手看Agent框架设计思路 (English)
Generated: 2026-06-21 05:36:32
---
Okay, I’ll translate your revised version into English while keeping the storytelling style. I’ll skip the change notes and start directly from the story.
---
I Was Shocked by My Claude Code Bill—Then I Realized How Worth It Actually Is
You know that moment—staring at something ridiculously expensive, wincing as you hand over your money.
Last week, a friend of mine was working on a code migration project. A single agent ran through it and missed three modules. The engineers had to stay late and redo the work. He gritted his teeth and went with multi-agent. The bill came to $1,200—but it nailed all ten modules in one go. Want to know what he thought? "This is a hundred times more worth it than treating someone to dinner."
Right about now, you’re probably asking: what exactly is multi-agent? I wondered the same thing. So I spent half a year tearing apart Claude Code’s source code. The more I dug, the more hooked I got—and the more I realized: this thing works nothing like you’d expect.
---
Think Multi-Agent Is a Silver Bullet? Think Again
Let me drop a counterintuitive conclusion on you first: multi-agent brings huge gains, but it’s not right for every problem.
Anthropic’s test data shows that when using Claude Opus 3 as the main agent and Claude Sonnet 3.5 as a subagent, performance improved by more than 90% over using Opus 3 alone. My first reaction? That can’t be right—some marketing blog making stuff up again.
Then I cracked open the source code myself and ran a test.
I had an agent refactor a codebase with 200 files. In single-agent mode, it was like a lost child—reading the later parts only to forget what came before, fixing one thing and breaking another, then having to loop back and reread. After forty-something minutes, it had only changed two files. Imagine that feeling: like asking someone to read every book in a library and then tell you which one is best—they’d break down around book fifty.
Switching to multi-agent was a completely different story. I had one subagent scan the file structure, another analyze dependencies, and a third hunt for duplicate code. Three agents ran in parallel. Ten minutes later I had the structure; the main agent got the summary report and finished everything in 25 minutes.
But don’t miss this—there’s a huge pitfall.
Once I had multiple subagents trying to understand the same complex business logic at the same time. Each one interpreted it from a different angle, and when the results came back to the main agent, they fought each other: one said “this is the order system,” another said “this is the inventory system.” I ended up having to add an extra round of “arbitration,” wasting another half hour just to get everyone on the same page.
After that I figured out a rule: multi-agent is great for breadth-first tasks; deep reasoning, which is inherently single-threaded, should stay intact. It’s like chopping veggies, washing greens, and boiling soup—you can do those simultaneously. But if you’re studying a brand-new recipe, one person reading it from start to finish is clearer.
---
Speaking of Costs, Let’s Talk Honestly
Have you done the math? The moment I launched that multi-agent system, the bill came after three days.
$1,200.
You read that right. A single-agent run for the same task cost about $80. Multi-agent shot it up to nearly $1,200—I calculated, roughly a 15‑fold increase.
But was it worth it? That migration project would take an engineer three working days, which is about $6,000 in billable hours. Single agent cost $80 but missed three modules and needed rework. Multi-agent cost $1,200 and nailed everything in one pass.
From an ROI perspective, it was actually cheaper.
But there’s one scenario where it’s pure waste. You know the type? Looking up an API doc, a single call would do the job, but they insist on splitting it into a “document-searching agent” and a “document-analyzing agent.” The result: extra overhead from context passing, double the cost, and worse performance than a single agent.
I fell into that trap once, and after that I set myself a rule: only use multi-agent when subtasks are truly independent and can run in parallel.
---
Then I Discovered Claude Code’s Fork Mechanism—and I Got Excited
You know how expensive a regular subagent launch is? Every time, it reloads the context from scratch. The cold-start cost is brutal.
Claude Code’s Fork mechanism boils down to one thing: reuse the already-warm context cache from the main agent to create a lightweight clone.
Anthropic’s data says that in cache-friendly scenarios, Fork can cut the cost of a subagent to about 10% of the original. In my own tests, it came out between 12% and 15%—not quite as extreme, but still amazing
Cael Lee
Full-stack developer with 8+ years of experience. Currently building AI-powered developer tools. I've tested 20+ AI API providers and coding assistants.