Counts down to the prompt cache going cold, with the last request's hit rate, above the prompt.

Live panes, prompt bands, status line entries, toasts, and hooks for Claude Code, each shipped as a plugin.
/plugin marketplace add tartinerlabs/claude-code-mods
/plugin install <mod> --marketplace tartinerlabs/claude-code-mods
| | Mod | Where it shows | In one line | | :-: | --- | --- | --- | | โธ | auto-resume | Status line, toast | Picks a turn back up once a usage limit resets | | ๐ท | auto-session-name | Session title | Names each session from its first prompt and keeps the name current as the work moves on | | โฑ | cache-clock | Band above the prompt | Counts down to the prompt cache going cold | | ๐ | limit-watch | Band above the prompt, toasts | Shows the 5-hour and weekly usage limits and the session's cost | | ๐ซ | pr-pilot | Band above the prompt, toasts | Shows the branch's PR checks and merges it with /merge | | ๐ | release-notes | Band above the prompt, toast | Drafts App Store release notes for Xcode projects when the version is bumped | | ๐ฑ | resource-watch | Band above the prompt, toast | Shows which session is using each simulator, Claude Design project or the Xcode app, and messages the other session on a clash | | ๐ | smart-compact | Toast | Compacts between turns, sooner at checkpoints or when the cache is cooling | | โ
| token-weather | Band above the prompt | Forecasts how full the context window is |
When a turn stops on a usage limit, waits until the limit resets and sends continue. Typing a prompt yourself or running /auto-resume cancel stops the wait.
โธ auto-resume in 1h 12m โ status line
Usage limit reset, resuming โ toast
<sub>๐ plugins/auto-resume</sub>
Names each session from its first prompt using Haiku and can give it a prompt bar colour, so it is easy to find with claude -r after a crash. When the first prompt is short, such as continue or look at this, it titles the session again from the last four prompts on the fourth. Every eighth prompt it checks the title against the last four prompts and renames the session only when the work has moved to a different task; small shifts keep the title. Sessions already named with -n or /rename are left alone, and a rename stops any re-title. Set the color option to red, blue, green, yellow, purple, orange, pink or cyan to colour named sessions; default leaves the colour alone.
> fix the flaky retry test in the upload worker
โ session titled "Fix flaky upload retry test"
<sub>๐ plugins/auto-session-name</sub>
Draws a countdown above the prompt to when the prompt cache goes cold, with the last request's hit rate. Once cold, it shows how much the next turn re-writes. Set the ttl option to 1h when extended caching is on.
๐ฅ cache 3:42 left ยท 96% hit โ green, yellow under a minute
๐ง cache cold ยท next turn re-writes 84.3k โ red
<sub>๐ plugins/cache-clock</sub>
Draws the 5-hour and weekly usage limits above the prompt with live reset countdowns, green under 60%, yellow to 80% and red past it. Toasts once a window passes 80% and again at 95%. Any other window the API reports, such as a gateway spend limit, shows under its own name. The session's cost so far follows the limits.
๐ 5h 42% ยท 2h17m ๐
7d 81% ยท 3d4h ๐ฐ $2.36 โ band
7d limit at 81%, resets in 3d4h โ toast
<sub>๐ plugins/limit-watch</sub>
Draws the current branch's open pull request above the prompt with its checks and whether it can merge, refreshed each minute and after every turn. Toasts when a run of checks finishes. /merge merges it with gh and deletes the branch, but only once every check has passed and nothing blocks it. On a gh-stack layer the band shows its place in the stack, and /merge merges the whole stack with gh stack merge once every unmerged layer has passed its checks and has no unpushed commits, then switches to the trunk and deletes every layer's branch, local and remote, once all of them have merged. Set the method option to merge (default), squash or rebase. Needs the GitHub CLI, signed in.
๐ PR #42 โณ 3/5 checks waiting โ band
PR #42 โ 1 failing: SonarCloud blocked โ red
PR #42 โ 5/5 checks ready ยท /merge โ green
PR #42 stack 2/3 โ 5/5 checks ready ยท /merge โ a gh-stack layer
PR #42 checks passed, ready to /merge โ toast
<sub>๐ plugins/pr-pilot</sub>
In an Xcode project, draws the app's MARKETING_VERSION and build above the prompt with the commits since the last release. When a turn, or anything between sessions, changes the version, Haiku drafts App Store "What's New" notes from those commits and a toast says where they went. With fastlane they go to fastlane/metadata/<locale>/release_notes.txt for the default locale, else en-US, else the first. Without fastlane they become a ## <version> section in CHANGELOG.md, and a section that is already there is left alone. The last release is the newest tag, or the commit that set the previous version when the repository has no tags. The first time it sees a repository it only records the version. /draft-release-notes drafts the notes again, replacing what is there.
๐ v2.4.0 (41) 12 commits since v2.3.0 notes drafted โ band
Release notes for 2.4.0 drafted in fastlane/metadata/en-US/release_notes.txt โ toast
<sub>๐ plugins/release-notes</sub>
Shows which Claude Code session is using each shared thing on the machine, so parallel agents do not fight over one. Booted Apple simulators and Claude Design projects are the baseline; the Xcode app sits on top.
simctl or xcodebuild names it by UDID or name, or uses booted or an Xcode MCP run while only one is booted; commands that only look, as simctl list or xcodebuild -showdestinations, do not count.claude-design tool call on it.A hold lasts the hold option's minutes (10 by default) after the last call, and ends with the session. Sessions share their holds as files in ~/.claude/resource-watch/, labelled by their project's folder. A simulator call on one another session holds is refused the first time: the holding session is asked, and the agent is told to wait for its reply, then repeat the call to go ahead, and never to switch to or create another simulator without asking you. The holder tells the waiting sessions once it is done: after StopProject or DeviceInteractionEndSession, when its hold runs out, or when it ends. For a Claude Design project or the Xcode app nothing is refused: it toasts, messages the holding session so its agent can reply asking it to wait, and tells its own agent who holds it; a session that ends tells the sessions it shared with.
๐ฑ iPhone 18 Pro (iOS 27.2) ยท this session ๐ the Xcode app ยท โ also the web session โ band
iPhone 18 Pro is in use by the web session; asked it, waiting โ toast
<sub>๐ plugins/resource-watch</sub>
Compacts the conversation between turns, never during one, weighing several factors against the context's fill. Past the threshold option (60, 70 default, or 80%) it compacts about ten seconds after a turn ends. It compacts sooner when compacting is cheapest or most worth it:
gh pr, gh stack), had a plan approved, finished its todo list, or switched branch or worktree. The summary is told what to keep for each, such as the approved plan verbatim. A checkpoint counts only until the next turn starts. Set checkpoints to off to ignore them.Nothing takes it under the floor option (30, 40 default, or 50%), and it tries at most once per idle stretch. The ttl option defaults to auto: 1h on a subscription, 5m on an API key or cloud provider. Set it to 5m while a subscription draws on usage credits, or to 1h when you set a one-hour cache yourself.
Set continue to tasks to carry on after compacting while todos or tasks are still open. It sends Continue with the remaining tasks., unless the turn was interrupted or ended on a question.
Compacted at 52%: committed โ toast
Compacted at 55%: cache cooling โ toast
Compacted at 74%: context high, 5h limit at 86% โ toast
Compacted at 75%: context high; continuing โ toast
<sub>๐ plugins/smart-compact</sub>
Draws a forecast of the context window above the prompt, with tokens used, a sparkline of the last 12 turns and the change since the last turn.
โ
Cloudy 38% of context 76.4k / 200k last turns โโโโโโโ
โ โฒ +4.1k last turn
| ๐ Clear | โ Cloudy | โ Showers | โก Storm | ๐จ Compact soon | | :-: | :-: | :-: | :-: | :-: | | under 25% | under 50% | under 75% | under 90% | 90% and up |
<sub>๐ plugins/token-weather</sub>
MIT ยฉ Tartiner Labs
hooks/register.tsx 101 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { CacheClockReading } from '../types'
5
6const TTL_MS = { '5m': 5 * 60_000, '1h': 60 * 60_000 } as const
7
8// Held by the host, so the countdown survives a hot reload of this file.
9const last = atom({ plugin: 'cache-clock', key: 'last' } as const, null)
10
11export const register: Register = (on, options) => {
12 const ttlMs = options.ttl === '1h' ? TTL_MS['1h'] : TTL_MS['5m']
13
14 on('session.start', async ($, e, next) => {
15 const result = await next(e)
16 // Redraw the band each second so the countdown ticks.
17 $.clock.every(1000, () => $.ui.invalidate('ui.render'))
18
19 return result
20 })
21
22 on('turn.step', async function* ($, e, next) {
23 const result = yield* next(e)
24
25 // Main-loop requests only: a subagent's cache is its own.
26 if (!e.agentId && result.usage) {
27 const { cache_read_input_tokens, cache_creation_input_tokens, input_tokens, output_tokens } = result.usage
28 const reading: CacheClockReading = {
29 at: await $.clock.now(),
30 read: cache_read_input_tokens,
31 write: cache_creation_input_tokens,
32 input: input_tokens,
33 output: output_tokens,
34 }
35 await update($, last, () => reading)
36 }
37
38 return result
39 })
40
41 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
42 const reading = await read($, last)
43
44 if (e.props.hasSurvey || reading === null) {
45 return next(e)
46 }
47
48 const { Box, Text } = $.ui.resolve(e)
49 const left = reading.at + ttlMs - (await $.clock.now())
50 const full = describe(reading, left)
51 // On a narrow band keep only the state, so the row does not wrap.
52 const text = full.length <= e.props.bodyColumns - 2 ? full : full.split(' ยท ')[0]
53 // Stack above whatever the plugins beneath draw, so other bands stay.
54 const below = await next(e)
55
56 return (
57 <Box flexDirection="column">
58 <Box flexDirection="row" paddingX={1}>
59 <Text color={left <= 0 ? 'red' : left < 60_000 ? 'yellow' : 'green'} wrap="truncate-end">
60 {text}
61 </Text>
62 </Box>
63 {below}
64 </Box>
65 )
66 })
67}
68
69export function describe(reading: CacheClockReading, left: number) {
70 if (left <= 0) {
71 // The next request writes the whole prefix again.
72 const prefix = reading.read + reading.write + reading.input + reading.output
73
74 return `๐ง cache cold ยท next turn re-writes ${short(prefix)}`
75 }
76
77 const prompt = reading.read + reading.write + reading.input
78 const hit = prompt === 0 ? 0 : Math.round((reading.read / prompt) * 100)
79
80 return `๐ฅ cache ${clock(left)} left ยท ${hit}% hit`
81}
82
83function clock(ms: number) {
84 const s = Math.ceil(ms / 1000)
85 const m = Math.floor(s / 60)
86
87 return `${m}:${String(s % 60).padStart(2, '0')}`
88}
89
90function short(n: number) {
91 if (n >= 1_000_000) {
92 return `${+(n / 1_000_000).toFixed(1)}M`
93 }
94
95 if (n >= 1_000) {
96 return `${+(n / 1_000).toFixed(1)}k`
97 }
98
99 return String(n)
100}
101types/index.d.ts 8 lines1export type CacheClockReading = { at: number; read: number; write: number; input: number; output: number }
2
3declare module 'claude-code' {
4 interface PluginState {
5 'cache-clock': { last: CacheClockReading | null }
6 }
7}
8