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

cache-clock

状态栏下方的一行提示缓存信息:缓存热时显示剩余分钟数,缓存冷时显示下一条消息会重新缓存多少 token。/cache-clock setup 可添加它。

hamzafer@hamzafer

hamzafer/claude-code-mods/tree/main/mods/cache-clock

原帖图片1
已翻译

关于这个 mod

<p align="center"><img src="images/claude-wave.gif" alt="" width="40"></p> <h1 align="center">Claude Code mods</h1> <p align="center"><b>让 Claude Code 展示它正在做什么。</b><br>基于 function hooks 构建的 Claude Code 外挂:提示符上方的实时行、守卫、面板和游戏。只安装你想要的那些。</p> <p align="center"> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT"></a> <a href="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml"><img src="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a> </p> <p align="center"> <a href="#-install">安装</a> · <a href="#-the-mods">全部外挂</a> · <a href="docs/mods.md">文档</a> · <a href="https://claude.dev/blog/getting-started-with-claude-code-mods/">什么是 mods?</a> </p> <table> <tr> <td align="center" width="33%"><a href="docs/mods.md#-context-bar"><img src="images/context-bar.png" alt="context-bar: Claude Code 上下文窗口使用量以堆叠条形图显示,每个类别一种颜色" width="260"></a><br>📊 <b>context-bar</b><br>是什么填满了你的上下文</td> <td align="center" width="33%"><a href="docs/mods.md#-review-watch"><img src="images/review-watch.png" alt="review-watch: Claude Code 中运行中的 Codex 和子代理代码审查的实时行" width="260"></a><br>🔍 <b>review-watch</b><br>实时运行代码审查</td> <td align="center" width="33%"><a href="docs/mods.md#-md-preview"><img src="images/md-preview.png" alt="md-preview: Claude Code 编辑的 Markdown,在差异旁边像 GitHub 一样渲染" width="260"></a><br>📝 <b>md-preview</b><br>像 GitHub 一样渲染 Markdown</td> </tr> <tr> <td align="center" width="33%"><a href="docs/mods.md#-blast-radius"><img src="images/gallery/blast-radius.png" alt="blast-radius: 一个 Claude Code 钩子拦截 rm -rf 并列出它将删除的文件" width="260"></a><br>💥 <b>blast-radius</b><br>看看 <code>rm -rf</code> 会删除什么</td> <td align="center" width="33%"><a href="docs/mods.md#-now-playing"><img src="images/now-playing.png" alt="now-playing: Claude Code 内的 Spotify 曲目、进度条和同步歌词" width="260"></a><br>🎵 <b>now-playing</b><br>Spotify 及其歌词,实时</td> <td align="center" width="33%"><a href="docs/mods.md#-reels-and-snake"><img src="images/reels-demo.gif" alt="reels: Claude Code 窗格中同时播放的 YouTube Shorts" width="260"></a><br>📱 <b>reels</b><br>Claude 工作时看 Shorts</td> </tr> <tr>
<td align="center" width="33%"><a href="docs/mods.md#-where-am-i"><img src="images/gallery/where-am-i.png" alt="where-am-i: the session goal, current step and what waits on you, above the Claude Code prompt" width="260"></a><br>📍 <b>where-am-i</b><br>目标、当前状态、等待你处理的事项</td>
<td align="center" width="33%"><a href="docs/mods.md#-lines-above-the-prompt"><img src="images/gallery/lines.png" alt="token-weather, usage-meter and other Claude Code status lines stacked above the prompt" width="260"></a><br>🌦️ <b>token-weather 及其伙伴</b><br>提示上方的状态行</td>
<td align="center" width="33%"><a href="#mission-control"><img src="images/gallery/mission-control.png" alt="mission-control: Claude Code subagents, tool calls and the files they touch, live" width="260"></a><br>🛰️ <b>mission-control</b><br>代理及其触及的代码</td>
</tr> </table>

🚀 安装

先添加一次市场,然后按名称安装任意模组:

claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install context-bar@claude-code-mods

或者一次性安装通用套装:

for m in context-bar token-weather usage-meter where-am-i next-steps agent-radar review-watch replay-theater md-preview blast-radius mission-control; do
  claude plugin install "$m@claude-code-mods"
done

安装后重启 Claude Code。若想在不安装的情况下试用:

git clone https://github.com/hamzafer/claude-code-mods && cd claude-code-mods
claude --plugin-dir mods/context-bar

需求:Claude Code 2.1.287+。少数模组需要更多(Chrome、gh、一个连接器);表格中注明了是哪些。

🧩 模组

👀 看清正在发生什么

| | 模组 | 作用 | 命令 | | --- | --- | --- | --- | | 🛰️ | mission-control | 实时地图,展示智能体、工具调用及其触碰的代码 | /mission | | 📊 | context-bar | 将你的上下文窗口显示为一个堆叠条形图,每个类别一种颜色,带有 token 计数以及压缩发生的位置 | /context-bar | | 🌦️ | token-weather | 上下文填充从 Clear 到 Compact soon,外加提示缓存倒计时 | | | ⏱️ | cache-clock | 状态行下方的一行提示缓存信息,基于 Claude Code 自身的数据:剩余时间、命中率与未命中数,以及你的下一条消息在缓存变冷后重新缓存的 token。需要 Node 和 Claude Code 2.1.251+ | /cache-clock setup | | 📍 | where-am-i | 目标、当前正在做什么、在等你什么、下一步 | /where | | ➡️ | next-steps | 每轮之后 2 或 3 个可能的下一步提示,按一个键即可起草其中一个 | 1 2 3,0 隐藏 | | 💰 | usage-meter | 5 小时和 7 天计划用量、重置倒计时以及本次会话的花费 | | | 💳 | openai-balance | 你的 OpenAI API 额度:一个带仪表的估算余额、今日花费、钱主要花在哪里,以及最后一次调用。需要一个 OpenAI 组织 Admin 密钥 | /openai-balance | | 📡 | agent-radar | 每个正在运行的子智能体一行实时信息 | /radar | | 🔍 | review-watch | 每个正在运行的代码审查(Codex 或审查子智能体)一行实时信息,包含模型、目标、已用时间以及 Codex 的最新输出。结束时会有提示列出发现的问题 | | | 🌐 | browser-lanes | 本次会话是否有浏览器,以及谁持有它 | /browser | | 🕌 | prayer-times | 当前的礼拜及其剩余时间、下一次礼拜以及 zawal。在你的电脑上计算,哈乃斐或标准 Asr | /prayers | | 🎬 | replay-theater | 逐步回放上一轮的编辑,一次一个差异 | /replay | | 📝 | md-preview | 像 GitHub 那样渲染 Claude 编辑的 Markdown 文件,前后并排对照。需要 Chrome 和能显示图像的终端 | /md |

🛡️ 保护你的仓库

| | Mod | 功能 | 命令 | | --- | --- | --- | --- | | 💥 | blast-radius | 拦截 rm -r、强制推送和迁移,显示它们将删除的内容,60 秒无应答后取消 | |

💸 少花钱

| | Mod | 功能 | 命令 | | --- | --- | --- | --- | | 🔀 | switchboard | 通过 OpenAI 的 Decisions API 或 Jev,仅根据短标签为每个未指定模型的子代理挑选模型。显示每个子代理的花费 | /route |

🔧 我的配置(Fork 并调整)

这些是围绕我自己的工具和规则构建的。Fork 它们并把规则改成你自己的。

| | Mod | 功能 | 命令 | | --- | --- | --- | --- | | 👀 | glance | 用一行显示需要你处理的事项:下一个会议、PR、Linear 问题、Slack 私信。需要 gh 以及 Google Calendar、Linear 和 Slack 连接器 | /glance | | 🚦 | merge-gate | 拦截 gh pr merge,直到 CI 通过且 Codex 审查过一次。需要 gh 和 Codex CLI。审查运行在一个固定模型上;把它改成你的 | /gate | | 📏 | rulebook-guard | 强制执行我的写作和 git 规则:重写破折号,在 --amend、未格式化的推送、笔记中的电子邮件和电话号码之前询问 | | | 💾 | session-saver | 保存你上次离开的位置,在恢复时显示它。需要 unpause | /park [note] |

🎮 为了好玩(可选)

| | Mod | 功能 | 命令 | | --- | --- | --- | --- | | 📱 | reels | 在 Claude 工作时播放 YouTube Shorts,完成后暂停 | /reels | | 🐍 | snake | 在 Claude 工作时玩贪吃蛇 | /snake | | 🎵 | now-playing | Spotify 正在播放的内容,带有进度条、正在演唱的歌词,以及 ⏮ ⏸ ⏭ 按钮。需要 macOS 和 Spotify 应用 | /music |

<a id="mission-control"></a>

🛰️ 旗舰功能:mission-control

每一个子代理、每一次工具调用以及它们触碰的每一个文件,都显示在聊天旁边的窗格中。以 4 倍速展示:两个子代理跨四个文件构建一个登出功能。

mission-control 以 4 倍速展示:两个子代理和一个登出功能落在四个文件上

像安装任何 mod 一样安装它,重启,然后输入 /mission(或 /mission code 打开代码地图)。q 关闭它。

  • 🤖 w 实时显示代理和每一次工具调用
  • 🗺️ c 显示代码地图,带有导入箭头
  • 🔵 蓝色 当代理读取文件时
  • 🟠 橙色 当它写入时
  • 🟢 绿色 完成时,附带一行说明改了什么

代码视图还需要 macOS、Google Chrome 以及一个能显示图像的终端(Ghostty、kitty、iTerm2)。Who 视图在任何地方都能用。

📚 更多

安装

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

claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install cache-clock
原文 / README
<p align="center"><img src="images/claude-wave.gif" alt="" width="40"></p> <h1 align="center">Claude Code mods</h1> <p align="center"><b>Make Claude Code show what it's doing.</b><br>Plugins for Claude Code, built on function hooks: live lines above the prompt, guards, panes and games. Install only the ones you want.</p> <p align="center"> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT"></a> <a href="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml"><img src="https://github.com/hamzafer/claude-code-mods/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a> </p> <p align="center"> <a href="#-install">Install</a> · <a href="#-the-mods">All mods</a> · <a href="docs/mods.md">Docs</a> · <a href="https://claude.dev/blog/getting-started-with-claude-code-mods/">What are mods?</a> </p> <table> <tr> <td align="center" width="33%"><a href="docs/mods.md#-context-bar"><img src="images/context-bar.png" alt="context-bar: Claude Code context window usage as a stacked bar, a color per category" width="260"></a><br>📊 <b>context-bar</b><br>what fills your context</td> <td align="center" width="33%"><a href="docs/mods.md#-review-watch"><img src="images/review-watch.png" alt="review-watch: live lines for running Codex and subagent code reviews in Claude Code" width="260"></a><br>🔍 <b>review-watch</b><br>running code reviews, live</td> <td align="center" width="33%"><a href="docs/mods.md#-md-preview"><img src="images/md-preview.png" alt="md-preview: Markdown that Claude Code edits, rendered like GitHub next to the diff" width="260"></a><br>📝 <b>md-preview</b><br>Markdown rendered like GitHub</td> </tr> <tr> <td align="center" width="33%"><a href="docs/mods.md#-blast-radius"><img src="images/gallery/blast-radius.png" alt="blast-radius: a Claude Code hook holds rm -rf and lists the files it would delete" width="260"></a><br>💥 <b>blast-radius</b><br>see what <code>rm -rf</code> would delete</td> <td align="center" width="33%"><a href="docs/mods.md#-now-playing"><img src="images/now-playing.png" alt="now-playing: Spotify track, progress bar and synced lyrics inside Claude Code" width="260"></a><br>🎵 <b>now-playing</b><br>Spotify and its lyrics, live</td> <td align="center" width="33%"><a href="docs/mods.md#-reels-and-snake"><img src="images/reels-demo.gif" alt="reels: YouTube Shorts in a Claude Code pane while it works" width="260"></a><br>📱 <b>reels</b><br>Shorts while Claude works</td> </tr> <tr> <td align="center" width="33%"><a href="docs/mods.md#-where-am-i"><img src="images/gallery/where-am-i.png" alt="where-am-i: the session goal, current step and what waits on you, above the Claude Code prompt" width="260"></a><br>📍 <b>where-am-i</b><br>goal, now, waiting on you</td> <td align="center" width="33%"><a href="docs/mods.md#-lines-above-the-prompt"><img src="images/gallery/lines.png" alt="token-weather, usage-meter and other Claude Code status lines stacked above the prompt" width="260"></a><br>🌦️ <b>token-weather and friends</b><br>lines above the prompt</td> <td align="center" width="33%"><a href="#mission-control"><img src="images/gallery/mission-control.png" alt="mission-control: Claude Code subagents, tool calls and the files they touch, live" width="260"></a><br>🛰️ <b>mission-control</b><br>agents and the code they touch</td> </tr> </table>

🚀 Install

Add the marketplace once, then install any mod by name:

claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install context-bar@claude-code-mods

Or install the general-purpose set in one go:

for m in context-bar token-weather usage-meter where-am-i next-steps agent-radar review-watch replay-theater md-preview blast-radius mission-control; do
  claude plugin install "$m@claude-code-mods"
done

Restart Claude Code after installing. To try one without installing:

git clone https://github.com/hamzafer/claude-code-mods && cd claude-code-mods
claude --plugin-dir mods/context-bar

Needs Claude Code 2.1.287+. A few mods need more (Chrome, gh, a connector); the tables say which.

🧩 The mods

👀 See what's happening

| | Mod | What it does | Command | | --- | --- | --- | --- | | 🛰️ | mission-control | Live map of agents, tool calls and the code they touch | /mission | | 📊 | context-bar | Your context window as one stacked bar, a color per category, with token counts and where it compacts | /context-bar | | 🌦️ | token-weather | Context fill from Clear to Compact soon, plus a prompt-cache countdown | | | ⏱️ | cache-clock | A prompt-cache line under your status line, from Claude Code's own figures: time left, hit rate and misses, and the tokens your next message re-caches once it goes cold. Needs Node and Claude Code 2.1.251+ | /cache-clock setup | | 📍 | where-am-i | Goal, doing now, waiting on you, next step | /where | | ➡️ | next-steps | 2 or 3 likely next prompts after each turn, one key to draft one | 1 2 3, 0 hides | | 💰 | usage-meter | 5-hour and 7-day plan usage, the reset countdown and the session's cost | | | 💳 | openai-balance | Your OpenAI API credit: an estimated balance with a gauge, today's spend, where the money mostly went, and the last call. Needs an OpenAI organization Admin key | /openai-balance | | 📡 | agent-radar | One live line per running subagent | /radar | | 🔍 | review-watch | One live line per running code review (Codex or a review subagent) with the model, target, elapsed time and Codex's latest output. A toast lists the findings when it ends | | | 🌐 | browser-lanes | Whether this session has a browser, and who holds it | /browser | | 🕌 | prayer-times | The current prayer and how long is left, the next one, and zawal. Computed on your computer, Hanafi or standard Asr | /prayers | | 🎬 | replay-theater | Steps through the last turn's edits, one diff at a time | /replay | | 📝 | md-preview | Renders the Markdown files Claude edits like GitHub does, with before and after side by side. Needs Chrome and a terminal that shows images | /md |

🛡️ Guard your repo

| | Mod | What it does | Command | | --- | --- | --- | --- | | 💥 | blast-radius | Holds rm -r, force pushes and migrations, shows what they'd delete, cancels after 60 s with no answer | |

💸 Spend less

| | Mod | What it does | Command | | --- | --- | --- | --- | | 🔀 | switchboard | Picks the model for each subagent that doesn't name one, with OpenAI's Decisions API or Jev, from its short label only. Shows what every subagent cost | /route |

🔧 My setup (fork and adapt)

These are built around my own tools and rules. Fork them and change the rules to yours.

| | Mod | What it does | Command | | --- | --- | --- | --- | | 👀 | glance | One line with what needs you: next meeting, PRs, Linear issues, Slack DMs. Needs gh and the Google Calendar, Linear and Slack connectors | /glance | | 🚦 | merge-gate | Holds gh pr merge until CI is green and Codex reviewed once. Needs gh and the Codex CLI. Reviews run on one fixed model; change it to yours | /gate | | 📏 | rulebook-guard | Enforces my writing and git rules: rewrites em dashes, asks before --amend, unformatted pushes, emails and phone numbers in notes | | | 💾 | session-saver | Saves where you left off, shows it on resume. Needs unpause | /park [note] |

🎮 For fun (opt-in)

| | Mod | What it does | Command | | --- | --- | --- | --- | | 📱 | reels | YouTube Shorts while Claude works, pauses when it's done | /reels | | 🐍 | snake | Snake while Claude works | /snake | | 🎵 | now-playing | What Spotify is playing, with a progress bar, the lyric being sung, and ⏮ ⏸ ⏭ buttons. Needs macOS and the Spotify app | /music |

<a id="mission-control"></a>

🛰️ Flagship: mission-control

Every subagent, every tool call and every file they touch, in a pane next to the chat. Shown at 4x: two subagents building a logout feature across four files.

mission-control at 4x: two subagents and a logout feature landing across four files

Install it like any mod, restart, and type /mission (or /mission code to open the code map). q closes it.

  • 🤖 w shows the agents and every tool call, live
  • 🗺️ c shows the code map, with import arrows
  • 🔵 Blue while the agent reads a file
  • 🟠 Orange while it writes
  • 🟢 Green when done, with one line on what changed

The Code view also needs macOS, Google Chrome and a terminal that shows images (Ghostty, kitty, iTerm2). The Who view works everywhere.

📚 More

其他同名作品

更多类似作品