Repository navigation
cache-clock: the prompt cache, on your status line - #54
Merged
Merged
Conversation
A new mod that adds a cache line under the status line, from the prompt_cache figures Claude Code sends there: time left while warm, hit rate and misses, and how many tokens the next message re-caches once cold. /cache-clock setup wraps the existing status line; /cache-clock remove restores it. token-weather 0.2.1 hides its estimated countdown while cache-clock is set up.
- Saved state per settings file, so setups in the user settings and in projects don't overwrite each other's original status line - Local settings go in the project root, not a subfolder the session started in - Quote the config path for the shell; fail clearly without HOME - Read stdin as a stream
Owner
Author
Review notesSonnet review, addressed in 15988d8:
Codex (gpt-5.6-luna): no actionable issues found. Verified: 25 cache-clock tests and 23 token-weather tests pass, and a live setup → status line → remove round trip in a throwaway config dir works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new mod, cache-clock: a prompt-cache line under your status line, from the
prompt_cachefigures Claude Code sends to status line commands (2.1.251+).prompt_cacheappears; skips fields an older version doesn't sendHow it hooks in
Plugins can't register a status line, and
prompt_cacheisn't exposed to plugin hooks, only to the status line command./cache-clock setupcopies a small Node script to<config dir>/cache-clock/, saves the current status line, and pointsstatusLineat the script withrefreshInterval: 30. The script runs the original command with the same stdin, prints its output unchanged, then the cache line/cache-clock removerestores the settings exactlysettings.local.jsonoverride instead; managed settings are left alonetoken-weather 0.2.1
Hides its estimated countdown while cache-clock is set up, so the cache isn't shown twice.
Checked
claude plugin validateandclaude plugin testfor both mods (22 + 23 tests)prompt_cacheinputs🤖 Generated with Claude Code