Plan / Recall / Subagent / Checkpoint
Aiko Chat 的上下文与执行控制能力
Aiko Chat 提供四组核心上下文 / 执行控制能力,让长会话、大改动、并发任务都不脱轨。
Plan Mode
写代码前先出 plan,用户审批后再动手:
- 打开 Plan Mode(输入栏开关)
- 提需求,Aiko Chat 生成 markdown 实施 plan
- 用户审批 plan
- Aiko Chat 按 plan 执行
审批时可选 Clear Context & Auto-Accept:清干净对话上下文,仅注入 plan 文件路径,进入"干净执行"模式。审批前可在 overlay 里看 context 用量徽章,做信息知情决策。
Plan Mode 也可与 aiko.pipeline 联动:在 impl 节点前先出 plan,pipeline-gate 校验 plan 已 approved 才能 advance-node。
Subagent 编排
Aiko Chat 通过 Task 工具 递归派发子 agent。常见 subagent:
| Subagent | 干什么 |
|---|---|
Explore | 大范围 codebase 搜索(保护主上下文不被搜索结果污染) |
general-purpose | 通用多步研究 |
| 自定义 agent | 项目 .claude/agents/*.md / 用户 ~/.claude/agents/*.md |
Subagent 视图嵌套显示 agent type / model / tool calls / 实时进度。Background agent 带 "Background" 徽章在独立 overlay 跑。
Subagent-scoped Accept All:点 subagent 的"Accept all edits",仅该 subagent 自动批准,主会话不受影响。
Recall Mode
基于 RLM 论文 的 task node 系统,取代 SDK 默认 session resume。
问题
50-turn 长会话里可能有 5 个不同 task。问 auth 问题时,旧 auth bug 的 turn 污染当前结果。
解法
persistSession: false—— Claude 没有 SDK 内建记忆- Task Node 把 turns 按任务归属
- Recall 系统只检索 active node 的 turns + 关联 closed nodes 的 summary card
组件
| 组件 | 干什么 |
|---|---|
| Node Chip | 输入栏非阻塞 popover:emerald(active)/ indigo(pending)/ amber pulse(select task)。点切换或建新 node(max 5) |
| Node Close Prompt | 响应后内嵌横幅,选 Resolved / Partial / Abandoned,Haiku 生成 summary 字段 |
| Session Node Overlay | 全屏视图:closed nodes 左、active nodes 右,bezier edges 显示节点关联。seed context 可由 inline editor 自定义提取指令 |
Cross-Node /btw | /btw 前缀跨 node 搜索,做临时旁路提问 |
两个角色 × 两个模型
| Root(Sonnet) | Sub(Haiku) | |
|---|---|---|
| 角色 | REPL orchestrator(节点上下文 > 400K chars 时跑) | 标题 / summary / turn indexing / 查询扩展 |
| 跑时机 | 罕见(fallback) | node 创建 / 关闭 / per-turn indexing / orientation |
| 成本 | 中(罕见) | 便宜 |
Checkpoint & Fork
任何一步可回滚文件或 fork 出新会话:
三个入口
- Rewind Browser(
/rewind)—— 全屏 timeline 视图 - Inline Rewind Button —— hover 用户消息泡泡显示
- Escape Escape —— 键盘快捷键
三个动作
| 动作 | 干什么 |
|---|---|
| Fork conversation | 在选中消息处开新 panel 分叉,源 panel 不动 |
| Roll back files | 当前 panel 文件回滚到选中点,对话线性 |
| Fork and roll back | 源 panel 文件回滚 + 新 panel fork |
Fork 出来的 panel 继承源的 model / betas / strategy / provider / permission / YOLO state,hydrate 历史到 fork 点,pre-fill rewound prompt。
Files 修改列表在折叠 disclosure 里,点文件名打开 VS Code 风格 side-by-side diff(checkpoint vs current)。
底层走 Claude Agent SDK 的 forkSession API。Recall mode 下 fork 变体禁用(recall 是 stateless)。
Context Stats / Context Overlay
Live tracking token 用量 + cache activity + context window % + session cost。/context 或 "View Details" 按钮打开全屏:
- SVG 环形图 + 分类堆叠 bar
- 折叠式 message breakdown(user / assistant / tool calls / results / attachments)
- MCP tools / memory files / agents / system prompt sections / deferred tools / skills / slash commands 详细
- Auto-compact threshold 徽章
- API usage footer
Loop Jobs / Side Questions
/loop 5m check the deploy—— 定时复发 prompt。Jobs Overlay 列 active / stopped + 按 job 取消/btw 这个 commit 哪里变了—— 旁路提问,token 友好(仅问题与回答是新 token,主对话不打断)。响应作为可关闭的 aside bubble 显示,不进会话历史