带 agent 写代码,本质是在做管理
Addy Osmani 把工程管理的实践逐条映射到 coding agent 的日常操作上:给 agent 一个可判定的验证机制(测试、构建退出码、截图),而不是把「看起来做完了」当作验收;写清代码里读不到的上下文(目标、约束、不在范围内的事、成功标准),把仓库里能自己查的部分留给它自己查;同一个错误纠正两次就写进 CLAUDE.md 或做成 skill。他把 Grove 的 task-relevant maturity 对应到 Claude Code 的软硬分层:prompt、CLAUDE.md、skills 是请求,hooks、deny rules、托管设置才是强制,过度流程就是新的微观管理。文章也给了无人值守任务的五个前置问题,并诚实地列出类比失效之处——agent 没有经验只有笔记本,rework 近乎免费,人机团队仍然需要人。适合每天与 agent 协作、想扩大并发而不牺牲质量的工程师。


The skills for managing agents are pretty much the skills for managing a team, and you don't need to be a manager to learn them.
If you're spending all day with a coding agent, you are managing. You're repeatedly selecting tasks, writing instructions, delegating, following up, evaluating results, and deciding what ships. The engineers who get the most out of agents aren't necessarily the ones who are best at prompt engineering. They're the ones who learned how to manage, intentionally or otherwise.
This might be an unwelcome idea. Many of the engineers I admire took an individual contributor (IC) career path because they want to stay close to the work. They've seen friends become managers and disappear into their calendars. But I'm not telling you to become a manager like that. I'm using "management" in a specific sense: producing good outcomes by enabling others' work. And I'm certainly not saying agents are a substitute for managers or colleagues.
管理智能体的能力,很大程度上就是管理团队的能力,而且你不必先当上管理者才能学。
如果你整天和编程智能体待在一起,你其实就在做管理。你在反复选任务、写指令、分派工作、跟进、评估结果,并决定什么能上线。最会用智能体的工程师,不一定是提示工程最强的人,而是那些学会了管理的人——不管是有意还是无意。
这个说法可能不太受欢迎。我欣赏的很多工程师走个人贡献者(IC)路线,就是想离具体工作近一点。他们见过朋友当上管理者后,整个人消失在日历里。但我不是让你去当那种管理者。我说的“管理”有特定含义:通过让他人的工作得以开展,来产出好结果。我也绝不是说说智能体能替代管理者或同事。
Every gripe you have about bad managers is a bug report for interacting with agents. Think about handoffs. If you’ve experienced a bad one you may have got an ask that felt vague, lacked context or just had expectations shift a lot. The good news for ICs is that since you’ve been on the receiving end of handoffs for years, you might know what a good one looks like.
你对糟糕管理者的每一条抱怨,都是与智能体协作时的一份 bug 报告。想想交接。如果你经历过糟糕的交接,可能收到过含糊的请求、缺少上下文,或者期望变来变去。对 IC 来说好消息是:你多年来一直处在交接的接收端,所以你可能知道一次好的交接长什么样。
I've written before that your coding agents need a manager. I've also written about the quiet risk of delegation, cognitive surrender. This piece compares good engineering managers' practices with what we've learned from using and creating Claude Code. The sections are roughly ordered by impact, so that the most high-leverage habit comes first.
Best practice: Provide the agent with a mechanism to validate its work, like a test suite, build, or screenshot, and have it show you the results as proof.
Anti-pattern: Taking "looks done" as confirmation. This forces you to do all the validation, becoming the agent's test suite.
Ask an experienced manager how they can be confident their team is producing good work without reading everything, and they'll talk about guardrails. CI, code review, dashboards, on-call, etc. Inexperienced managers who don't build guardrails end up validating everything themselves, and within a quarter they're the bottleneck. The same is true for agents. As the Claude Code best-practices guide explains, agents stop when the work looks done. If there's no validation, "looks done" is the only validation the agent has. Providing a mechanism to validate the work allows the agent to do the work, run the validator, see the failure, and correct it on its own. For a UI change, this can mean actually opening the page in a browser and iterating until it works and looks good.
The validation mechanism can be almost anything, as long as it's something that yields a definitive pass/fail result. Think tests, build exit codes, linters, diff scripts, and screenshots. The guide notes that the command that runs these validations is the single most useful line you can have in your CLAUDE.md, the instructions file the agent starts each session with.
我之前写过,你的编程智能体需要一个管理者。我也写过委托的隐性风险:认知投降(cognitive surrender)。这篇文章把优秀工程管理者的做法,与我们在使用和构建 Claude Code 过程中学到的东西做个对照。各节大致按影响力排序,所以最高杠杆的习惯放在最前面。
最佳实践:给智能体一个验证工作的机制,比如测试套件、构建或截图,并让它把结果拿给你看,作为证据。
反模式:把“看起来做完了”当成确认。这会逼你承担所有验证工作,你成了智能体的测试套件。
问问有经验的管理者,他们如何在不必读完所有东西的情况下,确信团队在产出好工作,他们会谈到护栏:CI、代码评审、仪表盘、值班等等。没有建立护栏的新手管理者,最后什么都自己验证,一个季度内就成了瓶颈。智能体也是一样。Claude Code 最佳实践指南里说,智能体在工作看起来完成时就会停下。如果没有验证,“看起来完成”就是智能体唯一的验证。给工作提供一个验证机制,智能体就能自己做事、跑验证、看到失败,然后自行修正。对 UI 改动来说,这可能意味着真的在浏览器里打开页面,反复迭代,直到它能用、看起来也对。
验证机制几乎可以是任何东西,只要它能给出明确的通过/失败结果。比如测试、构建退出码、linter、diff 脚本和截图。指南指出,运行这些验证的命令,是你在 CLAUDE.md 里能写的最有用的一行;CLAUDE.md 是智能体每次会话开始时读的指令文件。
Once you have the validation mechanism, here are some ways you can bring it into your workflow:
- Ask. "Run the auth tests after, and continue until they pass."
- Set a goal. With /goal, a separate model runs a condition check after every turn, which is most useful when doing long background work.
- Enforce. A Stop hook can prevent the turn from completing until the typecheck passes.
- Have it reviewed. /code-review sends the diff to a new subagent (which didn't see your conversation) for review, like how authors don't approve their own PRs. You can even control the scope of the review. If you ask it to find problems, it will always find something. But if you ask it to find correctness issues and ignore style, it will do that. This is how good managers learn to ask for feedback, as well. Most of the functionality in the Claude Code toolkit is all about tightening this loop. Skills, hooks, subagents, and MCP all exist to bridge the gap between doing the work and validating the work, so your focus is only on the things the agent couldn't validate. This is what experienced engineering managers do.
有了验证机制之后,可以这样把它接进工作流:
- 直接要求。“做完后跑 auth 测试,一直跑到通过。”
- 设定目标。用 /goal,另一个模型会在每轮之后检查条件,这在长时间后台工作时最有用。
- 强制执行。Stop hook 可以阻止这一轮结束,直到类型检查通过。
- 交给评审。/code-review 会把 diff 发给一个没看过你对话的新子智能体去评审,就像作者不会批准自己的 PR。 你甚至可以控制评审范围。如果你让它找问题,它总能找到点什么。但如果你让它只找正确性问题、忽略风格,它就会照做。优秀管理者也是这么学会要反馈的。Claude Code 工具链里的大部分功能,都是为了收紧这个循环。Skills、hooks、subagents 和 MCP 的存在,都是为了连接“做工作”和“验证工作”,让你的注意力只放在智能体验证不了的地方。这就是有经验的工程管理者在做的事。
Best practice: Provide a clear summary of what the agent can't know by inspecting the repo, including: the task's objective and why it's important, constraints, out-of-scope items, and success criteria.
Anti-pattern: Passing a one-line task, while the real expectations live in your head, or padding the brief with things the agent would discover by reading the code.
Effective managers provide clear descriptions of the desired outcome, constraints, and objectives. They articulate what the work should accomplish, but give the person doing the work the freedom to figure out how to do it. In the military, they call it commander's intent. At Netflix, they call it "context, not control."
The challenge of working with agents is that it's hard to know what context the agent is missing. The first thing a coding agent does on every task is read your code. Current models are fantastic at picking up on your folder structure, conventions, and test set-up much faster than you could describe them.
Before you write anything down, think about what the agent can figure out on its own. If the agent can read it in your code, and it would actually go read it, you don't need to say anything. Spend your words on the parts that are not in the repo - e.g. a meeting decision, someone's internal process for deploying, why this task is important, and what it means to be done this time.
Let's take the example of a vague task, "make the dashboard faster", and turn it into a prompt. The numbers here are just for example.
Get p95 load time for the /team dashboard under 2s for orgs with 10k+ members.
Why: enterprise admins open it daily, and slow loads are their top support ticket.
Constraints: no schema changes; keep the API response shape.
Out of scope: UI changes; caching the whole page.
Check: run scripts/perf/team.sh and show before and after numbers.
最佳实践:清楚说明智能体通过查看仓库无法知道的信息,包括:任务目标以及它为什么重要、约束、范围外事项和成功标准。
反模式:只丢一句任务,真正的要求却留在你脑子里;或者把智能体读代码就能发现的东西塞满简报。
有效的管理者会清楚描述想要的结果、约束和目标。他们讲清楚工作应该达成什么,但把“怎么做”的自由留给做事的人。军队里把这叫“指挥官意图”(commander's intent)。Netflix 把它叫“context, not control”(给上下文,而不是控制)。
和智能体协作的难点在于,你很难知道它缺了什么上下文。编程智能体接到每个任务时,第一件事就是读你的代码。现在的模型很擅长捕捉你的目录结构、约定和测试设置,速度比你描述它们快得多。
所以动笔之前,先想想智能体自己能弄清楚什么。如果它能在代码里读到,而且它真的会去读,你就不用说。把话花在仓库里没有的部分上——比如某次会议的决定、某人部署的内部流程、这个任务为什么重要,以及这一次“做完”意味着什么。
拿一个含糊的任务“把仪表盘做快一点”为例,把它变成一个提示词。这里的数字只是示例。
Get p95 load time for the /team dashboard under 2s for orgs with 10k+ members.
Why: enterprise admins open it daily, and slow loads are their top support ticket.
Constraints: no schema changes; keep the API response shape.
Out of scope: UI changes; caching the whole page.
Check: run scripts/perf/team.sh and show before and after numbers.
You don't need to do this for every task. If you're doing discovery work, it's totally fine to write a generic prompt. You'll just refine a little more as you go. If you're not ready to write a prompt, have the agent interview you until it could write the spec, save that spec to a file, and then start a new session with the agent to build from that. You can use that spec to review against later.
You might also need to give your agent access to other tools, like your issue tracker, error dashboard, or team chat. Treat your agent the same way you'd treat a new hire on your team. If it's a CLI tool it already knows about, like gh, you often won't need to tell it anything.
你不需要每个任务都这么做。如果是在做探索性工作,写一个泛泛的提示词完全没问题,边走边细化就行。如果你还没准备好写提示词,就让智能体来采访你,直到它能写出规格说明;把这份规格存成文件,再开一个新会话让智能体照着构建。之后你还可以拿这份规格来对照评审。
你可能还需要让智能体访问其他工具,比如 issue tracker、错误仪表盘或团队聊天。像对待团队里的新员工一样对待它。如果是它已经知道的 CLI 工具,比如 gh,你通常什么都不用说。
Best practice: When you correct the same thing more than once, document it in the team's CLAUDE.md or turn it into a shared skill. Over time, check if newer models reduce the need for these corrections.
Anti-pattern: Manually correcting the same thing every session or relying on tacit knowledge that only exists on your own machine.
Teams that maximize the value of CLAUDE.md update it semi often and write down lessons learned from mistakes worth preventing. Some teams even mention @claude in code reviews, turning feedback into a permanent policy. Keep CLAUDE.md concise. Here are the types of things that belong in it:
- How to verify something (exact commands)
- Misleading areas of the code
- Decisions that don't exist in the repo
- Anything you've corrected twice These are all examples of the compounding nature of written information. It outlasts people changing teams and models getting replaced.
最佳实践:同一件事被你纠正超过一次,就写进团队的 CLAUDE.md,或者做成共享 skill。随着时间推移,还要检查新模型是否已经减少了这些纠正的需要。
反模式:每次会话都手动纠正同一个问题,或者依赖只存在于你自己机器上的隐性知识。
把 CLAUDE.md 价值最大化的团队会经常更新它,把值得防止的错误教训写下来。有些团队甚至在代码评审里 @claude,把反馈变成长期策略。CLAUDE.md 要保持简洁。适合放进去的内容包括:
- 如何验证某件事(确切命令)
- 代码中容易误导的地方
- 仓库里不存在的决定
- 任何你纠正过两次的东西 这些都是书面信息具有复利效应的例子。它比人员换团队、模型被替换活得更久。
Best practice: Let the agent decide by default and only use hard enforcement (e.g. hooks, deny rules) for the few things that must always or never happen.
Anti-pattern: You write rules in ALL CAPS, define hooks for optional preferences, or keep habits from older models long after newer models outgrew them.
Andy Grove's High Output Management describes this as task-relevant maturity: the level of supervision should depend on a person's history of performance in that specific task, not their overall capability.
An old piece of advice for new managers says the same thing: give people a little more latitude than you're comfortable with while backing them up and holding them accountable.
Claude Code takes this and makes it explicit: prompts, CLAUDE.md, and skills are requests that the model can consider and choose to act on; hooks, deny rules, and managed settings are requirements that are always enforced. In most cases, you want the agent to make the call. There are often cases where the model, looking at real code, is better placed to judge if a guideline applies than a rule you set ahead of time. Use enforcement to set hard requirements such as "never edit the generated client" or "always run the license-header script." In particular, new terminal and VS Code sessions start in auto mode, with a classifier that will filter out unsafe behaviors like deploying to production or force pushing over someone's work.
最佳实践:默认让智能体自己决定,只对少数“必须永远发生”或“绝不能发生”的事使用硬性约束(比如 hooks、deny rules)。
反模式:用全大写写规则,为可选偏好定义 hook,或者在新模型早已不需要之后还保留旧模型的习惯。
Andy Grove 在《High Output Management》里把这称为“任务相关成熟度”(task-relevant maturity):监督程度应该取决于这个人在该特定任务上的过往表现,而不是他的整体能力。
给新管理者的一条老建议也是这个意思:给别人比你舒服程度稍多一点的空间,同时支持他们、让他们负责。
Claude Code 把这一点说得更明确:prompts、CLAUDE.md 和 skills 是模型可以考虑并选择执行的请求;hooks、deny rules 和 managed settings 是始终强制的要求。大多数情况下,你希望让智能体来做判断。很多时候,模型看着真实代码,比你事先定下的规则更清楚某条指南是否适用。用强制机制来设定硬性要求,比如“永远不要编辑生成的客户端”或“始终运行 license-header 脚本”。尤其是,新的终端和 VS Code 会话会以自动模式启动,带有一个分类器,会过滤掉不安全行为,比如部署到生产环境,或强行覆盖别人的工作。
The guide's advice has two sides. If you're putting more emphasis on a CLAUDE.md line and the agent still isn't picking it up, it should be a hook. If a hook is expressing a preference instead of a requirement, it should be removed in favor of letting the agent call the shots. It's like your team deciding to retire a process that is no longer useful. This also means adjusting when you have a new model. The guide keeps a list of habits you can stop: ALL CAPS directions, "think harder" (effort is a setting now), and "don't be lazy." With current models, these tend to lead to over-enforced rules and overwork. With agents, over-process is the new micromanagement.
指南的建议有两面。如果你越来越强调某条 CLAUDE.md 规则,智能体还是不照做,那它就应该变成 hook。如果某个 hook 表达的是偏好而不是要求,那就该删掉,让智能体自己拿主意。这就像团队决定退休一个不再有用的流程。这也意味着换新模型时要调整。指南列了一些可以停止的习惯:全大写指令、“think harder”(现在努力程度是个设置项),以及“don't be lazy”。对现在的模型来说,这些往往会导致过度强制的规则和过度工作。对智能体,过度流程就是新的微观管理。
Best practice: Set an agreed-upon plan before the agent starts coding, read for underlying assumptions, and partition tasks into non-overlapping parallel work.
Anti-pattern: Allowing multiple agents to tackle overlapping tasks simultaneously, then spending the afternoon resolving merge conflicts and duplicated decisions.
A good workflow here is to first enter plan mode and iterate on your plan until you have the right one, then delegate the coding. With a good plan, the model can often build it all in a single pass. For larger tasks, use a second session to look through the plan as a staff engineer would; it's a design review, which is the cheapest place to catch a wrong turn. When reviewing the plan, look for underlying assumptions (in a 1:1 this would be asking, "What are you unsure about?").
最佳实践:在智能体开始写代码前,先定一份双方认可的计划,读出其中的底层假设,并把任务划分成互不重叠的并行工作。
反模式:让多个智能体同时处理重叠任务,然后花一下午解决合并冲突和重复决策。
一个好的工作流是:先进入 plan 模式,反复迭代计划直到合适,再把编码委托出去。计划足够好时,模型常常一次就能构建完。对更大的任务,另开一个会话,像 staff engineer 那样审一遍计划;这是一次设计评审,也是发现错误方向最便宜的地方。审计划时,重点看底层假设(在 1:1 里,这相当于问:“你有什么不确定的?”)。
Decomposition is increasingly being delegated to agents. /batch in Claude Code takes a big mechanical change and creates 5 to 30 tasks, displays the plan, executes them in separate worktrees (separate checkouts of the repo), and creates a PR for each one. You no longer need to divide up the work, just check the slices for overlap and make sure shared interfaces land first. Without this, you might get a false level of parallelism. Five agents taking on overlapping tasks won't lead to five times the output, it leads to one merge conflict with five authors.
任务拆解正越来越多地交给智能体。/batch 在 Claude Code 里会把一个大而机械的改动拆成 5 到 30 个任务,展示计划,在各自独立的 worktree(仓库的独立检出)里执行,并为每个任务创建一个 PR。你不再需要亲自切分工作,只要检查切片之间有没有重叠,并确保共享接口先落地。没有这一步,你得到的可能只是虚假的并行度。五个智能体接手重叠任务,不会带来五倍产出,只会带来一个由五个作者共同制造的合并冲突。
Best practice: Watch the first minute and steer the agent. As soon as you see it go off course, correct. If you've already made two failed attempts to correct the agent, start anew with a fresh session and better prompt.
Anti-pattern: Adding a third or fourth attempt to correct the agent, instead of correcting the request.
An experienced manager knows that if a capable person has a miss multiple times, the problem might be upstream with the instructions, context or scope. The agent version is explicit: as soon as the agent goes off course, hit Esc. If you've already made two failed attempts to correct the agent, clear the session and write a better prompt, incorporating the lessons you learned. A third attempt to correct the agent is mostly just more information that the model has to keep re-reading and re-processing (including failed attempts).
Cheap rollback is also changing the game. /rewind rolls the code and conversation to an earlier point, making it low-risk to try a more ambitious approach first. Good managers do the same with employees: if undoing a mistake is cheap, let them try an ambitious approach. Then run the retro afterwards, and generalize the fix into CLAUDE.md if applicable.
最佳实践:看住第一分钟,及时引导智能体。一旦发现它跑偏,立刻纠正。如果你已经两次纠正失败,就开新会话,用更好的提示词重来。
反模式:第三次、第四次去纠正智能体,而不是纠正你的请求。
有经验的管理者知道,如果一个有能力的人多次失手,问题可能在上游:指令、上下文或范围。智能体版本更明确:一旦跑偏,按 Esc。如果你已经两次纠正失败,清掉会话,把学到的教训写进更好的提示词。第三次纠正智能体,多半只是给模型更多需要反复阅读和处理的信息(包括那些失败尝试)。
低成本回滚也在改变游戏规则。/rewind 会把代码和对话回滚到更早的时间点,让先尝试更大胆的方案变得低风险。优秀管理者对员工也这么做:如果撤销错误很便宜,就让他们试试更有野心的做法。事后做复盘,如果适用,就把修复推广进 CLAUDE.md。
Best practice: The agent does the work, you decide the important things: product calls, security boundaries, what ships. Treat every diff like you're going to get paged for it.
Anti-pattern: Approving large diffs because the tests are green and the names look reasonable. This is not code review, this is code ratification.
No manager can say "my report shipped that, not me." The same is true for every agent you run. I've fallen into this trap myself. I told an agent to research gaps with competitors and write local PRs to close those gaps. I read the research, skimmed the code and almost went ahead and pushed changes that added complexity for users for little gain. I had delegated the work, and almost delegated the decision as well. It's an easy trap to fall into: it's a 600-line diff, the names look reasonable, the tests are green, approve.
最佳实践:智能体干活,你决定重要的事:产品取舍、安全边界、什么能上线。把每个 diff 都当成你可能会因此被叫起来处理的事故。
反模式:因为测试是绿的、命名看起来合理,就批准大 diff。这不是代码评审,这是代码追认。
没有管理者能说“这是我下属发布的,不是我”。你跑的每个智能体也一样。我自己就掉过这个坑。我让一个智能体研究竞争对手的空白点,并写本地 PR 去补这些空白。我读了研究、扫了代码,差点就推上去一些给用户增加复杂度、收益却很小的改动。我委托了工作,也差点把决策一起委托出去。这个坑很容易踩:600 行的 diff,命名看起来合理,测试是绿的,批准吧。
It makes sense to split tasks this way: let agents do the style, linting, follow-ups to reviews, typical bugs and unit testing, but let humans handle security boundaries, compliance and product decisions.
Coordination works the same way. An agent can keep track of handoffs, but deciding between competing requests and getting people to actually commit is still a human job.
You don't need to be in the inner loop of every change. What you do need to own are the outer loops: what the constraints are, how much of the output you actually read, what evidence you keep, and what a human has to sign off on. And keep changes small, since the unit of review is the unit of comprehension.
这样分工是合理的:让智能体做风格、lint、评审后续、常见 bug 和单元测试,让人来处理安全边界、合规和产品决策。
协调也一样。智能体可以跟踪交接,但在互相竞争的请求之间做取舍、让人真正承诺下来,仍然是人的工作。
你不需要进入每个改动的内循环。你需要守住的是外循环:约束是什么、你实际读多少产出、保留什么证据,以及哪些事必须由人签字。还有,把改动保持小,因为评审的单位就是理解的单位。
Best practice: Before deploying an autonomous task, define done, the self-verification, the boundaries, the guardrails, and the human approval.
Anti-pattern: Starting a long-running process before bed, without a definition of done or a stopping point, and waking up the next morning to find out that your model has been working overnight on a faulty premise.
Skip-level managers don't manage the work of individual engineers; they manage the work of goals, guardrails, checkpoints, and leads. AI agents are following a similar trajectory. They are already delegating parts of a task to sub-agents, and they can run autonomously on schedules, after CI failures or after new pull requests are opened. The frontier is self-governing systems that can autonomously start, self-verify, and only call for human intervention when decisions are needed.
The role shifts from controlling the session to designing your loops. The five questions to ask yourself when designing an unattended run are the same questions a good manager asks before giving a senior engineer a project and going on vacation:
- Does it know what done looks like? (Goal condition, spec file, or a failing test it has to turn green.)
- Does it have a self-verification mechanism? (Test suite, Stop hook, or review step.)
- What are its boundaries? (Permission controls, sandbox, worktree, or the one branch it's allowed to push to.)
- What are its guardrails? (Turn limit or spend limit.)
- Where does it produce output, and who approves it? (A PR or summary, and a human approval of any non-reversible actions.) The guide has two more habits that managers will recognize as good practices: pilot, i.e., get a batch job to run on three files, iterate the prompt, then run the rest; and watch the first few runs of anything new before you trust it unattended. Think of it as a probation period.
最佳实践:部署自主任务之前,先定义“做完”、自验证、边界、护栏和人工批准。
反模式:睡前启动一个长时间运行的流程,却没有“做完”的定义或停止点,第二天早上醒来才发现模型整晚都在一个错误前提上工作。
跳级管理者不管理单个工程师的工作;他们管理目标、护栏、检查点和团队负责人。AI 智能体也在走类似的轨迹。它们已经在把任务的一部分委托给子智能体,也能按计划、在 CI 失败后或在新 PR 打开后自主运行。前沿是自治系统:能自主启动、自验证,只在需要决策时才叫人来。
角色从控制会话,转向设计你的循环。设计无人值守运行时,要问自己的五个问题,和优秀管理者在把项目交给高级工程师、然后去度假之前问的问题一样:
- 它知道“做完”长什么样吗?(目标条件、规格文件,或一个必须变绿的失败测试。)
- 它有自验证机制吗?(测试套件、Stop hook 或评审步骤。)
- 它的边界是什么?(权限控制、沙箱、worktree,或它被允许推送的那一个分支。)
- 它的护栏是什么?(轮次上限或花费上限。)
- 它在哪里产出结果,谁来批准?(一个 PR 或总结,以及任何不可逆操作都要人工批准。) 指南里还有两个管理者会认作好习惯的做法:试点,也就是先让批处理任务跑三个文件,迭代提示词,再跑剩下的;以及任何新东西都先看头几次运行,再放心让它无人值守。把它想成试用期。
Best practice: Scale up the use of agents only as fast as checks, goals and fresh reviewers can take over the watching, and measure quality in addition to throughput.
Anti-pattern: Opening more sessions than you can review well, and measuring success by how much code the AI wrote.
Managers learn their span of control pretty quickly. Past a certain number of direct reports, everyone gets less of the manager and the quality goes down. The same is true for agents. It's what I call the orchestration tax: Past the first few agents, each additional agent requires more of your attention than the last. Most days I run four or five background agents and a few local sessions, and some days that's too many.
Managing lots of sessions isn't about being super-focused, it's about delegating most of the monitoring to self-evaluation, goals and new-context reviewers and reserving attention for decisions. It also helps to have notifications instead of polling and a centralized view of the background jobs. You can't scale the number of agents by monitoring more, only by needing to monitor less. Then measure the system rather than the activity. Useful metrics include cycle time for PRs, ramp up time for new employees and the frequency of reverts or rework. Measuring the percentage of AI-written code isn't a useful goal, because what you're aiming for is quality and reliability. Grove's rule of measuring with a countermeasure applies here: If you measure the number of PRs merged, then also measure reverts and rework.
最佳实践:扩展智能体的速度,只能和检查、目标、新上下文评审者接管监视的速度一样快;除了吞吐量,也要衡量质量。
反模式:开的会话多到你评审不过来,还拿 AI 写了多少代码来衡量成功。
管理者很快就能摸清自己的管理跨度。直接下属超过一定数量后,每个人分到的管理者注意力都会变少,质量随之下降。智能体也一样。这就是我所说的“编排税”(orchestration tax):超过最初几个智能体后,每增加一个,需要的注意力都比上一个更多。大多数日子我跑四五个后台智能体和几个本地会话,有些日子这已经太多了。
管理大量会话,不是靠超级专注,而是把大部分监视委托给自评估、目标和带新上下文的评审者,把注意力留给决策。用通知代替轮询,并对后台任务做集中视图,也会有帮助。你没法靠多监视来扩展智能体数量,只能靠减少监视的需要。然后,衡量系统,而不是衡量活动。有用的指标包括 PR 周期时间、新员工上手时间,以及回滚或返工的频率。衡量 AI 写代码的百分比不是有用目标,因为你追求的是质量和可靠性。Grove 的“用制衡指标来衡量”的规则在这里适用:如果你衡量合并的 PR 数量,那也要衡量回滚和返工。
Best practice: Ask who needs it, how you'll know it worked and what would make you stop, and limit WIP.
Anti-pattern: Just throwing every plausible idea into a PR; after all it's cheap to build. You'll now have a junk drawer the team needs to review, secure and maintain.
The most important word a manager says is often "no." With agents, it's harder to say no. It's nearly free to start work and you can throw any plausible idea into a PR by lunch. But you'll now have a bunch of PRs that the team needs to review, secure, support and maintain. Review and validation are the scarce resources now.
In fact, the old management questions matter now more than they used to. Who asked for it? How do we measure success? How do we know when to stop? If it's cheap to build the hard question is not "can we?" but "should we?"
最佳实践:先问谁需要它、你怎么知道它有效、什么情况下你会停,并限制 WIP。
反模式:把每个看起来可行的想法都塞进 PR;毕竟构建很便宜。结果你多了一个垃圾抽屉,团队得去评审、加固和维护。
管理者最重要的一个词,常常是“不”。有了智能体,说“不”更难了。开始工作几乎免费,午饭前你就能把任何看似合理的想法塞进 PR。但你现在有一堆 PR,团队需要评审、加固、支持和维护。评审和验证才是现在的稀缺资源。
事实上,那些老管理问题现在比过去更重要。谁提出的?我们怎么衡量成功?我们怎么知道什么时候停?如果构建很便宜,难的问题就不是“我们能不能做”,而是“我们该不该做”。
The analogy is a useful but imperfect one, and the best practitioners of this work are aware of where it is imperfect:
- Managing people is harder, and the skills don't transfer back. You're not prepared to manage five people because you've run five agents. There is no equivalent for motivation, conflict, career development, or months-long trust building.
这个类比有用,但并不完美;做得最好的人清楚它哪里不完美:
- 管人更难,而且这些技能不会反向迁移。你跑过五个智能体,不代表你准备好管五个人。动机、冲突、职业发展,或长达数月建立信任,这些都没有对应物。
- Rework is almost free. You can ask an agent things you would never ask of a person. If a technical debate happens at the whiteboard, the agent can build two or three options and you can compare them.
- Agents don't have experience, just a notebook. Auto memory only records notes on one machine. They don't transfer to your teammates' sessions. They aren't the experience and judgment you develop over the course of your career, and you need to write those lessons down for the whole team.
- 返工几乎免费。你可以让智能体做你绝不会让人做的事。如果白板上发生技术争论,智能体可以构建两三个选项,让你比较。
- 智能体没有经验,只有一个笔记本。自动记忆只在一台机器上记录笔记,不会转移到同事的会话里。它们不是你职业生涯中积累的经验和判断力,你需要把这些教训写下来,给整个团队用。
- Agents are eager and confident. If you ask a good engineer to do something wrong, they push back. Agents are more likely to do what you ask, and you're likely to overtrust them. In Wharton research on cognitive surrender, participants accepted faulty AI answers most of the time, and grew more confident. You can counter the overconfidence by asking the agent to argue against its own answer.
- You only have one agent archetype, and it changes every few months. Human teams have diverse skills and strengths. All your agents have the same strengths and weaknesses, which shift with each model release.
- 智能体既积极又自信。如果你让一位优秀工程师做错事,他会反驳。智能体更可能照你说的做,而你也更容易过度信任它。沃顿关于认知投降的研究里,参与者大多数时候接受了错误的 AI 答案,而且变得更自信。你可以让智能体反驳自己的答案,来对抗这种过度自信。
- 你只有一种智能体原型,而且它每隔几个月就变。人类团队有多样化的技能和优势。你的所有智能体都有相同的强项和弱项,而这些会随每次模型发布而变化。
- You still have to train your junior devs. When agents take over the starter work junior devs need to learn the fundamentals of the craft, you have to create those reps intentionally as a manager.
- The human team still matters. Sometimes you can spend a day managing agents without realizing that you've crowded out the time it takes to build a cohesive team. Don't do this.
- 你还是得培养初级开发者。当智能体接管了初级开发者用来学习手艺基本功的入门工作时,作为管理者,你得有意识地创造那些练习机会。
- 人类团队仍然重要。有时你管理了一整天智能体,却没意识到自己挤掉了建设一个有凝聚力团队所需的时间。别这样做。
Best practice: Focus your effort on making good software happen: setting the context, defining done, and reviewing well.
Anti-pattern: Evaluating yourself by lines of code while running under-briefed, unchecked agents.
Good staff engineers have always been like this. They write the design doc. They set the context. They do a thorough review. They make the people around them better. Agents let all engineers do this on day one. They give you a crash course on management. You get feedback in minutes, not quarters. You can undo your own mistakes. The job is becoming less about writing the code and more about being the reason good code gets written.
Nobody's born a great manager (or a great engineer). You build skills the same way you always have, through practice. But with agents, practice is cheap.
Try these ideas:
- Every task needs a check it can run. Ask for the proof.
- Tell the agent what it can't see and leave out what it can.
- Talk through the plan before writing the code.
- Corrected something twice? Log it in CLAUDE.md. Repeated workflows? Turn them into skills.
- Two failed corrections? Restart and rephrase the prompt.
- Review the diff as if you'll get paged for it. You don't have to want to be a manager. But the engineers who do well with agents will have learned to manage along the way.
最佳实践:把精力放在让好软件发生上:设定上下文、定义“做完”、做好评审。
反模式:一边跑着简报不足、无人检查的智能体,一边用代码行数评价自己。
优秀的 staff engineer 一直都是这样:写设计文档、设定上下文、做彻底评审、让身边的人变得更好。智能体让所有工程师从第一天就能做这些事。它给你一堂管理速成课。你几分钟就能得到反馈,而不是几个季度。你可以撤销自己的错误。这份工作越来越不只是写代码,而是成为好代码被写出来的原因。
没有人天生就是优秀管理者(或优秀工程师)。你仍然像过去一样,通过练习来建立技能。但有了智能体,练习很便宜。
可以试试这些做法:
- 每个任务都要有一个它能跑的检查。要它拿出证据。
- 告诉智能体它看不见的东西,省略它能看见的东西。
- 写代码前先把计划讲清楚。
- 同一件事纠正了两次?记进 CLAUDE.md。重复的工作流?做成 skills。
- 两次纠正失败?重启并改写提示词。
- 评审 diff 时,假设你会因为它被叫起来处理事故。 你不必想当管理者。但在智能体上做得好的工程师,都会在这一路上学会管理。

