My Claude Code Mods Skill 技能
一键给 Claude Code 装上「调试飞行记录仪」的 6 件套开源 Mods 集合
My Claude Code Mods — 一键给 Claude Code 装上「调试飞行记录仪」的 6 件套开源 Mods 集合
技能简介
My Claude Code Mods 是开发者 YeonwooSung 个人维护的一组 Claude Code Mods(官方插件机制)开源合集,主题是把 Claude Code 当作"工程团队"对待,给它装上 OTLP trace 上报、context 浪费分析、git 影子快照、循环重试检测、置顶 memo、模型负载可视化等 6 件可即插即用的 Mods。全部 Node 22.19 + TypeScript 编写,遵循 Anthropic 官方 plugin@marketplace 规范,可在 Claude Code 2.1.292+ 直接 claude plugin install 一键安装,开启后 Claude Code 会变成"自带黑匣子 + 时空机"的 IDE 级编程代理。
核心能力
- agent-profiler:记录每次 session 的"时间花在哪里"(model wait / tools / subagents / re-reads),并以 OTLP 协议导出到 Jaeger / Tempo / Honeycomb,全链路可观测。
- context-inspector:分析上下文窗口里的"垃圾"——重复输出、未使用注入、压缩后丢失内容、模型自相矛盾段,给出可执行的瘦身建议。
- time-machine:每次 tool 调用都会触发 shadow-git 快照保存当前仓库状态,一条 branching timeline 能让你回到任意一步对比 diff、回滚、单步重放。
- loop-detective:检测 "Bash 反复失败 / Edit-Retry 循环 / 同一文件反复 Re-read" 等 7 类 agent 卡死模式,给出 evidence + investigation prompt + 实时 case pane。
- pin-memo:在 Claude Code 输入框上方置顶 memo / 任务清单 / 一键跳转链接,同一文件夹 resume 时自动恢复。
- model-effort-band:在 prompt 上方显示当前 model 与主线程 effort(Sonnet 4 / Opus 4.1 / Haiku)的彩色进度条,便于对比不同模型的 token 燃烧速度。
安装配置
- 前置环境:Claude Code 2.1.292 或更高版本(部分 Mod 兼容回 2.1.280);Node.js 22.19.0+。
- 安装方式:
/plugin marketplace add YeonwooSung/my-claude-code-mods /plugin install agent-profiler@my-claude-code-mods # 也可一次装多件 /plugin install context-inspector@my-claude-code-mods /plugin install time-machine@my-claude-code-mods - 启用开关:每个 Mod 装完后会自动出现在
~/.claude/settings.json的enabledPlugins列表;可通过/plugin命令单独启停。
使用步骤
- 在 Claude Code 中启动:
claude启动后输入/plugin→ 看到 6 个 Mod 全部✓ enabled。 - 执行一次复杂任务:例如
重构这个 monorepo,把 Shared 类型抽到 packages/core——agent-profiler会在右下角统计耗时;time-machine自动落快照。 - 查看 time-machine timeline:输入
/timeline,进入分支式 UI,可选任一步骤 diff / restore / branch。 - 调试卡死的任务:若 agent 进入 retry 循环,
loop-detective会弹窗提示,并给出 "是否 abort / 修改 prompt / 缩小范围" 的建议按钮。 - 导出可观测数据:
agent-profiler自动把 OTLP traces 推到http://localhost:4318,Jaeger UI 即可看到完整火焰图。
适用场景
- 大型 monorepo 重构:用
time-machine给步骤回滚 + diff,给"重构搞崩测试"留后悔药。 - 长 session 上下文优化:当 context 涨到 80% 时
context-inspector提示"上次压缩丢了 30 条 message"。 - 多 agent 协作调试:看 OTLP trace 找出"主 agent 等子 agent 的 5s 空闲"瓶颈。
- 评测不同 Claude 模型:用
model-effort-band横向对比 Opus 4.1 / Sonnet 4 / Haiku 在同一 prompt 上的 token 燃烧差异。 - 教学演示:把
time-machine的 timeline 截图给学生看"AI 编程时脑子里的实际推理路径"。
适用人群
- 每天用 Claude Code 跑生产任务的 专业软件工程师(尤其做大型重构 / 多语言 monorepo)。
- DevOps / SRE:希望把 AI agent 也纳入 OpenTelemetry / Jaeger 体系做 SLA 监控。
- AI 编程效率研究者:想量化不同模型 / Mod 配置下 token / 时间的真实成本。
- AI 教育者:把"AI 改代码的全过程"做成可视教材。
工作原理
每个 Mod 走 Claude Code 官方 hook 体系——PreToolUse / PostToolUse / Stop 钩子在不打乱主对话的情况下旁路挂入。time-machine 走 git 影子仓库 + 软链接,定期 hash 后保存;agent-profiler 通过 @opentelemetry/api 导出 OTLP;loop-detector 用滑动窗口 hash 跟踪 50 次最近 tool 调用的 signature,识别 retry 模式。所有 Mod 共享 packages/core 的公共类型与测试套件(npm test),并配有针对 Claude Code 2.1.292 的适配器测试。
官方链接
- GitHub 仓库(6 Mods 全集合):https://github.com/YeonwooSung/my-claude-code-mods
- 各 Mod 子 README:
agent-profiler/、context-inspector/、time-machine/、loop-detective/、pin-memo/、model-effort-band/ - Claude Code Mods 官方文档:https://code.claude.com/docs/en/plugins/mods/overview
- 许可协议:MIT License(可自由 fork / 修改 / 商用于自己的 Claude Code 工作流)
团队信息
AI产品库
官方
由 AI 猎手自动发现
评论与建议
登录 后参与评论或提建议