1
主任务进行中,用户键入 /btw
Claude 正在重构 auth 模块。输入框出现 /btw 时自动补全弹出——这是一个行内弹窗,同样是终端块而非悬浮层。
● Refactoring auth module across 4 files...
✓ read session.ts
✓ updated session.ts
◐ editing middleware.ts running
> /btw
/btw
<question>
──
ask a side question · no tools · won't enter history
自动补全本身也是一个终端块,渲染在输入行正下方。主任务的 spinner 仍在跳动——Ink 在 alternate screen 模式下可以同时维护多个渲染区域。
2
回车提交 → 主任务输出暂停,btw 块插入流中
系统 fork 上下文,派生 ephemeral agent。主任务新输出暂时缓冲,终端当前位置插入带左竖线的 btw 块,显示 thinking 状态。
● Refactoring auth module... still running
◐ editing middleware.ts
> /btw what was that config file we read earlier called?
◆ side question
◐ thinking...
ephemeral
no tools
won't enter history
主任务新输出此时被缓冲,不再追加到终端,避免冲乱 btw 块的位置。这是 Ink 接管整个渲染控制权后的必要代价——与 HTML 的「真悬浮」不同。
3
答案渲染在块内,主任务仍暂停输出
侧链 agent 基于已有上下文回答。文字流式渲染进 btw 块内部。右上角提示 esc 关闭,块的视觉边界始终清晰。
● Refactoring auth module... (output buffered)
> /btw what was that config file we read earlier called?
◆ side question
esc to dismiss
ephemeral
no tools
won't enter history
It was app.config.ts in the project root — defines
the session timeout and JWT secret loader.
the session timeout and JWT secret loader.
btw 块是流式渲染——回答文字逐字追加进块内,而不是整块替换。左侧竖线 + 背景色在视觉上将它与主任务输出明确区隔。
4
工具请求 → 客户端拦截,块变为警告色
问题隐含需要工具时,客户端硬拦截 tool_use,块边框和背景切换为琥珀色,agent 基于已有上下文给出降级回答。
> /btw open routes.ts and tell me what's on line 40
◆ side question
esc to dismiss
⚠ side questions cannot use tools
Can't read files here. From context, routes.ts handles the
login redirect. Ask in main thread or use a subagent to read it.
login redirect. Ask in main thread or use a subagent to read it.
块颜色状态:紫色 = 正常侧链问答,琥珀色 = 工具被拦截的降级回答。用同一块组件的颜色变体表达语义,符合终端 UI 的惯例。
5
esc 关闭 → 块被擦除,缓冲输出刷入,历史干净
按 esc 后 Ink 擦除整个 btw 块,将缓冲的主任务输出一次性刷入终端,会话从中断处无缝续接。底部追加一行 teal 提示确认零污染。
● Refactoring auth module...
✓ updated middleware.ts
✓ updated routes.ts
✓ updated config.ts
✓ updated index.ts
● Done — refactored 4 files. All auth flows now use app.config.ts.
↳ side question dismissed · 0 tokens added to history
>
btw 块擦除后,之前缓冲的主任务输出(4 个 ✓ 行)被一次性刷出。对用户来说视觉上就是「答完侧链问题,主任务继续了」——但底层是缓冲刷新,不是真正的并行渲染。