‹ 首页

restart-claude

@zylos-ai · 收录于 昨天 · 上游提交 2 天前

Use when the user asks to restart Claude Code, or after changing settings/hooks/keybindings.

适合你,如果经常修改 Claude Code 的设置、钩子或快捷键

/ 通过 npx 安装 校验哈希
npx oh-my-skill add zylos-ai/zylos-core/restart-claude
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- zylos-ai/zylos-core/restart-claude
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify zylos-ai/zylos-core/restart-claude
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
1155GitHub stars
~548最小装载
~548含声明引用
~553文本包总量
索引托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 7a034ca

Restart Claude Code Skill

Restart Claude Code session - sends /exit and lets activity-monitor daemon handle the restart.

When to Use
  • After changing Claude Code settings, hooks, or keybindings
  • When Claude needs to reload configuration
  • To clear temporary state without upgrading
  • User explicitly asks to restart
Pre-Restart Checklist

Before sending /exit, complete these steps in order:

1. Stop background tasks

Check for running background agents (Task tool). If any are active, stop them to avoid orphaned work.

2. Sync memory

Update memory files (state.md, sessions/current.md, etc.) to preserve important context that would otherwise be lost on restart.

3. Write a session handoff summary

Write a brief message covering:

  • What was being worked on (active tasks, user requests in progress)
  • Current state (what's done, what's pending, any blockers)
  • What the next session should pick up (if anything)
4. Send the handoff summary

Send the full handoff summary to the internal void channel via C4:

cat <<'EOF' | node ~/zylos/.claude/skills/comm-bridge/scripts/c4-send.js "void" "session-handoff"
<handoff summary>
EOF

The void channel is record-only: the message is stored in C4 conversation history (so the restarted session's startup hook, c4-session-init, includes it in startup context) but is never delivered to any real channel or display surface.

Do not send the full handoff summary to the active external user channel (Telegram, Lark, Feishu, HXA, etc.). Handoff summaries are operational context for the next agent session and may contain task state from outside the current conversation. If the user is actively waiting, send only a short user-facing notice to their current reply via path, without internal task inventory or cross-channel context.

5. Enqueue /exit
node ~/zylos/.claude/skills/comm-bridge/scripts/c4-control.js enqueue --content "/exit" --priority 1 --block-queue-until-idle
How It Works
  1. Enqueue /exit: Puts /exit into the control queue (priority=1, block_queue_until_idle)
  2. Block subsequent messages: block_queue_until_idle prevents other messages from being dispatched
  3. Deliver when idle: Dispatcher delivers /exit to tmux when Claude is idle
  4. Daemon restart: activity-monitor detects exit and restarts Claude
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。