SLOPSHOPPER

prompt-status

Two-line status above the prompt: model, directory, git branch, context fill and rate-limit usage

bandprocesstimer
★ 1v0.1.4MITupdated 2026-10-17matr1xp/local-mods/prompt-status
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · prompt-status
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM [Claude] │ app Context ▎░░·░░░░░░ 49% │ Usage ███░░░░░░░ 31% ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts

Draws

Band
[Claude] │ app Context ▎░░·░░░░░░ 49% │ Usage ███░░░░░░░ 31%
README

local-mods

A personal Claude Code plugin marketplace: terminal UI mods (a status band above the prompt and two side panes) and a plugin of skills shared across machines.

PluginWhat it addsCommand
prompt-statusA two-line band above the prompt: model and context window, current directory, git branch, context fill and rate-limit usage—
token-usageA pane with context fill, session token totals, cost and rate limits/token-usage
git-changesA pane listing the files changed in the working tree, with colored git diff stats/changes
my-skillsPersonal skills shared across machines/my-skills:<skill>

Install

/plugin marketplace add matr1xp/local-mods
/plugin install prompt-status@local-mods
/plugin install token-usage@local-mods
/plugin install git-changes@local-mods
/plugin install my-skills@local-mods

Plugins

prompt-status

Renders above the prompt in every session:

The prompt-status band: model and context window, directory and git branch on the first line; context fill and five-hour usage bars with the reset time on the second

  • The model name comes from the latest main-agent request, falling back to the model setting.
  • In the terminal the context bar is animated in the token-usage pane's greens, on one row: bright bands flow along the fill toward a flickering leading edge. Elsewhere it is a plain text bar.
  • Usage shows the five-hour rate limit when it is reported, otherwise the fullest limit.
  • The git branch and dirty marker (*) refresh after each turn and once a minute. A detached HEAD shows its short commit hash.
  • The band hides itself while a survey is showing.

token-usage

Opens a pane at session start. Run /token-usage to reopen it. The pane shows:

The token-usage pane: a context fill bar at 11% of a 1M window, session input, output and cache totals with the request count and cost, and the model and token counts of the last request

  • Context: fill bar, percentage and tokens used out of the window. In the terminal the bar is an animated green flame that grows taller and deeper green as the context fills (adapted from burn-meter); elsewhere it is a plain text bar.
  • Session: input, output, cache read and cache write tokens, the request count with subagent requests counted separately, and cost. The cost rolls up to each new reading like an odometer.
  • Last request: model and token counts for the most recent request.
  • Rate limits: the 5h, 7d and spend limits with reset times. Each bar turns yellow at 60% and red at 85%.

Running /clear resets the session totals.

git-changes

Opens a pane in interactive sessions. Run /changes to reopen it and print a summary. The pane lists every file that differs from HEAD, whether staged, unstaged or untracked:

The git-changes pane on branch master: 3 files changed, +3 -4; a modified README.md marked as just changed with its diff counts and stat bar, and two untracked PNG files shown as bin

  • A status letter for each file (M, A, D, R, ??, …), +added / -deleted counts and a git --stat-style bar. Binary files show bin.
  • A ● marker on files whose stats changed since the previous scan.
  • Click a file, or focus it and press Enter, to see its diff against HEAD in the pane, deleted and untracked files included. It reloads as the file changes. Press b or ← Back to return to the list.
  • The pane rescans after Edit, Write, NotebookEdit and Bash tool calls, and every 4 seconds while it is on screen. Press r to refresh by hand.
  • Git runs with GIT_OPTIONAL_LOCKS=0, so polling never holds index.lock while you run your own git commands.
  • Only the first 40 untracked files get line counts. The rest show as new.

my-skills

A home for personal skills, so they install on every machine like the other plugins. Each skill is a folder under my-skills/skills/ with a SKILL.md, and is invoked as /my-skills:<skill>. Claude also loads a skill on its own when a request matches its description.

To add a skill, copy my-skills/skills/example/ to my-skills/skills/<name>/, set name in the frontmatter to match the folder, and rewrite the description and body.

Layout

.claude-plugin/marketplace.json   marketplace manifest listing the plugins
<plugin>/
  .claude-plugin/plugin.json      name, version, description
  hooks/hooks.json                points at the hooks module
  hooks/register.tsx              the mod: event hooks and UI rendering
  types/index.d.ts                shapes of the state each mod stores
  tests/*.test.ts(x)              tests using claude-code/testing

Development

Run a plugin's tests, then validate the marketplace:

claude plugin test git-changes
claude plugin validate .

After changing a plugin, bump version in its .claude-plugin/plugin.json so other machines pick up the update with claude plugin update <plugin>@local-mods.

License

MIT. The software is provided as is, without warranty of any kind, and the author is not liable for any damage arising from its use.

Source 3 files
hooks/register.tsx 267 lines
1import { atom, read, update } from 'claude-code'
2import type { EngineInterface, Register, SessionRateLimit } from 'claude-code'
3
4import type { Git, Limit, Reading } from '../types'
5import { flowCells, tween } from './fire'
6
7const BAR_WIDTH = 10
8const TICK_MS = 60_000
9
10const COLOR = {
11  model: 'cyan',
12  dir: 'yellow',
13  git: 'magenta',
14  separator: 'gray',
15  label: 'gray',
16  context: 'green',
17  usage: 'magenta',
18  reset: 'gray',
19} as const
20
21const EMPTY: Reading = { model: null, contextWindow: null, contextPercent: null, limit: null }
22
23const reading = atom({ plugin: 'prompt-status', key: 'reading' } as const, EMPTY)
24const git = atom({ plugin: 'prompt-status', key: 'git' } as const, null)
25const now = atom({ plugin: 'prompt-status', key: 'now' } as const, 0)
26// The context fill the flame draws while it eases toward the reading.
27const shown = atom({ plugin: 'prompt-status', key: 'shown' } as const, 0)
28
29let tweenTimer: { cancel: () => void } | null = null
30let fireTimer: { cancel: () => void } | null = null
31let bandId: string | null = null
32
33/** Eases `shown` toward the context reading, 20 frames a second, and stops once it lands. */
34const startTween = ($: EngineInterface) => {
35  if (tweenTimer) return
36  const timer = $.clock.every(50, () => {
37    void Promise.all([read($, shown), read($, reading)]).then(async ([s, r]) => {
38      const target = r.contextPercent ?? 0
39      if (s === target) {
40        timer.cancel()
41        if (tweenTimer === timer) tweenTimer = null
42        return
43      }
44      await update($, shown, x => tween(x, target))
45    })
46  })
47  tweenTimer = timer
48}
49
50/** Animates the context bar while the band is mounted; stops once a blit is refused. */
51const startFire = ($: EngineInterface) => {
52  if (fireTimer) return
53  const timer = $.clock.every(80, () => {
54    if (!bandId) return
55    void Promise.all([read($, shown), $.clock.now()]).then(([s, ms]) =>
56      $.ui
57        .blit({ requestId: bandId!, key: 'fire', cells: flowCells(BAR_WIDTH, s, ms / 1000) })
58        .then(r => {
59          if (r.deny && fireTimer === timer) {
60            timer.cancel()
61            fireTimer = null
62          }
63        }),
64    )
65  })
66  fireTimer = timer
67}
68
69const FAMILIES = ['opus', 'sonnet', 'haiku', 'fable']
70
71const capitalize = (s: string): string => s.charAt(0).toUpperCase() + s.slice(1)
72
73/** `claude-opus-5-5` → `Opus 5.5`; an alias such as `opus[1m]` → `Opus`. */
74export const modelName = (model: string): string => {
75  const id = model.match(/claude-([a-z]+)-(\d+)(?:-(\d{1,2}))?(?!\d)/)
76  if (id?.[1] && id[2]) return `${capitalize(id[1])} ${id[2]}${id[3] ? `.${id[3]}` : ''}`
77  const alias = model.toLowerCase().match(/^([a-z]+)/)?.[1]
78  if (alias && FAMILIES.includes(alias)) return capitalize(alias)
79  return model
80}
81
82/** 1_000_000 → `1M`, 200_000 → `200k`. */
83export const windowName = (tokens: number): string =>
84  tokens >= 1_000_000
85    ? `${+(tokens / 1_000_000).toFixed(1)}M`
86    : `${Math.round(tokens / 1_000)}k`
87
88/** Minutes until `resetsAt`: `36m`, `2h 5m`, `3d`; empty when unknown or past. */
89export const untilReset = (resetsAt: string | undefined, nowMs: number): string => {
90  if (!resetsAt) return ''
91  const at = Date.parse(resetsAt)
92  if (Number.isNaN(at)) return ''
93  const minutes = Math.ceil((at - nowMs) / 60_000)
94  if (minutes <= 0) return ''
95  if (minutes < 60) return `${minutes}m`
96  if (minutes < 24 * 60) return `${Math.floor(minutes / 60)}h ${minutes % 60}m`
97  return `${Math.round(minutes / (24 * 60))}d`
98}
99
100/** The five-hour window when reported, otherwise the fullest one. */
101const pickLimit = (limits: readonly SessionRateLimit[]): Limit | null => {
102  const chosen =
103    limits.find(l => l.kind === 'five_hour') ??
104    [...limits].sort((a, b) => b.percentUsed - a.percentUsed)[0]
105  return chosen ? { percentUsed: chosen.percentUsed, resetsAt: chosen.resetsAt } : null
106}
107
108const cells = (percent: number): number =>
109  Math.round((Math.min(100, Math.max(0, percent)) / 100) * BAR_WIDTH)
110
111/** Parses `git status --porcelain=v2 --branch`. */
112export const parseStatus = (stdout: string): Omit<Git, 'dir'> => {
113  let branch: string | null = null
114  let oid: string | null = null
115  let isDirty = false
116  for (const line of stdout.split('\n')) {
117    if (line.startsWith('# branch.head ')) branch = line.slice('# branch.head '.length)
118    else if (line.startsWith('# branch.oid ')) oid = line.slice('# branch.oid '.length)
119    else if (line.length > 0 && !line.startsWith('#')) isDirty = true
120  }
121  if (branch === '(detached)') branch = oid && oid !== '(initial)' ? oid.slice(0, 7) : 'HEAD'
122  return { branch, isDirty }
123}
124
125const refresh = async ($: EngineInterface): Promise<void> => {
126  const cwd = await $.session.cwd()
127  const dir = cwd.split('/').filter(Boolean).pop() ?? cwd
128  let next: Git = { dir, branch: null, isDirty: false }
129  try {
130    const status = await $.process.run(['git', 'status', '--porcelain=v2', '--branch'], {
131      cwd,
132      timeoutMs: 5_000,
133    })
134    if (status.exitCode === 0) next = { dir, ...parseStatus(status.stdout) }
135  } catch {
136    // git missing or too slow: show the directory alone
137  }
138  const nowMs = await $.clock.now()
139  await update($, git, () => next)
140  await update($, now, () => nowMs)
141}
142
143export const register: Register = on => {
144  on('session.start', async ($, e, next) => {
145    const [usage, settings] = await Promise.all([$.session.usage(), $.settings.read()])
146    const model = typeof settings.model === 'string' ? settings.model : null
147    await update($, reading, r => ({
148      model: r.model ?? model,
149      contextWindow: usage.context.window,
150      contextPercent: usage.context.percent ?? null,
151      limit: pickLimit(usage.rateLimits),
152    }))
153    startTween($)
154    await refresh($)
155    $.clock.every(TICK_MS, () => refresh($))
156
157    return next(e)
158  })
159
160  on('turn.step', async function* ($, e, next) {
161    if (e.agentId === undefined) {
162      await update($, reading, r => (r.model === e.model ? r : { ...r, model: e.model }))
163    }
164
165    return yield* next(e)
166  })
167
168  on('session.measure', async ($, e, next) => {
169    await update($, reading, r => ({
170      ...r,
171      contextWindow: e.context.window,
172      contextPercent: e.context.percent ?? r.contextPercent,
173      limit: pickLimit(e.rateLimits) ?? r.limit,
174    }))
175    const nowMs = await $.clock.now()
176    await update($, now, () => nowMs)
177    startTween($)
178
179    return next(e)
180  })
181
182  on('turn.complete', async ($, e, next) => {
183    await refresh($)
184
185    return next(e)
186  })
187
188  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
189    if (e.props.hasSurvey) return next(e)
190
191    const elements = $.ui.resolve(e)
192    const { Box, Text } = elements
193    const Raster = 'Raster' in elements ? elements.Raster : null
194    const r = await read($, reading)
195    const g = await read($, git)
196    const nowMs = await read($, now)
197
198    const window = r.contextWindow ? ` (${windowName(r.contextWindow)} context)` : ''
199    const model = r.model ? `${modelName(r.model)}${window}` : 'Claude'
200    const sep = <Text color={COLOR.separator}> │ </Text>
201
202    const contextPercent = r.contextPercent === null ? null : Math.round(r.contextPercent)
203    const usagePercent = r.limit === null ? null : Math.round(r.limit.percentUsed)
204    const reset = r.limit ? untilReset(r.limit.resetsAt, nowMs || (await $.clock.now())) : ''
205    const isBurning = Raster !== null && e.surface === 'terminal' && contextPercent !== null
206
207    if (isBurning) {
208      bandId = e.requestId
209      startFire($)
210    }
211    const flame =
212      Raster !== null && isBurning ? (
213        <Raster
214          key="fire"
215          columns={BAR_WIDTH}
216          rows={1}
217          cells={flowCells(BAR_WIDTH, await read($, shown), (await $.clock.now()) / 1000)}
218        />
219      ) : null
220
221    const bar = (percent: number, color: string) => (
222      <Box>
223        <Text color={color}>{'█'.repeat(cells(percent))}</Text>
224        <Text color={color} dimColor>
225          {'░'.repeat(BAR_WIDTH - cells(percent))}
226        </Text>
227      </Box>
228    )
229
230    return (
231      <Box flexDirection="column">
232        <Box>
233          <Text color={COLOR.model}>[{model}]</Text>
234          {g && sep}
235          {g && <Text color={COLOR.dir}>{g.dir}</Text>}
236          {g?.branch && (
237            <Text color={COLOR.git}>
238              {' '}git:({g.branch}
239              {g.isDirty ? '*' : ''})
240            </Text>
241          )}
242        </Box>
243        <Box>
244          <Text color={COLOR.label}>Context </Text>
245          {contextPercent === null ? (
246            <Text color={COLOR.label}>–</Text>
247          ) : (
248            <Box>
249              {flame ?? bar(contextPercent, COLOR.context)}
250              <Text color={COLOR.context}> {contextPercent}%</Text>
251            </Box>
252          )}
253          {usagePercent !== null && sep}
254          {usagePercent !== null && (
255            <Box>
256              <Text color={COLOR.label}>Usage </Text>
257              {bar(usagePercent, COLOR.usage)}
258              <Text color={COLOR.usage}> {usagePercent}%</Text>
259              {reset && <Text color={COLOR.reset}> (resets in {reset})</Text>}
260            </Box>
261          )}
262        </Box>
263      </Box>
264    )
265  })
266}
267
hooks/fire.ts 142 lines
1// The animated context bar as Raster cells, a tall flame or a one-row flow,
2// plus the odometer easing. Adapted from burn-meter (OneWave-AI/claude-code-mods,
3// MIT). The same file lives in token-usage and prompt-status: keep them identical.
4
5export const FIRE_ROWS = 3
6
7const DEFAULT = 0x01000000
8const MOSS = 0x7fa88a
9const LIME = 0xbef264
10const GREEN = 0x4ade80
11const EMERALD = 0x16a34a
12const PINE = 0x0b5d2e
13const MINT = 0xecfdf3
14const EMPTY = 0x232a25
15
16// ' ▁▂▃▄▅▆▇█' by eighths.
17const EIGHTHS = [0x20, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588]
18
19const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
20
21const toBase64 = (bytes: Uint8Array): string => {
22  let out = ''
23  for (let i = 0; i < bytes.length; i += 3) {
24    const n = ((bytes[i] ?? 0) << 16) | ((bytes[i + 1] ?? 0) << 8) | (bytes[i + 2] ?? 0)
25    out += B64[(n >> 18) & 63]! + B64[(n >> 12) & 63]!
26    out += i + 1 < bytes.length ? B64[(n >> 6) & 63]! : '='
27    out += i + 2 < bytes.length ? B64[n & 63]! : '='
28  }
29  return out
30}
31
32const mix = (a: number, b: number, t: number): number => {
33  const ch = (shift: number) =>
34    Math.round(((a >> shift) & 0xff) * (1 - t) + ((b >> shift) & 0xff) * t)
35  return (ch(16) << 16) | (ch(8) << 8) | ch(0)
36}
37
38/** Moss, then green, then emerald as `heat` goes 0..1. */
39const flame = (heat: number) =>
40  heat < 0.5 ? mix(MOSS, GREEN, heat * 2) : mix(GREEN, EMERALD, (heat - 0.5) * 2)
41
42/** Mint base, lime, green, deeper green tips, at height `y` 0..1 inside a flame. */
43const flameAt = (y: number, heat: number) => {
44  const tip = mix(EMERALD, PINE, Math.min(1, 0.3 + heat))
45  if (y < 0.25) return mix(MINT, LIME, y * 4)
46  if (y < 0.6) return mix(LIME, GREEN, (y - 0.25) / 0.35)
47  return mix(GREEN, tip, (y - 0.6) / 0.4)
48}
49
50/** Cheap smooth noise from two beating sines, 0..1. */
51const wobble = (x: number, t: number) =>
52  0.5 + 0.25 * Math.sin(t * 9.1 + x * 1.7) + 0.25 * Math.sin(t * 5.3 - x * 2.9 + Math.sin(t * 2 + x))
53
54/**
55 * One frame of the context bar, `columns` wide and `rows` tall, at time `t`
56 * in seconds: the bottom row filled to `percent`, flames dancing over the
57 * filled part (tallest at the leading edge, taller and deeper green as it fills).
58 */
59export const fireCells = (columns: number, percent: number, t: number, rows = FIRE_ROWS): string => {
60  const heat = Math.min(1, Math.max(0, percent / 100))
61  const words = new Uint32Array(columns * rows * 3)
62  const filled = Math.max(1, Math.round(heat * columns))
63  const flameRows = rows - 1
64  const put = (x: number, y: number, glyph: number, fg: number) => {
65    const i = (y * columns + x) * 3
66    words[i] = glyph
67    words[i + 1] = fg
68    words[i + 2] = DEFAULT
69  }
70  for (let x = 0; x < columns; x++) {
71    for (let y = 0; y < flameRows; y++) put(x, y, 0x20, DEFAULT)
72    if (x >= filled) {
73      put(x, rows - 1, 0x2591, EMPTY) // ░
74      continue
75    }
76    const along = filled <= 1 ? 1 : x / (filled - 1)
77    const isEdge = x === filled - 1
78    put(x, rows - 1, 0x2588, isEdge && Math.floor(t * 14) % 2 === 0 ? MINT : mix(MOSS, flame(along * heat), along))
79    const lead = 1 - Math.min(1, (filled - 1 - x) / Math.max(4, filled * 0.6))
80    const height = flameRows * 8 * Math.min(1, (0.35 + 0.4 * heat + 0.45 * lead) * (0.35 + 0.9 * wobble(x, t)))
81    for (let y = 0; y < flameRows; y++) {
82      const fromBottom = flameRows - 1 - y
83      const eighths = Math.max(0, Math.min(8, Math.round(height - fromBottom * 8)))
84      if (eighths > 0) put(x, y, EIGHTHS[eighths]!, flameAt(fromBottom / flameRows + eighths / (8 * flameRows), heat))
85    }
86    // A spark off the top now and then.
87    if (height < 9 && wobble(x * 3.1, t * 1.7) > 0.86) {
88      put(x, 0, Math.floor(t * 10 + x) % 2 ? 0xb7 : 0x2a, mix(LIME, GREEN, heat))
89    }
90  }
91  return toBase64(new Uint8Array(words.buffer))
92}
93
94// '▏▎▍▌▋▊▉█' by eighths, filling from the left.
95const LEFT_EIGHTHS = [0x20, 0x258f, 0x258e, 0x258d, 0x258c, 0x258b, 0x258a, 0x2589, 0x2588]
96
97/**
98 * One frame of the context bar as a single row, `columns` wide, at time `t`
99 * in seconds: filled to `percent`, bright bands flowing along the fill toward
100 * a leading edge that licks back and forth, sparks drifting just ahead of it.
101 */
102export const flowCells = (columns: number, percent: number, t: number): string => {
103  const heat = Math.min(1, Math.max(0, percent / 100))
104  const words = new Uint32Array(columns * 3)
105  const exact = heat * columns
106  // The edge flickers by up to most of a cell, never below a sliver of fill.
107  const tip = Math.min(columns, Math.max(0.25, exact + 0.75 * (wobble(exact, t) - 0.5)))
108  const put = (x: number, glyph: number, fg: number) => {
109    words[x * 3] = glyph
110    words[x * 3 + 1] = fg
111    words[x * 3 + 2] = DEFAULT
112  }
113  for (let x = 0; x < columns; x++) {
114    const cover = Math.min(1, Math.max(0, tip - x))
115    if (cover >= 1) {
116      const along = tip <= 1 ? 1 : x / (tip - 1)
117      const base = mix(MOSS, flame(along * heat), Math.min(1, along))
118      const wave = Math.pow(0.5 + 0.5 * Math.sin(x * 0.8 - t * 6), 3)
119      const hot = Math.max(0, 1 - (tip - 1 - x) / 2)
120      put(x, 0x2588, mix(mix(base, LIME, 0.5 * wave), MINT, 0.6 * hot))
121      continue
122    }
123    const eighths = Math.round(cover * 8)
124    if (eighths > 0) {
125      put(x, LEFT_EIGHTHS[eighths]!, MINT)
126    } else if (x - tip < 3 && wobble(x * 3.1, t * 1.7) > 0.8) {
127      put(x, Math.floor(t * 10 + x) % 2 ? 0xb7 : 0x2a, mix(LIME, GREEN, heat))
128    } else {
129      put(x, 0x2591, EMPTY) // ░
130    }
131  }
132  return toBase64(new Uint8Array(words.buffer))
133}
134
135/** Steps `shown` toward `target`: an odometer that eases but always lands. */
136export const tween = (shown: number, target: number): number => {
137  const gap = target - shown
138  if (Math.abs(gap) < 0.0005) return target
139  const step = gap * 0.22
140  return shown + (Math.abs(step) < 0.0005 ? Math.sign(gap) * 0.0005 : step)
141}
142
types/index.d.ts 22 lines
1export type Limit = { percentUsed: number; resetsAt?: string }
2
3export type Reading = {
4  model: string | null
5  contextWindow: number | null
6  contextPercent: number | null
7  limit: Limit | null
8}
9
10export type Git = { dir: string; branch: string | null; isDirty: boolean }
11
12declare module 'claude-code' {
13  interface PluginState {
14    'prompt-status': {
15      reading: Reading
16      git: Git | null
17      now: number
18      shown: number
19    }
20  }
21}
22