ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 LeeHigma0201

resume-nudge

检测因重启或崩溃在一轮中途被切断的会话,并起草标准的接续提示;/resume-here 会发送它。

LeeHigma0201@LeeHigma0201

LeeHigma0201/claude-code-mods/tree/main/mods/resume-nudge

已翻译

关于这个 mod

当会话因重启或崩溃而中断一轮后重新打开时,此插件会在提示框中起草标准接续提示:「The Mac restarted and this session was interrupted. Pick up exactly where you left off…」。按 Enter 发送,或忽略它。

当最后一条消息属于以下情况之一时,它会将会话视为被切断:尚未返回的工具调用、Claude 尚未回答的工具结果、Claude 尚未回答的提示。如果一轮以回答结束,或你按下了 Esc([Request interrupted by user]),则不会视为被切断。

  • /resume-here 仅在会话被切断时发送接续提示。在手机上使用它,因为手机上可能看不到已起草的文字。
  • /resume-here check 报告判断结果,永远不会发送。

它从不自行发送。会话内使用 /resume 后不会触发 session.start;这时请使用 /resume-here。

Hooks:session.start、command.run。调用:$.session.messages、$.prompt.fill、$.prompt.submit(仅来自 /resume-here,并在命令已经回答后由计时器触发)、$.ui.toast、$.command.register。

测试:claude plugin test .(4 tests)。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add LeeHigma0201/claude-code-mods
claude plugin install resume-nudge
原文 / README

resume-nudge

When a session reopens after a restart or crash cut a turn off, this drafts the standard pick-up prompt in the prompt box: "The Mac restarted and this session was interrupted. Pick up exactly where you left off…". Press Enter to send it, or ignore it.

It treats the session as cut off when the last message is one of:

  • a tool call that never returned,
  • a tool result Claude never answered,
  • a prompt Claude never answered.

It is not cut off when the turn ended with an answer, or when you pressed Esc ([Request interrupted by user]).

  • /resume-here sends the pick-up prompt, only when the session is cut off. Use it from the phone, where the drafted text may not show.
  • /resume-here check reports the verdict and never sends.

It never sends on its own. session.start does not fire after an in-session /resume; use /resume-here there.

Hooks: session.start, command.run. Calls: $.session.messages, $.prompt.fill, $.prompt.submit (only from /resume-here, on a timer once the command has answered), $.ui.toast, $.command.register.

Test: claude plugin test . (4 tests).

更多类似作品