Live panel of what Claude is doing: running tools with real commands and timers, what is waiting for your approval, subagents, and its current todo plan.

Panels, guardrails and quality-of-life mods for Claude Code: see what fills your context, how fast you burn your plan, and what the agent is running right now, and block the commands you never want run.
<img src="docs/demo-guardrails.gif" alt="guardrails blocking an agent's oc delete all --all before it runs" width="900">
<sub>If a mod saves you from one bad approve, a ⭐ on this repo helps other people find it.</sub>
Claude Code is a black box while it works. You can't see the context window filling up until it compacts away the decision you made an hour ago. You find out you've burned your 5-hour limit when it stops answering. You approve a command, tab away, and come back ten minutes later to find it has been waiting on a second approval the whole time. And most people discover /rewind only after the edit they wanted to undo.
claude-mods is a set of small plugins that open that box. Each mod is a standalone Claude Code plugin built on function hooks, the in-process plugin API: it sees every prompt, tool call and turn as it happens, and it can draw panels, toasts and status lines inside Claude Code itself. Install all eleven or only the ones you want.
They are deliberately boring about tokens. Nine of the eleven never call a model. The two that do (prompt-coach's review and context-keeper's handoff note) say so and are easy to turn off.
| 🧩 mod-manager | One panel (/mods) to install, turn on or off, update, or remove each mod, with presets (Safety only, Essentials, Zero tokens, Everything). Shows when a mod has a newer version. Install this first and pick the rest |
| 🚦 quickbar | One line above the prompt: live context % and a button for every claude-mods panel you have installed. Start here |
| 🧠 context-keeper | What fills your context window, tips to trim it, and checkpoints: a handoff note (goal, decisions, files, TODOs) saved to .claude/checkpoints/ so /clear and /compact stop losing the thread. Archives the raw transcript before every compaction, for zero tokens |
| 📈 usage-meter | 5-hour and 7-day plan-limit bars with reset countdown, burn rate and "full in ~2.3h", session cost, cache hit ratio (and why it's low), tokens-per-turn sparkline (drawn as charts in the desktop app) |
| 🔔 notify | Notification inbox plus native OS notifications (Windows, macOS, Linux) when a long turn ends, a subagent or background task finishes, Claude asks you something, or an approval has been waiting 15s |
| 👀 activity | What Claude is doing this second: thinking, running $ npm test for 0m42s, waiting for YOUR approval, which subagents run, and its todo plan with progress |
| 🛡️ guardrails | Clickable safety rules with presets (Safe defaults, Locked to project, Read-only review): block rm -rf, mass kubectl/oc deletes, terraform destroy, force-push, destructive git, .env and key files, sudo, installs, network; keep Claude inside the project; add your own patterns. Checks scripts the agent wrote before they run, and keeps a weekly log of what it blocked |
| ✍️ prompt-coach | Before a vague prompt is sent, a small fast model suggests a sharper one. You pick Send improved / Send mine / Edit. Never rewrites silently, never touches "yes" or "continue" |
| 🧰 toolbox | Every tool Claude can use (built-in and MCP, grouped by server) in plain language, how often each was used, and suggestions for the project you're in |
| ⌨️ command-hub | The built-in commands you're probably missing, each with when to use it; a searchable list of everything installed; a form to create your own slash command; tips when your prompt matches one ("undo that" → /rewind) |
| 📝 changes | Every file Claude created or edited this session with +/- counts from git, plus one-click why?, summarize all and self-review |
| 🔁 loop-breaker | Notices Claude going in circles (the same command failing 3×, the same code rewritten 3× in a turn), tells you, and tells Claude to stop and rethink |
activity: what Claude is running right now, and the moment it's waiting on you
<img src="docs/demo-activity.gif" alt="activity panel showing thinking, waiting for approval, then completed tool calls" width="900">
context-keeper + usage-meter: what fills the window, a checkpoint saved to disk, plan limits
<img src="docs/demo-context.gif" alt="context panel, writing a checkpoint, then the usage meter" width="900">
prompt-coach: a vague prompt, a suggested rewrite, you choose
<img src="docs/demo-coach.gif" alt="prompt coach suggesting a sharper prompt and sending it" width="900">
command-hub: the built-in commands worth knowing, explained
<img src="docs/demo-commands.gif" alt="command hub listing essential slash commands" width="900">
You ──prompt──▶ ┌──────────────────────────────┐
│ Claude Code engine │
│ │
│ prompt.submit tool.call │
│ turn.start turn.complete│
│ session.compact ui.render │
└──────┬─────────────────▲──────┘
events, in │ │ allow · deny · rewrite
order, live ▼ │ panes · toasts · status
┌──────────────────────────────┐
│ claude-mods (one plugin each)│
│ │
│ guardrails ── may deny ──────┤
│ prompt-coach ─ may ask you ──┤
│ activity · changes · notify │
│ usage-meter · context-keeper │──▶ .claude/checkpoints/
│ toolbox · command-hub ... │──▶ OS notifications
└──────────────────────────────┘
What a mod sees. Each mod registers hooks on engine events. A tool.call hook sits in front of every tool the agent runs (Bash, Edit, MCP tools, subagents) and sees its real arguments before anything executes. That is how activity can show the exact command and guardrails can refuse it.
What it can change. A hook either passes the event on, rewrites it, or answers it itself. Guardrails answers with a denial the model reads ("blocked by the user's guardrails, don't work around it"). Prompt-coach never rewrites on its own: it asks you first, in Claude Code's own question dialog.
What it draws. Panels are ui.render hooks returning a small element tree (Box, Text, Button, Input) that Claude Code draws natively in the terminal and the desktop app. State lives in the engine ($.state), so panels survive a hot reload and redraw only when their data changes.
What it costs. Nothing, for nine of the mods. They read numbers the engine already has ($.session.usage(), $.tool.list(), $.command.list()). The two model calls are opt-out and listed under Honest limits.
Prerequisites: Claude Code 2.1.286 or newer (claude update). Panels dock beside the chat in the desktop app or a terminal ≥ 144 columns wide, and open inline in narrower terminals.
From any terminal:
claude plugin marketplace add mishgoldenberg/claude-mods
claude plugin install mod-manager@claude-mods
(In the Claude Code CLI you can also use /plugin marketplace add mishgoldenberg/claude-mods and the /plugin menu.)
Restart Claude Code. The first session says hello once ("claude-mods ready: /mods to pick your set"). Type /mods: the manager lists every mod with what it does, whether it uses tokens, and whether an update is available. Install, turn on or off, update, or remove each one with a click, or apply a preset:
| Preset | What you get |
|---|---|
| Safety only | guardrails, notify |
| Essentials | guardrails, activity, notify, context-keeper, usage-meter |
| Zero tokens | every mod that never calls a model |
| Everything | all eleven |
Presets turn off what they don't list and never remove anything. Changes apply in your next session.
With quickbar installed, a one-line bar sits above the prompt: live context % and a button for every installed panel. /quickbar (or its ×) hides it; /quickbar again brings it back.
Or just ask Claude: "Install the claude-mods plugins from github.com/mishgoldenberg/claude-mods. Follow its INSTALL-FOR-CLAUDE.md."
The VS Code extension has no /plugin menu, so install from a terminal with the two commands in step 1, then use /mods inside VS Code. Mods need the extension to run Claude Code 2.1.286 or newer.
for m in quickbar context-keeper usage-meter notify activity guardrails prompt-coach toolbox command-hub changes loop-breaker; do
claude plugin install "$m@claude-mods"
done
git clone https://github.com/mishgoldenberg/claude-mods.git
claude --plugin-dir claude-mods/plugins/activity --plugin-dir claude-mods/plugins/guardrails
| Command | Mod | What it does | |||
|---|---|---|---|---|---|
/mods | mod-manager | Install, turn on or off, update, or remove mods; apply a preset | |||
/quickbar | quickbar | Show or hide the launcher above the prompt | |||
/ctx | context-keeper | Open the context panel | |||
/checkpoint | context-keeper | Save a handoff note of this session now | |||
/resume-checkpoint | context-keeper | Load the latest checkpoint into the prompt box (use after /clear) | |||
/meter | usage-meter | Open plan limits, burn rate and cost | |||
/notifications | notify | Open the notification inbox | |||
| `/mute [on\ | off]` | notify | Mute or unmute notifications | ||
/activity | activity | Open the live activity panel | |||
/guard | guardrails | Open the rules panel | |||
| `/guard-preset <safe\ | locked\ | review\ | off>` | guardrails | Apply a preset |
/guard-log [json] | guardrails | What guardrails blocked in the last 7 days | |||
| `/coach [on\ | off]` | prompt-coach | Turn the prompt coach on or off | ||
/tools | toolbox | Open the tools panel and project suggestions | |||
/cmds | command-hub | Open the command hub | |||
/new-command | command-hub | Create your own slash command | |||
/changes | changes | Open the changed-files panel |
Options appear in /config once a mod is installed, or go in ~/.claude/settings.json under pluginConfigs.<mod>.
| Option | Default | Description |
|---|---|---|
warnAt | 70 | Toast a tip when context passes this % |
checkpointAt | 85 | Write a handoff note automatically at this % (0 = off) |
| Option | Default | Description |
|---|---|---|
warnAt | 80 | Toast when a plan window passes this % (a second toast always fires at 95%) |
| Option | Default | Description |
|---|---|---|
minSeconds | 30 | Only notify for turns at least this long |
osNotify | true | Also raise a native OS notification |
approvalWaitSeconds | 15 | Ping when an approval has waited this long (-1 = off) |
| Mod | Option | Default | Description |
|---|---|---|---|
| activity | autoOpen | false | Dock the panel on session start when there is room |
| prompt-coach | enabled | true | Review prompts before sending |
| prompt-coach | model | claude-haiku-4-5 | Reviewer model; small keeps the delay near a second |
| prompt-coach | minChars | 8 | Never review prompts shorter than this |
| loop-breaker | failLimit | 3 | Same failing command this many times in a row |
| loop-breaker | editLimit | 3 | Times the same code is rewritten in one turn (separate edits to different parts of a file never count) |
| Rule | Blocks | In preset |
|---|---|---|
no-rm-rf | rm -rf, rm -fr, Remove-Item -Recurse -Force, rmdir /s | Safe · Locked |
no-mass-delete | kubectl/oc delete --all or -A, delete namespace/project, helm uninstall, terraform destroy | Safe · Locked · Review |
no-force-push | git push --force / -f (--force-with-lease allowed) | Safe · Locked |
no-history-rewrite | git reset --hard, git clean -f, git checkout -- ., branch -D, stash drop, fetch/pull --prune, remote prune | Safe · Locked |
protect-secrets | reading or writing .env*, *.pem, *.key, id_rsa, credentials files | Safe · Locked · Review |
no-sudo | sudo, su -, runas | Safe · Locked · Review |
no-installs | npm i, pip install, cargo add, brew/apt/winget install … | Review |
no-network | WebFetch, WebSearch, curl, wget, Invoke-WebRequest | — |
jail-writes | Write/Edit outside the project folder | — |
jail-all | any file tool outside the project, cd out of it | Locked |
read-only | all edits; shell limited to look-only commands | Review |
Guardrails turns on Safe defaults the first time it loads. /guard-preset off turns everything off.
Whatever the preset, while any rule is on:
Write in this session (and edits after that) is remembered, and when a shell command runs it (bash cleanup.sh, python tools/x.py, ./run, node a.mjs), its code is checked against your enabled rules and patterns first. os.system("rm -rf …") inside a Python file counts.Write/Edit on them, and the obvious shell writes (sed -i, >, tee, cp, mv, rm), are denied with the same "ask the user" message./guard-log prints a summary (/guard-log json for the raw list), and clear wipes it. Commands are cut to 200 characters.Mods run inside Claude Code with your permissions and no sandbox, so this is the right question to ask about any mod, including these. What these ones do:
git diff --numstat (changes), the claude plugin CLI when you open /mods or click in it (mod-manager; only Install, Update and Check for updates go online, through Claude Code's own plugin installer), your OS notification tool (notify), and gh --version to see whether the GitHub CLI exists (toolbox)..claude/checkpoints/ (context-keeper), and a new slash command file when you use the form (command-hub). Settings, and guardrails' 30-day block log, live in Claude Code's own plugin store under ~/.claude. Nothing else.Every mod is a few hundred lines of TypeScript in plugins/<mod>/hooks/register.tsx. Read the ones you install.
rm -rf doesn't block you, except when the text is handed to a shell (bash -c, | sh, powershell -Command), which is checked. For hard guarantees use Claude Code's permission rules and sandboxing; use guardrails to catch the honest mistakes./coach off turns it off.claude-mods/
├── .claude-plugin/
│ └── marketplace.json The marketplace: one entry per mod
├── plugins/
│ ├── activity/
│ │ ├── .claude-plugin/
│ │ │ └── plugin.json Name, description, userConfig options
│ │ ├── hooks/
│ │ │ ├── hooks.json Points at the hooks module
│ │ │ └── register.tsx The mod: hooks, commands, panel
│ │ ├── tests/
│ │ │ └── surfaces.test.tsx The panel draws on every surface (claude plugin test)
│ │ └── types/
│ │ └── index.d.ts Its $.state contract
│ ├── guardrails/ …same shape for every mod
│ └── …
├── docs/
│ └── design.md The shared design spec and kit every mod copies
├── tests/
│ ├── guardrails-rules.test.mjs Every rule against real commands
│ └── design-kit.test.mjs Every mod's kit matches docs/design.md
├── INSTALL-FOR-CLAUDE.md Steps Claude follows when asked to install
└── tsconfig.json Type-checks all mods against the engine API
Add a guardrail rule. Append an entry to RULES in plugins/guardrails/hooks/register.tsx (an id, a title, and a test that returns the offending text) and add cases to tests/guardrails-rules.test.mjs. The panel and presets pick it up automatically.
Add an essential command. One line in ESSENTIALS in plugins/command-hub/hooks/register.tsx. It only shows when that command exists in the user's Claude Code.
Write a new mod. Copy plugins/changes (a small mod with a panel) or plugins/loop-breaker (no UI), rename it everywhere, and add it to marketplace.json. Or ask Claude Code to "make a mod that …": it has a built-in skill for exactly this, with hot reload.
Issues and pull requests are welcome. Start with CONTRIBUTING.md, which has the mod checklist.
npm install
npm run typecheck
npm test
claude plugin validate plugins/<mod>
claude plugin test plugins/<mod>
Every mod follows one design spec, docs/design.md: theme colors only (Claude orange as the single accent), the same pane header, glyphs, hotkeys and empty states, so the set feels like one product in any theme.
Two house rules worth knowing before you write anything, because the validator enforces both:
$ must be top-level function declarations. A closure inside register that receives $ is rejected.$.state key is declared in the mod's types/index.d.ts, under the mod's name.Found a way around guardrails, or another security problem? Please report it privately; see SECURITY.md.
MIT © 2026 Michael Goldenberg
hooks/register.tsx 296 lines1import { atom, read, update } from 'claude-code'
2import type { ElementTable, EngineInterface, Register, RenderChildren } from 'claude-code'
3
4import type { ActivityCall, CallStatus, Phase, Todo } from '../types'
5
6// ── claude-mods kit v1 (docs/design.md): identical in every mod ──
7const TONE = { accent: 'claude', ok: 'success', warn: 'warning', bad: 'error', dim: 'inactive' } as const
8const GLYPH = { on: '●', off: '○', warn: '▲', ok: '✓', fail: '✗' } as const
9type Kit = Pick<ElementTable, 'Box' | 'Text'>
10
11/** Pane header: state glyph, mod name, one-line live status. */
12function header({ Box, Text }: Kit, glyph: string, tone: string, name: string, status: string) {
13 return (
14 <Box gap={1}>
15 <Text color={tone}>{glyph}</Text>
16 <Text bold>{name}</Text>
17 <Text dimColor wrap="truncate-end">{status}</Text>
18 </Box>
19 )
20}
21
22/** A section: a dim label (with optional small controls beside it), then its rows. */
23function section({ Box, Text }: Kit, label: string, rows: RenderChildren, aside?: RenderChildren) {
24 return (
25 <Box flexDirection="column">
26 <Box gap={1}>
27 <Text dimColor>{label}</Text>
28 {aside}
29 </Box>
30 {rows}
31 </Box>
32 )
33}
34
35/** A number right-aligned in a fixed-width cell. */
36function num({ Box, Text }: Kit, value: string, width: number, color?: string) {
37 return (
38 <Box width={width} flexShrink={0} justifyContent="flex-end">
39 <Text color={color}>{value}</Text>
40 </Box>
41 )
42}
43
44/** Empty state: what will show up here, and how to get it. */
45function empty({ Text }: Kit, text: string) {
46 return <Text dimColor>{text}</Text>
47}
48// ── end kit ──
49
50const PANE = 'activity'
51const calls = atom({ plugin: 'activity', key: 'calls' } as const, [])
52const phase = atom({ plugin: 'activity', key: 'phase' } as const, { kind: 'idle', since: 0, prompt: '' } as Phase)
53const todos = atom({ plugin: 'activity', key: 'todos' } as const, [])
54const showAll = atom({ plugin: 'activity', key: 'showAll' } as const, false)
55
56const STATUS: Record<CallStatus, { icon: string; color: string; label: string }> = {
57 running: { icon: GLYPH.on, color: TONE.accent, label: 'running' },
58 approval: { icon: GLYPH.warn, color: TONE.warn, label: 'waiting for YOUR approval' },
59 done: { icon: GLYPH.ok, color: TONE.ok, label: 'done' },
60 failed: { icon: GLYPH.fail, color: TONE.bad, label: 'failed' },
61 denied: { icon: GLYPH.fail, color: TONE.bad, label: 'denied' },
62}
63
64const TODO_ICON: Record<string, string> = { completed: GLYPH.ok, in_progress: GLYPH.on, pending: GLYPH.off }
65
66const str = (v: unknown) => (typeof v === 'string' ? v : '')
67const base = (p: string) => p.split(/[\\/]/).at(-1) ?? p
68const clip = (s: string, n: number) => (s.length > n ? `${s.slice(0, n - 1)}…` : s)
69
70/** One human line per tool call: what it is actually doing. */
71function describe(tool: string, input: Record<string, unknown>): string {
72 switch (tool) {
73 case 'Bash':
74 case 'PowerShell':
75 return `$ ${str(input.command).replace(/\s+/g, ' ')}`
76 case 'Read':
77 case 'Write':
78 case 'Edit':
79 case 'NotebookEdit':
80 return base(str(input.file_path) || str(input.notebook_path))
81 case 'Grep':
82 return `/${str(input.pattern)}/${input.path ? ` in ${base(str(input.path))}` : ''}`
83 case 'Glob':
84 return str(input.pattern)
85 case 'WebFetch':
86 return str(input.url)
87 case 'WebSearch':
88 return `"${str(input.query)}"`
89 case 'Agent':
90 case 'Task':
91 return `${str(input.subagent_type) || 'agent'}: ${str(input.description)}`
92 case 'TodoWrite':
93 return `${Array.isArray(input.todos) ? input.todos.length : 0} todos`
94 default: {
95 const first = Object.values(input).find(v => typeof v === 'string')
96
97 return typeof first === 'string' ? first : ''
98 }
99 }
100}
101
102const secs = (ms: number) => {
103 const s = Math.max(0, Math.round(ms / 1000))
104
105 return s >= 60 ? `${Math.floor(s / 60)}m${String(s % 60).padStart(2, '0')}s` : `${s}s`
106}
107
108async function setStatus($: EngineInterface, id: string, status: CallStatus, endedAt?: number) {
109 await update($, calls, list => list.map(c => (c.id === id ? { ...c, status, endedAt: endedAt ?? c.endedAt } : c)))
110}
111
112let ticker: { cancel: () => void } | null = null
113
114/** Redraws once a second while something runs, so the timers count up. */
115function startTicking($: EngineInterface) {
116 ticker ??= $.clock.every(1000, () => $.ui.invalidate('ui.render'))
117}
118
119function stopTicking() {
120 ticker?.cancel()
121 ticker = null
122}
123
124export const register: Register = (on, options) => {
125
126 on('session.start', async ($, e, next) => {
127 await $.command.register({ name: 'activity', description: 'Live view: what Claude is running and waiting for right now' })
128 if (options.autoOpen === true) void $.ui.open({ id: PANE, title: 'Activity' })
129
130 return next(e)
131 })
132
133 on('command.run', { command: 'activity' }, async $ => {
134 await $.ui.open({ id: PANE, title: 'Activity' })
135
136 return { text: 'Activity panel opened.' }
137 })
138
139 on('turn.start', async ($, e, next) => {
140 const since = await $.clock.now()
141 await update($, phase, (): Phase => ({ kind: 'thinking', since, prompt: e.text }))
142 startTicking($)
143
144 return next(e)
145 })
146
147 on('turn.complete', async ($, e, next) => {
148 const result = await next(e)
149 if (e.agentId === undefined) {
150 const since = await $.clock.now()
151 await update($, phase, (p): Phase => ({ ...p, kind: 'idle', since }))
152 stopTicking()
153 }
154
155 return result
156 })
157
158 on('tool.call', async ($, e, next) => {
159 const { tool, tool_use_id, agentId, ...input } = e as unknown as { tool: string; tool_use_id: string; agentId?: string } & Record<string, unknown>
160 const call: ActivityCall = {
161 id: tool_use_id,
162 tool,
163 summary: describe(tool, input),
164 agentId,
165 isBackground: input.run_in_background === true,
166 startedAt: await $.clock.now(),
167 status: 'running',
168 }
169 if (tool === 'TodoWrite' && Array.isArray(input.todos)) {
170 await update($, todos, () => (input.todos as Todo[]).map(t => ({ content: t.content, status: t.status, activeForm: t.activeForm })))
171 }
172 await update($, calls, list => [...list, call].slice(-300))
173 if (agentId === undefined) await update($, phase, (p): Phase => ({ ...p, kind: 'tools' }))
174 startTicking($)
175
176 try {
177 const check = await $.tool.check({ tool, input })
178 if (check.decision === 'ask') await setStatus($, tool_use_id, 'approval')
179 } catch {
180 // no verdict available
181 }
182
183 let status: CallStatus = 'failed'
184 try {
185 const ran = await next(e)
186 status = ran.deny !== undefined ? 'denied' : ran.isError === true ? 'failed' : 'done'
187
188 return ran
189 } finally {
190 await setStatus($, tool_use_id, status, await $.clock.now())
191 const stillRunning = (await read($, calls)).some(c => c.agentId === undefined && (c.status === 'running' || c.status === 'approval'))
192 if (agentId === undefined && !stillRunning) await update($, phase, (p): Phase => (p.kind === 'tools' ? { ...p, kind: 'thinking' } : p))
193 }
194 })
195
196 on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
197 const { Box, Text, Button } = $.ui.resolve(e)
198 const list = await read($, calls)
199 const now = await $.clock.now()
200 const p = await read($, phase)
201 const plan = await read($, todos)
202 const all = await read($, showAll)
203 const cols = e.props.bodyColumns ?? 40
204 const rows = e.viewport?.rows ?? 30
205
206 const live = list.filter(c => c.status === 'running' || c.status === 'approval')
207 const waitingOnYou = live.filter(c => c.status === 'approval')
208 const agents = await $.agent.list().catch(() => [])
209 const runningAgents = agents.filter(a => a.status === 'running')
210 const recent = list.filter(c => !live.includes(c) && (all || c.agentId === undefined)).slice(-Math.max(3, rows - 18 - live.length - plan.length))
211
212 const kit = { Box, Text }
213 const headline =
214 waitingOnYou.length > 0
215 ? { glyph: GLYPH.warn, tone: TONE.warn, text: `Waiting for you: approve ${waitingOnYou.map(c => c.tool).join(', ')}` }
216 : p.kind === 'idle'
217 ? { glyph: GLYPH.off, tone: TONE.dim, text: 'Idle: waiting for your next prompt' }
218 : p.kind === 'tools'
219 ? { glyph: GLYPH.on, tone: TONE.accent, text: `Running ${live.length} tool${live.length === 1 ? '' : 's'} · turn ${secs(now - p.since)}` }
220 : { glyph: GLYPH.on, tone: TONE.accent, text: `Thinking / writing · turn ${secs(now - p.since)}` }
221
222 return (
223 <Box flexDirection="column" gap={1}>
224 <Box flexDirection="column">
225 {header(kit, headline.glyph, headline.tone, 'activity', headline.text)}
226 {p.kind !== 'idle' && p.prompt !== '' && <Text dimColor wrap="truncate-end">for: {clip(p.prompt.replace(/\s+/g, ' '), cols - 6)}</Text>}
227 </Box>
228
229 {live.length > 0 &&
230 section(
231 kit,
232 'Now',
233 live.map(c => (
234 <Box gap={1}>
235 <Text color={STATUS[c.status].color}>{STATUS[c.status].icon}</Text>
236 <Text>{c.tool}</Text>
237 {num(kit, secs(now - c.startedAt), 6, STATUS[c.status].color)}
238 <Text dimColor wrap="truncate-end">
239 {c.agentId ? '[subagent] ' : ''}
240 {c.isBackground ? '[background] ' : ''}
241 {c.summary}
242 </Text>
243 </Box>
244 )),
245 )}
246
247 {runningAgents.length > 0 &&
248 section(
249 kit,
250 'Subagents',
251 runningAgents.map(a => (
252 <Text wrap="truncate-end">
253 <Text color={TONE.accent}>{GLYPH.on}</Text> {a.type} <Text dimColor>{a.description}</Text>
254 </Text>
255 )),
256 )}
257
258 {plan.length > 0 &&
259 section(
260 kit,
261 `Plan ${plan.filter(t => t.status === 'completed').length}/${plan.length}`,
262 plan.map(t => (
263 <Text dimColor={t.status === 'completed'} bold={t.status === 'in_progress'} wrap="truncate-end">
264 <Text color={t.status === 'completed' ? TONE.ok : t.status === 'in_progress' ? TONE.accent : undefined}>{TODO_ICON[t.status] ?? GLYPH.off}</Text> {t.status === 'in_progress' ? (t.activeForm ?? t.content) : t.content}
265 </Text>
266 )),
267 )}
268
269 {section(
270 kit,
271 'History',
272 <Box flexDirection="column">
273 {recent.length === 0 && empty(kit, 'No tool calls yet. Every tool Claude runs shows up here with its command and how long it took.')}
274 {recent.map(c => (
275 <Box gap={1}>
276 <Text color={STATUS[c.status].color}>{STATUS[c.status].icon}</Text>
277 <Box width={7} flexShrink={0}>
278 <Text wrap="truncate-end">{c.tool}</Text>
279 </Box>
280 {num(kit, secs((c.endedAt ?? now) - c.startedAt), 6)}
281 <Text dimColor wrap="truncate-end">
282 {c.summary}
283 </Text>
284 </Box>
285 ))}
286 </Box>,
287 <Box gap={1}>
288 <Button key="all" plain hotkey="a" label={all ? 'main only' : 'incl. subagents'} onPress={() => void update($, showAll, v => !v)} />
289 <Button key="clear" plain hotkey="c" label="clear" onPress={() => void update($, calls, l => l.filter(c => c.status === 'running' || c.status === 'approval'))} />
290 </Box>,
291 )}
292 </Box>
293 )
294 })
295}
296types/index.d.ts 28 lines1export type CallStatus = 'running' | 'approval' | 'done' | 'failed' | 'denied'
2
3export type ActivityCall = {
4 id: string
5 tool: string
6 summary: string
7 agentId?: string
8 isBackground: boolean
9 startedAt: number
10 endedAt?: number
11 status: CallStatus
12}
13
14export type Phase = { kind: 'idle' | 'thinking' | 'tools'; since: number; prompt: string }
15
16export type Todo = { content: string; status: string; activeForm?: string }
17
18declare module 'claude-code' {
19 interface PluginState {
20 activity: {
21 calls: ActivityCall[]
22 phase: Phase
23 todos: Todo[]
24 showAll: boolean
25 }
26 }
27}
28