
如何用 omc-doctor 检查 oh-my-claudecode 安装健康度并自动修复遗留 hooks 与版本漂移【免费下载链接】oh-my-claudecodeTeams-first Multi-agent orchestration for Claude Code项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-claudecode如果你在用 oh-my-claudecodeOMC时遇到 hook 重复触发、行为异常或者更新插件后CLAUDE.md里的 OMC 配置和插件实际版本对不上可以走一次 omc-doctor 诊断在 Claude Code 会话里运行/oh-my-claudecode:omc-doctor它会逐项检查插件版本、遗留 hooks、CLAUDE.md标记、Ruby 依赖、插件缓存和 curl 时代遗留内容输出一份 HEALTHY / ISSUES FOUND 报告确认问题后可以让它自动执行修复命令最后重启 Claude Code 并复查报告。完整诊断逻辑定义在 skills/omc-doctor/SKILL.md/oh-my-claudecode:omc-doctor是正式入口commands/omc-doctor.md 中的兼容命令会在运行时加载这份 SKILL.md 并严格按它执行。前置条件Claude Code 已安装OMC 已通过 marketplace 插件流安装/plugin marketplace add/plugin install oh-my-claudecode具体命令见 docs/GETTING-STARTED.md。如果需要跑omc update/omc setup这类修复命令还要在 shell 侧装过 CLInpm i -g oh-my-claude-sisyphuslatestnpm 包名是oh-my-claude-sisyphus不是仓库名。文档中所有~/.claude/...路径在设置了CLAUDE_CONFIG_DIR环境变量时都指向该目录本文命令沿用文档的${CLAUDE_CONFIG_DIR:-$HOME/.claude}写法即“设置了CLAUDE_CONFIG_DIR就用它否则用~/.claude”。运行诊断在 Claude Code 会话中输入/oh-my-claudecode:omc-doctorREADME 中也在更新排障流程里使用过简写形式/omc-doctor。doctor 会依次执行 7 项检查其中最与“遗留 hooks”和“版本漂移”相关的有四项。检查 1插件版本。读取本地缓存目录${CLAUDE_CONFIG_DIR:-~/.claude}/plugins/cache/omc/oh-my-claudecode下以数字开头的版本子目录并与 npm 上的最新版本比对node -e const prequire(path),frequire(fs),hrequire(os).homedir(),dprocess.env.CLAUDE_CONFIG_DIR||p.join(h,.claude),bp.join(d,plugins,cache,omc,oh-my-claudecode);try{const vf.readdirSync(b).filter(x/^\d/.test(x)).sort((a,c)a.localeCompare(c,void 0,{numeric:true}));console.log(Installed:,v.length?v[v.length-1]:(none))}catch{console.log(Installed: (none))} npm view oh-my-claude-sisyphus version 2/dev/null || echo Latest: (unavailable)判定没有任何版本目录是 CRITICAL插件未安装本地版本不是最新是 WARN缓存里存在多个版本是 WARNstale cache。检查 2settings.json 中的遗留 hooks。doctor 会读取 profile 级${CLAUDE_CONFIG_DIR:-~/.claude}/settings.json和项目级./.claude/settings.json看hooks键下是否存在指向旧版 bash 脚本的条目例如bash ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/keyword-detector.sh bash ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/persistent-mode.sh bash ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/session-start.sh只要找到就是 CRITICAL文档的判断是这类遗留 hooks 会导致重复触发duplicates。检查 3遗留 bash hook 脚本文件。ls -la ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/*.sh 2/dev/null若keyword-detector.sh、persistent-mode.sh、session-start.sh、stop-continuation.sh存在为 WARNlegacy scripts容易混淆。检查 4CLAUDE.md 与版本漂移。doctor 先确认CLAUDE.md存在并带有!-- OMC:START --标记若标记在CLAUDE-omc.md等 companion 文件里属于文档认可的 file-split 模式同样是 OK然后用一段 node 脚本比对CLAUDE.md或其 companion中的!-- OMC:VERSION:xxx --标记与缓存中最新的插件版本。相关命令摘自 SKILL.md Step 4# Check for OMC markers (!-- OMC:START -- is the canonical marker)【免费下载链接】oh-my-claudecodeTeams-first Multi-agent orchestration for Claude Code项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-claudecode创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考