How to install the prompt-cache-control mod to show prompt cache time left above the Claude Code prompt
prompt-cache-control is a mod that counts, for each request, the tokens read from the cache (read), newly written (wrote) and uncached (new), and shows the time left before the cache lapses in a band above the prompt. Once the cache lapses, the next message reprocesses the whole conversation, which is slower and costs more. Before that happens, the mod tells you whether to keep going, /compact or /clear. It's a community mod from the claude-code-templates repository.
- Install it in your project folder and start Claude Code.
npx claude-code-templates@latest --mod observability/prompt-cache-control
claude
- Once you accept the workspace trust prompt, it loads automatically from
.claude/skills/prompt-cache-control/. - Run
/cachefor the details. A pane opens with a time-left bar, a breakdown of the last request and a per-turn table.
The cache lasts one hour for the main conversation on a Claude subscription within its plan usage, and five minutes on an API key, usage credits or a cloud provider. To show a single line below the prompt instead of the band, add options to ~/.claude/settings.json. Options in project settings files are not read.
{ "pluginConfigs": { "prompt-cache-control@skills-dir": { "options": { "band": false, "status": true } } } }
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.