ClaudeCodeMod

All shelves / Mods / Usage

cache-clock

By ray-amjad

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.

Draws

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add ray-amjad/claude-code-mods
claude plugin install cache-clock@claude-code-mods
Open the repo

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

The cache-clock band above the Claude Code prompt: 59:08 left on the cache, context at 54k of 1M, a subagent clock, and the measured 1h TTL.
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.

Facts

Author
ray-amjad
Category
Usage
Marketplace
claude-code-mods
Repo
ray-amjad/claude-code-mods
Folder
plugins/cache-clock
Version
0.5.4
License
MIT
Repo stars
89
Last change
2026-10-18
Language
TypeScript
Files
8

Other mods in Usage

antiburnantiburnDraws the five-hour and weekly limits above the prompt with reset times and even-pace markers, in the terminal and the desktop Code tab.context-metermidudevDraws how full the context window is at the right end of the band above the prompt: gray, then yellow from 50 percent, then red from 75.sub-metermidudevDraws your 5-hour and weekly subscription usage at the bottom right, on the permission mode's line, with a bar and the time until it resets.token-metermidudevEnds the hint line under the prompt with the last turn's input, output, and cache tokens, and the session's running total, in color.use-haikumidudevRuns a prompt that starts with _ on Haiku, subagents included, and shows it as you type, while it runs, and under the answer.agent-usage-guardrbartoliHolds a commandAsks before a subagent starts, a heavy prompt is sent, or a tool loop runs on, from the 5-hour and weekly usage, and refuses when nobody can answer.optim-jevOqura-aiHas TypeSafe's Jev drop stale tool calls and their output when the session compacts, keeping the rest word for word, and draws a dashboard above the prompt.secondwindorchetronCompresses Bash output of 512 bytes or more through the local secondwind binary, keeps the full text one call away, and draws a pane of the net tokens saved.session-hudbradtraversyDraws a strip above the prompt with the git branch, warned on main, context used against a target you set, and weekly usage, and a Details pane of the rest.time-blamekaranb192Splits each turn's time between Claude, each tool, your approvals, and the rest, under the answer, and /blame opens a panel of the whole session's split.subagent-tunerKruhlikauHolds a commandPicks each subagent's model and effort by asking you in a pane, from a recommendation for the task, or from your saved default, with a band above the prompt.cockpitdrkokorevHolds a commandOpens a panel beside the transcript with context, rate limits, cost, subagents, tool calls, changed files, and tests, and asks before rm -rf or a force push.
All 183 in Usage