cache-clock is a Claude Code usage mod by ray-amjad.
Draws a line above the prompt with the time until the prompt cache goes cold, the context fill, and a subagent clock, and has Claude write a handoff first.
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
Version
0.5.4
License
MIT
Repo stars
89
Last change
2026-10-18
What it can reach
Draws in the session
Reads usage or context figures
Inside Claude Code the README also gives /plugin marketplace add ray-amjad/claude-code-mods, then /plugin install cache-clock@claude-code-mods. The countdown restarts on every model request, and subagent requests run their own sub clock. It turns yellow in the last quarter and red near the end. A toast pops at the warning, 5 minutes left by default, optionally with a sound. At zero the line says cache cold, and a toast says the next message is a full-price write. The TTL is read from the session transcript, and the line says measured once it has seen a cache write. If none of the last 300 transcript lines wrote to the cache, the TTL keeps its previous or default value and says assumed. onWarning is a plugin setting, set with /plugin configure cache-clock@claude-code-mods. handoff, the default, has Claude write HANDOFF-<first 8 characters of the session id>.md in the project root when Claude is idle and you haven't replied. off gives just the toast. It runs once per idle stretch and re-arms when you send a message. A later handoff in the same session overwrites that session's note, and it fires even with a draft typed but not sent. The author says the handoff is the only thing it sends to Claude, one short turn on a warm cache. /cache-clock prints the same line as text. Environment variables set the main and subagent TTLs, the warning time, the handoff folder, and the sound. It does nothing in -p or SDK sessions. In a narrow terminal the line drops pieces from the right instead of wrapping.
The install name is cache-clock. This page adds the author's name. The marketplace name is claude-code-mods, the same string hamzafer, arasovic, and karanb192 use. Add ray-amjad/claude-code-mods. The marketplace also holds decision-tree, memory-fork, dream-pass, and other mods. This one installs on its own. The cache countdown is why this page files it under usage. cache-clock, by hamzafer, draws a prompt-cache line under the status line, with hits and misses and how many tokens the next message re-caches once it goes cold. cache-timer draws a countdown above the prompt until the prompt cache expires. This one adds the context fill and a subagent clock, and has Claude write a handoff note at the warning. In the source, the end of the transcript is read with tail on macOS and Linux and with PowerShell on Windows.
Demo
From the author's repo.
What it hooks into
session.startWhen a session starts
classic.SessionStartA Claude Code event
turn.startWhen Claude starts a turn
turn.completeWhen a turn ends
prompt.submitWhen you send a prompt
turn.stepAt each step of a turn
command.runWhen you run its slash command/recap/btw/cache-clock
classic.StopA Claude Code event
session.measureWhen usage is measured
ui.renderDraws into the sessionAbovePrompt
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Slash commands 1
/cache-clockPrint the cache countdown and context use
Files
The author's README and source, 4 files. They load when you open them.