sidequest
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSidequest
Sidequest
Open a forked copy of this conversation in a split beside the current pane, paste a drafted prompt into its input box, and send it, so the dig starts without waiting for the user.
When the user asks to see the prompt first, with a word such as "draft" or "let me edit", leave it unsent in the input box for them to edit and send.
在当前窗格旁边的分屏中打开当前对话的分叉副本,将拟好的提示词粘贴到其输入框并发送,从而无需等待用户即可开始深入研究。
当用户使用“draft”或“let me edit”等词语,要求先查看提示词时,将其留在输入框中,不发送,以便用户编辑和发送。
1. Pick the question
1. 选择问题
The question follows the command: in Claude Code, the appended request in pi. When it is empty, take the open question from the last few turns and say it in one line.
$ARGUMENTS问题跟在命令之后:在 Claude Code 中为 ,在 pi 中为追加的请求。如果为空,从最近几轮对话中找出尚未解决的问题,并用一行说明。
$ARGUMENTS2. Run the script
2. 运行脚本
scripts/sidequest.pybash
python3 <this skill's folder>/scripts/sidequest.py \
--question "<the question, sharpened>" \
--context "<one or two lines: why it came up, what we already know or tried>" \
--topic "<three to six words naming the question>"- Add only when the user asked to edit the prompt first. The draft is then pasted and left unsent.
--draft-only - Keep the question and the context short. The fork already has the whole conversation.
- The script ends by printing the fork's screen, and a line with the ids of the new pane.
sidequest pane:
scripts/sidequest.pybash
python3 <this skill's folder>/scripts/sidequest.py \
--question "<the question, sharpened>" \
--context "<one or two lines: why it came up, what we already know or tried>" \
--topic "<three to six words naming the question>"- 仅当用户要求先编辑提示词时,才添加 。此时草稿会被粘贴并保持未发送状态。
--draft-only - 问题和上下文应保持简短。分叉副本已经包含完整对话。
- 脚本最后会打印分叉副本的屏幕内容,以及一行 ,其中包含新窗格的 id。
sidequest pane:
3. When it stops
3. 脚本停止时
The script exits 1 in six cases. Each one is worth a reply, not a retry loop. It prints why, then the draft it could not deliver.
- No transcript for the session id. Say which id it read, and give the draft in your reply.
- No Ghostty or Rex terminal. Say which app it found, and give the draft in your reply so the user can paste it into a fork by hand.
- No live Rex session to pick. The pane's own session is gone and Rex has none or several. Show the list it printed and ask which session to split. Then run the script again with .
--rex-session <id> - No single pane matched. In Ghostty, the user has more than one terminal holding this project, or the session has no name yet. Ask which pane to use. Then run the script again with .
--pane <id> - The fork never reached its input box. Read the screen it printed. A startup dialog may be open. Leave it for the user, and give them the draft in your reply.
- The split failed. Rex prints the reason, or returns no block id. Report it and hand over the draft.
脚本会在六种情况下以状态码 1 退出。每种情况都应直接回复用户,而不是进行重试循环。脚本会打印失败原因,以及未能送达的草稿。
- 找不到 session id 对应的 transcript。 说明脚本读取的是哪个 id,并在回复中给出草稿。
- 没有 Ghostty 或 Rex 终端。 说明检测到的应用,并在回复中给出草稿,方便用户手动粘贴到分叉副本中。
- 没有可选择的活动 Rex session。 当前窗格自身的 session 已消失,并且 Rex 中没有 session 或存在多个 session。显示脚本打印的列表,询问用户要拆分哪个 session。然后使用 再次运行脚本。
--rex-session <id> - 未匹配到唯一的窗格。 在 Ghostty 中,有多个终端持有此项目,或该 session 尚无名称。询问用户要使用哪个窗格。然后使用 再次运行脚本。
--pane <id> - 分叉副本未进入其输入框。 阅读脚本打印的屏幕内容。可能打开了启动对话框。将其留给用户处理,并在回复中给出草稿。
- 分屏失败。 Rex 会打印原因,或者不返回 block id。报告问题并把草稿交给用户。
4. Check what it opened
4. 检查打开的内容
Read the screen the script printed.
- Sent (the default). The fork should be working on the prompt, and its input box should be empty. If the draft is still sitting in the box, the enter did not land. Press it once more, with the ids from the line:
sidequest pane:in Rex, or the use-ghostty script'srex send-key -s <session> -b <block> enterin Ghostty. Akey <pane> enterchip in Claude Code sends the whole draft, so leave it.[Pasted text #N] - With . The draft should be in the input box as text the user can edit. Claude Code collapses a long paste into a
--draft-onlychip, and the script pastes once more to open it. pi shows the whole draft the first time. Do not press enter in that pane.[Pasted text #N]
读取脚本打印的屏幕内容。
- 已发送(默认行为)。 分叉副本应正在处理提示词,且其输入框应为空。如果草稿仍留在输入框中,说明回车未生效。使用 行中的 id 再按一次回车:在 Rex 中执行
sidequest pane:;在 Ghostty 中执行 use-ghostty 脚本的rex send-key -s <session> -b <block> enter。Claude Code 中的key <pane> enter标签会发送整份草稿,因此保留该标签即可。[Pasted text #N] - 使用 时。 草稿应作为可编辑文本留在输入框中。Claude Code 会将较长的粘贴内容折叠成
--draft-only标签,脚本会再次粘贴以将其展开。pi 第一次就会显示完整草稿。不要在该窗格中按回车。[Pasted text #N]
5. Report
5. 报告
One line: the question, and that the side chat is working on it in the new split. With , say that the draft is waiting there for the user to edit and send.
--draft-only用一行说明:问题是什么,以及侧边对话正在新分屏中处理该问题。使用 时,说明草稿正在该处等待用户编辑和发送。
--draft-only6. In the fork, when the dig is done
6. 在分叉副本中完成深入研究后
This step is for the forked copy, not the session that ran the script. The draft's last line sends you here.
Give your findings in the side chat first. Then ask the user one question with two choices, using the question tool when the harness has one:
- Send the summary to the main chat. Only on this answer, send a short summary to the session the draft names. In Claude Code, list the peer sessions, find that name, and send with the session message tool. The first line says it is the sidequest's summary and names the question. Then say in the side chat that it was sent.
- Keep digging here. Send nothing. Carry on in the side chat, and ask the same question again at the next natural stop.
Never send to the main chat without that yes, and never tell the user to copy the summary across by hand. When the main chat is not listed, or the harness has no way to message another session (pi), say so and put the summary in your reply.
此步骤针对分叉副本,而非运行脚本的 session。草稿的最后一行会将你引导到这里。
先在侧边对话中给出调查结果。然后向用户提出一个包含两个选项的问题;如果 harness 提供 question 工具,请使用该工具:
- 将摘要发送到主对话。 只有在用户选择此答案后,才向草稿中指定的 session 发送简短摘要。在 Claude Code 中,列出对等 session,找到该名称,并使用 session message 工具发送。摘要的第一行应说明这是 sidequest 的摘要,并注明所回答的问题。然后在侧边对话中告知用户摘要已发送。
- 继续在这里深入研究。 不发送任何内容。在侧边对话中继续工作,并在下一个合适的停顿点再次提出同样的问题。
未经用户明确同意,绝不向主对话发送内容,也绝不让用户手动复制摘要。如果主对话未出现在列表中,或 harness 无法向其他 session 发送消息(例如 pi),则说明这一点,并在回复中附上摘要。