Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By ray-amjadv0.5.5MITIn 1 marketplace
A one-line band above the prompt: context used, and a countdown until the prompt cache goes cold
Trending plugins
7-day copy clicks
Code that runs inside Claude Code on every session, as you, unsandboxed.
Claude Code asks for these when you enable the plugin. Sensitive values are stored in your system keychain.
When the cache is about to go coldonWarning
What to do at the warning if you haven't replied. handoff: Claude writes a per-session HANDOFF-<id>.md. off: just the toast. To compact instead, use Claude Code's own idle compaction (2.1.299+).
One of handoff, off
stringdefault handoff
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it runs programs; reads files; reads environment variables (CACHE_CLOCK_AUTO_HANDOFF, CACHE_CLOCK_HANDOFF_DIR, CACHE_CLOCK_MAIN_TTL_MIN, CACHE_CLOCK_ON_WARNING, CACHE_CLOCK_SOUND, CACHE_CLOCK_SUB_TTL_MIN, CACHE_CLOCK_WARN_MIN, OS); reads or rewrites your prompts; sends prompts on its own.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A Claude Code mod that puts one line above the prompt: how long until the prompt cache goes cold, how full the context window is, and a separate clock for subagents while one is warm.

Every request to the model writes the conversation to the prompt cache. If the next request arrives before the cache expires, everything so far is read back at a fraction of the price. If it arrives after, the whole context is sent again at full price. Claude Code never shows you which side of that line you are on. This does.
The countdown restarts on every model request. Subagent requests run their own sub clock.
It turns yellow in the last quarter and red near the end, and pops a toast when the warning time is reached (optionally with a sound).
At zero it says cache cold, and a toast tells you the next message is a full-price write.
The TTL is read from the session itself: the API records whether each cache write was a 1 hour or a 5 minute one, and the band says measured once it has seen one.
At the warning, if Claude is idle and you haven't replied, it acts while the cache is still warm. You pick what it does in the plugin's settings (onWarning):
handoff (the default): Claude writes a handoff note, HANDOFF-<first 8 characters of the session id>.md, in the project root, in case you don't come back. Each session has its own file, so parallel sessions in one folder don't overwrite each other.off: just the toast.It runs once per idle stretch and re-arms when you send a message.
Want the session compacted instead? Use Claude Code's own idle compaction (2.1.299 and later, on by default): a conversation of 200K+ tokens left idle for about 54 minutes is compacted before its one-hour cache expires. Turn it on or off with Idle compaction in /config, and change the 200K minimum with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS. The mod's own compact option is gone; a saved compact now acts as off.
/cache-clock prints the same line as text.
Does nothing in -p / SDK sessions.
The handoff is the only thing it sends to Claude: one short turn on a warm cache.
claude plugin marketplace add ray-amjad/claude-code-mods
claude plugin install cache-clock@claude-code-mods
Or inside Claude Code: /plugin marketplace add ray-amjad/claude-code-mods, then /plugin install cache-clock@claude-code-mods.
onWarning is a plugin setting: set it with /plugin configure cache-clock@claude-code-mods. The rest are optional environment variables. Minutes may be fractional.
| Variable | Default | What it does |
|---|---|---|
CACHE_CLOCK_MAIN_TTL_MIN | 60 | Main session TTL. Setting it pins it; otherwise the mod reads it from the transcript. |
CACHE_CLOCK_SUB_TTL_MIN | 5 | Subagent TTL |
CACHE_CLOCK_WARN_MIN | 5 | Toast, the onWarning action and the colour red when this much is left |
CACHE_CLOCK_ON_WARNING | the setting | handoff or off; overrides the plugin setting |
CACHE_CLOCK_AUTO_HANDOFF | on | 0 means off (kept from older versions) |
CACHE_CLOCK_HANDOFF_DIR | project root | Folder the handoff notes go to |
CACHE_CLOCK_SOUND | off | 1 plays sounds/cooling.wav with the warning toast |
To watch the whole cycle in two minutes:
CACHE_CLOCK_MAIN_TTL_MIN=2 CACHE_CLOCK_WARN_MIN=1.5 claude
turn.step (one per model request) restarts the main clock, or the sub clock when the step carries an agentId. A one second $.clock.every redraws the band and checks the warning./recap and /btw send the conversation to the model outside a turn, so no turn.step fires for them. Their request reads the main cache all the same, so a command.run hook on each restarts the main clock too, while the cache is still warm (a bare /btw sends nothing and is ignored).usage.cache_creation: tokens in ephemeral_1h mean 1 hour, ephemeral_5m mean 5 minutes. On --resume it seeds the clock from the session's seconds_since_last_response.$.session.usage() at start, then the pushed session.measure figures.turn.start/turn.complete) and nothing has run since your last prompt, handoff calls $.prompt.submit. A prompt.submit hook re-arms it on your next prompt.7-day copy clicks
npx claudepluginhub ray-amjad/claude-code-mods --plugin cache-clockBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground