跳转到内容

阶段边界

阶段是会话中的一段工作:grilling、实现、QA。定义故意留得宽泛:当你觉得「好了,这部分做完了」,阶段就结束。

阶段边界是两个阶段之间的间隔,也是唯一需要做这个决定的时点。阶段进行中无需做决定:继续,或者把剩下的工作拆给子代理。阶段中途 compact 会让代理失去思路。

选项 作用
继续 留在当前会话中,不切换上下文。
/clear 清空上下文窗口,从头开始。
/handoff 写入可移植的 Markdown 文件,用它在任意位置开启一个会话。
子代理 把任务交给它自己的上下文窗口,之后获取报告。
/compact 压缩当前上下文,并用摘要开启一个新会话。

在阶段边界处,从上往下判断。第一个回答为是的选项就是答案。

1. 能在当前会话中继续吗? 有两种情况可以回答是:下一阶段需要把当前阶段作为主要来源,或者剩余的 smart zone 足够多(约 150k tokens),可以容纳下一阶段。grilling → 实现是典型情况:实现需要原样保留推理过程,而不是摘要。继续不花成本,也不会丢失信息,所以先排除其他选项。

2. 上下文和接下来的工作无关吗? 当前会话中的所有内容(探索、决策、走过的弯路)都可以丢弃吗?如果可以,就用 /clear。这是成本最低的做法:不花时间,还能腾出整个上下文窗口。/clear 也不是终点:之后仍可恢复旧会话。

选错的代价无法挽回。清除相关上下文,你就会失去构建成果背后的原因。之后无论怎么重新阅读 diff,都无法找回这些信息。

3. 需要 handoff 吗? /handoff 的适用范围很窄。只有以下情况才需要:

  • 切换到新的 harness(Claude → Codex),
  • 转到新的目录或仓库,
  • 把工作交给同事,
  • 或者在阶段中途分出一项支线任务,且不打断当前工作。

以上就是全部适用情况。/handoff 带来的是可移植性:一个可以随工作迁移的文件。如果没有东西需要迁移,就不需要它。

4. 这项任务可以离开键盘运行吗? 任务范围是否足够明确,即使你离开键盘,也不需要你指引就能完成?如果是,就交给子代理,当前会话保持不动。自动化审查是典型情况:代理读取 diff 并提交报告,整个过程中都不需要你参与。

5. 否则就用 /compact。 上下文相关、harness 和目录不变,而且你需要继续参与:这时就选它。通常决策树会走到这里。在 /compact 后附上指令(例如 /compact we're going to QA this area),让摘要保留下一阶段需要的信息。

/compact 是默认选项,但不是首选。它排在最后,因为前面四个问题对应的做法成本更低,或更精确。一开始就用 /compact 的问题在于,新会话可能会对摘要压扁的决策产生十足把握,却得出错误结论。

除了继续之外,其他每种做法都会把主要来源变成次要来源:用会话摘要替代会话本身。每种做法带来的取舍都一样:

来源 信息量 噪音 可操作空间
主要来源(继续) 完整 很多 少
次要来源(/compact、/handoff) 有损 较少 多

这就是问题 1 要放在最前面的原因。只有当继续会话的成本超过它带来的收益时,才接受信息损失。

这些问题没有客观答案:每个问题都带有主观判断,同一个阶段边界在不同的日子可能有不同选择。关键是要按顺序提问,并且在阶段边界处做判断,而不是工作进行到一半时。

英文 PHASE-BOUNDARIES.md
# Phase boundaries
A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. The definition is fuzzy on purpose: a phase ends when you think *"ok, we're done with that"*.
The **phase boundary** is the gap between two phases, and it is the only place this decision belongs. Mid-phase there is no decision to make: continue, or split the work that's left into subagents. Compacting mid-phase makes the agent lose the thread.
## The five options
| Option | What it does |
| ------------ | --------------------------------------------------------------- |
| **Continue** | Stay in the session. No context switch at all. |
| **`/clear`** | Empty the context window and start from nothing. |
| **`/handoff`** | Write a portable markdown file and seed a session anywhere with it. |
| **Subagent** | Send the task to its own context window and get a report back. |
| **`/compact`** | Compress this context and seed a fresh session with the summary. |
## The tree
Work top to bottom at the boundary. The first **yes** wins.
**1. Can you continue in this session?** Two things make the answer yes: the next phase needs this phase as a **primary source**, or you have enough [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) left (~150k tokens) for the next phase to fit. Grilling → implementation is the standard yes: the implementation wants the reasoning verbatim, not a summary of it. Continue costs nothing and loses nothing, so rule it out before anything else.
**2. Is the context irrelevant to what comes next?** Is everything in this session (the exploration, the decisions, the dead ends) disposable? If so, **`/clear`**. It is the cheapest move on the board: it takes no time and hands back the whole window. `/clear` also isn't terminal: the old session stays resumable.
The cost of getting this wrong is one-way. Clear a *relevant* context and you lose the **why** behind what you built, and no amount of reading the diff back gets it returned.
**3. Do you need to hand off?** `/handoff` is narrow. You need it only when you are:
- swapping to a **new harness** (Claude → Codex),
- moving to a **new directory** or repo,
- sending the work to a **colleague**,
- or forking a side task you found **mid-phase** without derailing what you're doing.
That list is the whole clause. What `/handoff` buys is **portability**: a file that travels. If nothing is travelling, you don't need it.
**4. Can the task be done AFK?** Is it scoped tightly enough to run with you away from the keyboard, no steering? Then send it to a **subagent** and leave this session untouched. Automated review is the standard case: the agent reads the diff and reports, and you aren't needed while it does.
**5. Otherwise, `/compact`.** Relevant context, same harness, same directory, and you need to stay in the loop: this is where the tree lands, and it lands here often. Pass it an instruction (`/compact we're going to QA this area`) so the summary keeps what the next phase needs.
`/compact` is the **default, not the first reach**. It sits at the bottom because the four questions above it are all cheaper or more precise. The failure mode when people start here is a fresh session that is confidently wrong about a decision the summary flattened.
## Primary and secondary sources
Every move except **Continue** turns a **primary source** into a **secondary source**: the session as it happened, replaced by a summary of it. The trade is always the same shape:
| Source | Information | Noise | Room to move |
| --------------------------------- | ----------- | ----- | ------------ |
| Primary (Continue) | Full | Lots | Little |
| Secondary (`/compact`, `/handoff`) | Lossy | Less | Lots |
This is why question 1 comes first. You only pay the lossiness when staying costs more than it saves.
## These are judgement calls
The questions are not objective: each has taste in it, and the same boundary can go two ways on two days. The value is in asking them **in order**, at the boundary rather than in the middle of the work.

非官方学习站,与 Matt Pocock 和 AI Hero 没有隶属关系。本站不提供可安装的中文技能包。

技能原文采用 MIT 许可。Copyright (c) 2026 Matt Pocock

鲁ICP备2025189036号