5-hour and weekly rate-limit gauges above the prompt, with a warning at 90%

Mods for Claude Code: small plugins that add to its screen and behavior. Each folder is one mod. Turn on the ones you want (see Setup) and change their settings in /config, under the mod's name.
Each mod works on its own, and a few work better together. notify tells you when something happens; with say it can tell you out loud, with tldr its turn summaries reuse tldr's line instead of writing their own, and with ghostty it stays quiet while you're looking at the session. In Ghostty, clicking its notification brings you back to the session's tab.
Shows how full Claude's context window is, as a colored bar above the prompt.
/context-bar hides or shows it for this session.Shows how much of your 5-hour and weekly usage limits you've used, as two small meters under the context bar. They turn yellow at 70% and red at 90%, and you get a warning inside Claude once a limit passes 90%. (notify also warns, as a desktop notification or out loud, at a threshold you set.)
Shows this session's ID in the bottom-right corner of the screen.
claude --resume <id> command.Adds a receipt to the line that closes each turn ("✻ Baked for 42s"): how many tools ran, which files were edited, the tokens used and what the turn cost.
Adds a one-sentence summary under Claude's longer replies, written by Claude Haiku.
/config sets how long a reply must be (600 characters by default).Tells you when something happens in a session: as a desktop notification, out loud through say, or both. With the ghostty mod on, it only tells you when you're away from the session (another app or tab in front), so it never interrupts you while you're watching. Without it, nothing can tell whether you're looking, so it always tells you.
/config under notify: both, banner (the desktop notification), voice (spoken by say) or off. By default the first three are both, and background tasks and check-ins are voice.voice alerts are skipped and the banners still go out.| Command | What it does |
|---|---|
/notify test | Sends a desktop notification right away. macOS can't tell a mod whether your terminal may show notifications, so this is how to check. The first time notify starts, it reminds you once. |
/notify settings | Opens the switch in System Settings: Ghostty's own entry in Ghostty, the Notifications list elsewhere. |
Gives Claude a voice, through murmur. The notify mod decides what gets said and when; say is the voice it speaks in.
/config./config under say.Everything else is one command, /say:
| Command | What it does |
|---|---|
/say | Names this session's voice and plays a short sample of it. |
/say pick | Lists every voice with its grade and switches this session to the one you pick, with a sample in it. The choice sticks to the conversation, so resuming it keeps the voice. |
/say pick <name> | Switches directly, like /say pick emma. Part of the name is enough. |
/say pick random | Switches to a random voice, other than the current one. Better-graded voices come up more often. |
/say read | Reads Claude's last reply aloud. |
/say tldr | A spoken 2–3 sentence summary of the session so far. |
/say hush | Mutes this session; run it again to unmute. |
/say help | Lists these. |
Ties Claude into the Ghostty terminal. All its settings start with "Ghostty" in /config.
/title gets a new one right away. A resumed session gets its old title back./workspace saves and reopens whole windows of sessions: see Workspaces./goto lists your open Claude sessions, the ones waiting on you first, and jumps to the one you pick. /goto next jumps straight to the one waiting longest; /goto <words> jumps to the one whose title matches./keybind add <keys> <text> makes a Ghostty key type something into Claude, like /keybind add super+ctrl+h /say hush for ⌘⌃H. /keybind lists them, and /keybind remove <keys> removes one. For ⌘⌃G to open /goto, run /keybind add super+ctrl+g /goto, or turn on Ghostty: install Claude keybinds in /config. The mod changes your Ghostty config only when you do one of these: it adds one line that loads its own claude-keybinds file.A workspace is a Ghostty window of Claude sessions you can put away and bring back later. It remembers every tab and split: each Claude session with its conversation, and each shell with its folder. Reopening it brings back the whole window, with every conversation picking up where it left off.
| Command | What it does |
|---|---|
/workspace save [name] | Saves this window. With no name, it keeps the name the window already had, or Claude Haiku picks one from the tabs. |
/workspace close [name] | Saves this window, then exits every Claude session in it and closes their tabs. Your current tab stays open at the shell, and shell tabs stay open. If another session is still working or waiting on you, it closes nothing and names them; /workspace close --force closes them anyway. |
/workspace list | Shows your saved workspaces, newest first. Press a number or Enter to reopen one, or Tab to ✕ delete to remove it. |
/workspace open <name> | Reopens a saved workspace in a new window. Part of the name is enough. |
claude --resume, so they continue their own conversation, with the tab title they had when you saved. A tab saved without a title gets a new one from its conversation. Shell tabs open at the prompt./workspace close. Pick it up tomorrow: /workspace list, then press its number.~/.claude/workspaces/, one JSON file per workspace. Saving never overwrites a different workspace that happens to have the same name: the new one gets a file of its own.Install the mods you want, one line each, at the prompt of a Claude Code session:
/plugin install context-bar --marketplace whilestevego/claude-mods
Answer y to add the marketplace, then pick a scope. The mods are context-bar, rate-limits, session-id, turn-receipt, tldr, notify, say and ghostty.
CLAUDE_CODE_PLUGIN_DIRS, separated by :, in the env block of ~/.claude/settings.json: "env": {
"CLAUDE_CODE_PLUGIN_DIRS": "/path/to/claude-mods/context-bar:/path/to/claude-mods/say"
}
To try one mod for a single session: claude --plugin-dir /path/to/claude-mods/tldr.
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 in the same env block, so Claude Code doesn't overwrite the tab title./notify test checks; /notify settings opens the page.The first time a mod controls Ghostty, macOS asks for permission. Allow it.
Editing a mod's files reloads it in running sessions. A mod newly added to CLAUDE_CODE_PLUGIN_DIRS loads only in sessions started after that.
claude plugin validate context-bar # check a mod the way Claude Code will load it
claude plugin test context-bar # run its tests
Mods can call each other through nouns on $: say adds $.voice.say({ text }), which notify speaks through, and ghostty adds $.ghostty.isFocused(), which notify asks before alerting. Their types are in each mod's types/index.d.ts.
IDEAS.md has ideas for more mods.
hooks/register.tsx 55 lines1import { atom, read, update } from 'claude-code'
2import type { EngineInterface, Register } from 'claude-code'
3
4import type { Window } from '../types'
5import { color, label, meter, resets, toWarn } from './gauge'
6
7const windows = atom({ plugin: 'rate-limits', key: 'windows' } as const, [])
8const warned = atom({ plugin: 'rate-limits', key: 'warned' } as const, [])
9
10async function store($: EngineInterface, next: readonly Window[]) {
11 await update($, windows, () => next.map(w => ({ ...w })))
12 const fresh = toWarn(next, await read($, warned))
13 if (fresh.length === 0) return
14 await update($, warned, all => [...all, ...fresh].slice(-20))
15 for (const w of next.filter(w => fresh.includes(`${w.kind}@${w.resetsAt ?? ''}`)))
16 $.ui.toast(`⚠️ ${label(w.kind)} rate limit at ${w.percentUsed}%${w.resetsAt ? `, resets ${resets(w.resetsAt, Date.now())}` : ''}`)
17}
18
19export const register: Register = on => {
20 on('session.start', async ($, e, next) => {
21 await store($, (await $.session.usage()).rateLimits)
22 return next(e)
23 })
24
25 on('session.measure', async ($, e, next) => {
26 if (e.rateLimits.length) await store($, e.rateLimits)
27 return next(e)
28 })
29
30 // Stacks under what the plugins beneath draw (the context bar); nothing off a subscription.
31 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
32 const below = await next(e)
33 const list = await read($, windows)
34 if (e.props.hasSurvey || list.length === 0) return below
35
36 const { Box, Text } = $.ui.resolve(e)
37 const now = Date.now()
38 return (
39 <Box flexDirection="column">
40 {below}
41 <Text wrap="truncate">
42 {list.map((w, i) => (
43 <Text>
44 {i > 0 && <Text dimColor> </Text>}
45 <Text dimColor>{label(w.kind)} </Text>
46 <Text color={color(w.percentUsed)}>{meter(w.percentUsed)}</Text>
47 <Text dimColor> {w.percentUsed}%{w.resetsAt ? ` ↻ ${resets(w.resetsAt, now)}` : ''}</Text>
48 </Text>
49 ))}
50 </Text>
51 </Box>
52 )
53 })
54}
55hooks/gauge.ts 33 lines1import type { Window } from '../types'
2
3export const WARN_AT = 90
4
5export function label(kind: string): string {
6 return ({ five_hour: '5h', seven_day: 'week', spend_limit: 'spend' } as Record<string, string>)[kind] ?? kind
7}
8
9export function color(percent: number): string {
10 return percent >= WARN_AT ? 'red' : percent >= 70 ? 'yellow' : 'green'
11}
12
13export function meter(percent: number, width = 10): string {
14 const filled = Math.min(width, Math.max(0, Math.round((percent / 100) * width)))
15 return '▰'.repeat(filled) + '▱'.repeat(width - filled)
16}
17
18// "3:10 PM" for a reset within a day, "Mon 9 AM" beyond that.
19export function resets(iso: string | undefined, now: number): string {
20 if (!iso) return ''
21 const at = new Date(iso)
22 const isSoon = at.getTime() - now < 24 * 3600 * 1000
23 return at.toLocaleString([], isSoon ? { hour: 'numeric', minute: '2-digit' } : { weekday: 'short', hour: 'numeric' })
24}
25
26// The window keys that just crossed WARN_AT and haven't been warned about since they last reset.
27export function toWarn(windows: readonly Window[], warned: readonly string[]): string[] {
28 return windows
29 .filter(w => w.percentUsed >= WARN_AT)
30 .map(w => `${w.kind}@${w.resetsAt ?? ''}`)
31 .filter(k => !warned.includes(k))
32}
33types/index.d.ts 8 lines1export type Window = { kind: string; percentUsed: number; resetsAt?: string }
2
3declare module 'claude-code' {
4 interface PluginState {
5 'rate-limits': { windows: Window[]; warned: string[] }
6 }
7}
8