bar
A status bar above the prompt (context, plan limits, the running turn's time and tokens), and a frame around each final answer
What it does
- Draws a band above the prompt, a pane, toasts
- Adds /bar-limit, /bar-demo, /bar-handoff, /remote
- Watches tool calls and can refuse them
- Hooks session.measure, session.start, turn.complete, turn.start and 3 more
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- Handles errors
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like bar by Yasser Altamimi (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/altamimiyasser-bar/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Svg, Button } = $.ui.resolve(e)
const clockTime = '…'
const shortCount = '…'
const shortCount2 = '…'
const shortCount3 = '…'
const shortCount4 = '…'
const shortCount5 = '…'
const tools = '…'
const hruleSvg = '…'
const HANDOFF_LABELS = '…'
const shortCount6 = '…'
const shortCount7 = '…'
const ratio = '…'
const limitWords = '…'
const WINDOW_NAMES = '…'
const percent = '…'
const share = '…'
const longDate = '…'
const until = '…'
const WINDOW_NAMES2 = '…'
const percent2 = '…'
const share2 = '…'
const longDate2 = '…'
const until2 = '…'
const WINDOW_NAMES3 = '…'
const percent3 = '…'
const share3 = '…'
const longDate3 = '…'
const until3 = '…'
return (
<Box flexDirection="column" rowGap={1}>
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" columnGap={1} minHeight={1} paddingRight={0}>
capacity
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
Prompt cache
</Text>
<Text dimColor>
{" · "}
1 hour
{" from the last response"}
{" · "}
</Text>
<Text>
<Text>
{`expires at ${clockTime}`}
</Text>
<Text dimColor>
{" · "}
then
{" the next message writes "}
{shortCount}
{" tokens again"}
</Text>
</Text>
</Text>
</Box>
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
This turn so far
</Text>
<Text dimColor>
{" · "}
</Text>
{shortCount2}
<Text dimColor>
{" in"}
{" · "}
</Text>
{shortCount3}
<Text dimColor>
{" out"}
{" · "}
</Text>
{shortCount4}
<Text dimColor>
{" cache read"}
{" · "}
</Text>
{shortCount5}
<Text dimColor>
{" cache write"}
</Text>
<Text dimColor>
{" · "}
{tools}
{" tool "}
call
</Text>
</Text>
</Box>
</Box>
<Box flexDirection="column" alignItems="stretch" marginY={0}>
<Svg source={`${hruleSvg}`} alt="—" height={1} />
</Box>
<Box flexDirection="row" alignItems="center" columnGap={1} minHeight={1}>
now
<Button label={`${HANDOFF_LABELS}`} variant="primary" />
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
Context window
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
{shortCount6}
{" of "}
{shortCount7}
{" tokens ("}
{ratio}
%)
</Text>
<Text dimColor>
{" · "}
{limitWords}
{" · click Context for /usage"}
</Text>
</Text>
</Box>
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
{WINDOW_NAMES}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
{percent}
% used
</Text>
<Text>
<Text dimColor>
{" · "}
{share}
% of the window passed
{" · "}
resets
{" "}
</Text>
{longDate}
<Text dimColor>
{" "}
{"(in "}
{until}
)
</Text>
</Text>
<Text color="error">
{" · "}
on pace to run out first
</Text>
</Text>
</Box>
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
{WINDOW_NAMES2}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
{percent2}
% used
</Text>
<Text>
<Text dimColor>
{" · "}
{share2}
% of the window passed
{" · "}
resets
{" "}
</Text>
{longDate2}
<Text dimColor>
{" "}
{"(in "}
{until2}
)
</Text>
</Text>
<Text color="error">
{" · "}
on pace to run out first
</Text>
</Text>
</Box>
<Box position="absolute" top={0} bottom={0} left={0} right={0} overflow="hidden" display="none" flexDirection="row" alignItems="center" backgroundColor="userMessageBackground">
<Text wrap="truncate-end">
<Text bold>
{WINDOW_NAMES3}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
{percent3}
% used
</Text>
<Text>
<Text dimColor>
{" · "}
{share3}
% of the window passed
{" · "}
resets
{" "}
</Text>
{longDate3}
<Text dimColor>
{" "}
{"(in "}
{until3}
)
</Text>
</Text>
<Text color="error">
{" · "}
on pace to run out first
</Text>
</Text>
</Box>
</Box>
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Tool calls" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Code } = $.ui.resolve(e)
const length = '…'
const tool = '…'
const summary = '…'
const clockTime = '…'
const status = '…'
const input = '…'
const summary2 = '…'
const clockTime2 = '…'
const status2 = '…'
const summary3 = '…'
const clockTime3 = '…'
const status3 = '…'
return (
<Box flexDirection="column">
<Text dimColor>
{length}
{" "}
call
{" · click one for its input and output"}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" columnGap={1} height={1} overflow="hidden">
<Text>
●
</Text>
<Button label={`▾ ${tool}`} plain />
<Box flexGrow={1} flexShrink={1} overflow="hidden">
<Text dimColor wrap="truncate-end">
{summary}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
running
</Text>
</Box>
</Box>
<Box flexDirection="column" paddingLeft={2} marginBottom={1}>
<Text dimColor>
{clockTime}
{" · "}
{status}
</Text>
<Text bold>
Input
</Text>
<Code source={`${input}`} language="json" />
<Text bold>
Output
</Text>
<Text dimColor>
Still running
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" columnGap={1} height={1} overflow="hidden">
<Text>
●
</Text>
<Button label={`▾ ${tool}`} plain />
<Box flexGrow={1} flexShrink={1} overflow="hidden">
<Text dimColor wrap="truncate-end">
{summary2}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
running
</Text>
</Box>
</Box>
<Box flexDirection="column" paddingLeft={2} marginBottom={1}>
<Text dimColor>
{clockTime2}
{" · "}
{status2}
</Text>
<Text bold>
Input
</Text>
<Code source={`${input}`} language="json" />
<Text bold>
Output
</Text>
<Text dimColor>
Still running
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" columnGap={1} height={1} overflow="hidden">
<Text>
●
</Text>
<Button label={`▾ ${tool}`} plain />
<Box flexGrow={1} flexShrink={1} overflow="hidden">
<Text dimColor wrap="truncate-end">
{summary3}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
running
</Text>
</Box>
</Box>
<Box flexDirection="column" paddingLeft={2} marginBottom={1}>
<Text dimColor>
{clockTime3}
{" · "}
{status3}
</Text>
<Text bold>
Input
</Text>
<Code source={`${input}`} language="json" />
<Text bold>
Output
</Text>
<Text dimColor>
Still running
</Text>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Bar settings: the file has an error; keeping the last good settings`)
await $.ui.toast(`Hand off needs /mattpocock-skills:handoff: install mattpocock-skills@mattpocock`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugins/bar/hooks/band.tsx lines 350–509 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const s: BarSettings = (await read($, settingsAtom)) ?? DEFAULTS
if (e.props.hasSurvey || !s.bar.enabled) {
return next(e)
}
// What other mods draw here (cards, notices) stays, above the bar.
const below = await next(e)
const { Box, Text, Button } = $.ui.resolve(e)
// The app surfaces draw SVG; the terminal has none and draws text instead.
const Svg = e.surface === 'terminal' ? null : $.ui.resolve(e).Svg
const level = (ratio: number) => colorFor(ratio, s.levels)
const current = await read($, fill)
const allTurns = await read($, turnList)
const running = allTurns.findLast(turn => turn.endedAt === null)
const lastDone = running ? undefined : allTurns.findLast(turn => turn.endedAt !== null)
// While a turn runs the turn hooks ask for a redraw each second; the time
// and tally are read here, at drawing, so they are current whenever it lands.
const now = await $.clock.now()
const elapsed = running ? now - running.startedAt : 0
const liveTurn = running ? liveSnapshot() : null
const window = current?.window ?? null
const compact = await read($, compactAtom)
const cache = s.cache.enabled ? await read($, cacheAtom) : null
const handoff = await read($, handoffAtom)
const live: BarData = {
tokens: current?.tokens ?? 0,
limit: contextLimit(s.context.limit, window, compact),
limits: await read($, limits),
}
// One panel, two rows: row 1 is capacity (context, the 5-hour and weekly
// windows), row 2 is right now (the turn, its tools, the prompt cache and
// Hand off). Every gauge is the same line meter. Hovering an item shows
// its detail laid over the other row, so nothing moves and the row under
// the pointer stays usable. A terminal draws a border as three rows, so
// there the panel goes borderless and the drawings become line glyphs.
const isFramed = e.surface !== 'terminal'
const hasHover = s.bar.hover
// A detail, laid over a row while its item is hovered: the same height,
// on a solid background. (The band clips anything drawn outside it, and
// growing it makes it jump.)
const overlay = (scope: string, content: ReturnType<typeof Text>) => (
<Box
key={`${scope}-detail`}
position="absolute"
top={0}
bottom={0}
left={0}
right={0}
overflow="hidden"
display="none"
hover={{ scope, display: 'flex' }}
flexDirection="row"
alignItems="center"
backgroundColor="userMessageBackground"
>
{content}
</Box>
)
const link = (key: string, label: string, onPress: () => unknown, dim = false) => (
<Button
key={key}
label={label}
plain
{...(dim ? { dimColor: true } : {})}
{...(hasHover ? { hover: { scope: `bar-link-${key}`, underline: true } } : {})}
onPress={onPress}
/>
)
// An item of a row; its key is the hover scope its detail answers to.
const segment = (scope: string, grow: boolean, content: RenderChildren[]) => (
<Box
key={scope}
flexDirection="row"
alignItems="center"
columnGap={1}
flexGrow={grow ? 1 : 0}
flexShrink={grow ? 1 : 0}
// A growing item gives up its room to the fixed ones, down to nothing,
// instead of pushing the row past the edge.
{...(grow ? { minWidth: 0, overflow: 'hidden' as const } : {})}
{...(hasHover ? { hover: { scope } } : {})}
>
{content}
</Box>
)
// The hairline between items. It never shrinks: when the row is short of
// room the context meter gives way, and a shrinking hairline rounded
// down to nothing.
const rule = (key: string) => (
<Box key={key} flexShrink={0}>
{Svg ? (
<Svg source={ruleSvg()} alt="│" width={1} height={16} />
) : (
<Text dimColor>│</Text>
)}
</Box>
)
// The context meter fills the room between its label and its figures, so
// the figures always show. The app draws it as one stretching SVG line
// (meter.ts). The terminal splits its room between two glyph runs by
// ratio, the used part in the level's colour and the rest a dim track, so
// the meter stays true at any width.
const contextMeter = (ratio: number) => {
if (Svg) {
return (
<Box
key="context-meter"
flexDirection="column"
justifyContent="center"
alignItems="stretch"
flexGrow={1}
flexShrink={1}
minWidth={0}
height={1}
marginX={1}
>
<Svg
source={meterSvg(ratio, level(ratio), { ticks: [s.levels.yellow, s.levels.orange, s.levels.red] })}
alt={`${Math.round(ratio * 100)}% of the context used`}
height={METER_HEIGHT}
/>
</Box>
)
}
const used = Math.round(Math.min(Math.max(ratio, 0), 1) * METER_STEPS)
const run = '━'.repeat(METER_GLYPHS)
const part = (key: string, grow: number, dim: boolean) => (
<Box key={key} flexGrow={grow} flexShrink={1} width={0} minWidth={0} height={1} overflow="hidden">
<Text color={level(ratio)} dimColor={dim}>
{run}
</Text>
</Box>
)
return (
<Box key="context-meter" flexDirection="row" flexGrow={1} flexShrink={1} minWidth={0} height={1} overflow="hidden" marginX={1}>
{used > 0 && part('context-used', used, false)}
{used < METER_STEPS && part('context-rest', METER_STEPS - used, true)}
</Box>
)
}
// A plan window's short meter, with a "now" mark at how much of the
// window has passed: fill beyond it means usage is ahead of the clock.
const windowMeter = (key: string, ratio: number, cursor: number | null) => {
if (Svg) {
return (
<Box key={key} flexShrink={0}>
<Svg
source={meterSvg(ratio, level(ratio), { cursor, pad: 5 })}plugins/bar/hooks/tools.tsx lines 24–86 · Pane
on('ui.render', { component: 'Pane', requestId: TOOLS_PANEL }, async ($, e) => {
const { Box, Text, Button, Code } = $.ui.resolve(e)
const list = await read($, calls)
const open = new Set(await read($, openCalls))
if (list.length === 0) {
return <Text dimColor>No tool calls in this turn yet.</Text>
}
const bind = oneClick(TOOLS_PANEL)
const toggle = (id: string) =>
update($, openCalls, ids => (ids.includes(id) ? ids.filter(other => other !== id) : [...ids, id]))
return (
<Box flexDirection="column">
<Text dimColor>
{list.length} {list.length === 1 ? 'call' : 'calls'} · click one for its input and output
</Text>
{list.map((call, index) => {
const isOpen = open.has(call.id)
const scope = `bar-call-${index}`
return (
<Box key={call.id} flexDirection="column" marginTop={index === 0 ? 1 : 0}>
<Box flexDirection="row" columnGap={1} height={1} overflow="hidden">
<Text color={STATUS_COLORS[call.status]}>●</Text>
<Button
key={`call-${call.id}`}
label={`${isOpen ? '▾' : '▸'} ${call.tool}`}
plain
hover={{ scope, underline: true }}
onPress={bind(`call-${call.id}`, () => toggle(call.id))}
/>
<Box flexGrow={1} flexShrink={1} overflow="hidden">
<Text dimColor wrap="truncate-end">
{call.summary}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>{call.ms === null ? 'running' : duration(call.ms)}</Text>
</Box>
</Box>
{isOpen && (
<Box flexDirection="column" paddingLeft={2} marginBottom={1}>
<Text dimColor>
{clockTime(call.startedAt)} · {call.status}
</Text>
<Text bold>Input</Text>
<Code source={call.input} language="json" />
<Text bold>Output</Text>
{call.output === null ? (
<Text dimColor>Still running</Text>
) : (
<Code source={call.output || '(empty)'} />
)}
</Box>
)}
</Box>
)
})}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Yasser Altamimi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
runs programswrites filesenv varsdrives Claudetool calls
The design, read from code
Light useOutputStill runningLight useOutputStill runningLight useOutputStill runningDrawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit 9256d6d5226a on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugins/bar/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.10 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).plugins/bar/hooks/cache.tsx:58 tail (not on Windows); plugins/bar/hooks/cache.tsx:140 mkdir (not on Windows); plugins/bar/hooks/cache.tsx:164 mkdir (not on Windows); plugins/bar/hooks/cache.tsx:168 open (not on Windows); plugins/bar/hooks/cache.tsx:204 rm (not on Windows) |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.plugins/bar/hooks/band.tsx:217 sh (a shell or interpreter); plugins/bar/hooks/cache.tsx:28 sh (a shell or interpreter); plugins/bar/hooks/cache.tsx:135 sh (a shell or interpreter); plugins/bar/hooks/remote.tsx:98 sh (a shell or interpreter); plugins/bar/hooks/remote.tsx:276 sh (a shell or interpreter) |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add AltamimiYasser/claude-code-bar/plugin install bar@claude-code-barThis installs the marketplace's latest commit, which may not be the one read here (9256d6d5226a). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "altamimiyasser-bar" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…⏱ time machine onHeatproject · Heat3 Claude turns since 2h 10m · size: lines changedUndo these 3Undo these 3Undo these 3↑ Up bOpen in browser oTime machine██Edit██Edit██Edit…and 3 moreWritesrc/app.ts×No closed Claude turn changed it in this window.EditEditEdit[Open the interactive map](src/app.ts)
-
slop Edit1 of 3accepteditrejectAsk Claude…
-
Ask Claude…Fix loginRemoveCopy markdownacme/app · mainCopy linkCopy markdownbuild2h 10mbuild2h 10mbuild2h 10mHosted on uploads.sh, not committed to the repo.They will appear in a comment on the pull request once opened.
-
What it does
- Draws a band above the prompt, a pane
- Adds /progress
- Watches tool calls and can refuse them
- Hooks classic.SessionStart, prompt.compose, prompt.submit, session.start and 2 more
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
spending-effort-with-jev: no TypeSafe API key, so effort tips are off. Set it in /plugin.⚠ effort: long run, fuzzy spec → have Claude interview you, then go maxAsk Claude…