A live HUD above the prompt: time, tool calls, files edited, context and cost

From the video "3 Claude Code Mods I Built in 5 Minutes (Take Them)".
| Mod | What it does |
|---|---|
spinner-quips | Replaces the spinner word with a joke ("Blaming the intern", "Googling the error"…) and counts tool calls |
safety-net | Blocks rm -rf, git push --force, git reset --hard and DROP TABLE, and shows a warning |
session-hud | A live HUD above the prompt: time, tool calls, files edited, context bar, cost, and a mood 😎 😅 🥵 |
Needs Claude Code v2.1.287 or newer (Desktop app v2.1.286+).
/plugin marketplace add ivtrade777/coding-tips-mods
/plugin install spinner-quips@coding-tips-mods
/plugin install safety-net@coding-tips-mods
/plugin install session-hud@coding-tips-mods
/reload-plugins
Install only the ones you want.
git clone https://github.com/ivtrade777/coding-tips-mods.git
claude --plugin-dir ./coding-tips-mods
Each mod is one short file: <mod>/hooks/register.ts (or .tsx). Change the jokes in spinner-quips, add your own dangerous commands to safety-net, or new stats to session-hud, then run /reload-plugins.
Mods are not sandboxed: they run with your permissions. Read the code (each mod is one short file in hooks/) and check what it does:
claude plugin validate ./session-hud
Tests: claude plugin test ./safety-net
Not affiliated with or endorsed by Anthropic. MIT licence.
hooks/register.tsx 74 lines1import type { EngineInterface, Register } from 'claude-code'
2
3const EDIT_TOOLS = new Set(['Edit', 'Write', 'MultiEdit', 'NotebookEdit'])
4const SKIP = new Set(['node_modules', '.git', 'dist', 'build', 'target', '.claude'])
5
6let tools = 0
7let changed = 0
8const edited = new Set<string>()
9
10function bar(percent: number) {
11 const full = Math.round(percent / 10)
12 return '▰'.repeat(full) + '▱'.repeat(10 - full)
13}
14
15function mood(percent: number) {
16 if (percent < 50) return '😎'
17 if (percent < 80) return '😅'
18 return '🥵'
19}
20
21// Count the project's files changed since the session began, however Claude changed them
22// (its Edit tool, a shell command, a script). Small walk, capped, skipping build folders.
23async function countChanged($: EngineInterface) {
24 const { startedAt } = await $.session.usage()
25 let count = 0
26 let seen = 0
27 const walk = async (dir: string, depth: number) => {
28 for (const entry of await $.fs.list(dir || undefined)) {
29 if (++seen > 2000) return
30 const path = dir ? `${dir}/${entry.name}` : entry.name
31 if (entry.kind === 'dir' && depth < 6 && !SKIP.has(entry.name)) await walk(path, depth + 1)
32 else if (entry.kind === 'file' && entry.mtimeMs >= startedAt) count += 1
33 }
34 }
35 await walk('', 0)
36 changed = count
37}
38
39export const register: Register = on => {
40 // Count every tool call, and after it ran, recount the changed files
41 on('tool.call', async ($, e, next) => {
42 tools += 1
43 if (EDIT_TOOLS.has(e.tool) && 'file_path' in e && typeof e.file_path === 'string') {
44 edited.add(e.file_path)
45 }
46 $.ui.invalidate('ui.render')
47 const ran = await next(e)
48 await countChanged($).catch(() => {})
49 $.ui.invalidate('ui.render')
50 return ran
51 }).catch(($, e, next) => next(e)) // if the HUD fails, the tool still runs
52
53 // Draw the HUD in the band above the prompt
54 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
55 if (e.props.hasSurvey) return next(e)
56
57 const { Box, Text } = $.ui.resolve(e)
58 const usage = await $.session.usage()
59 const minutes = Math.floor(((await $.clock.now()) - usage.startedAt) / 60000)
60 const percent = Math.round(usage.context.percent ?? 0)
61 const cost = usage.cost ? `$${usage.cost.usd.toFixed(2)}` : '-'
62 const files = Math.max(changed, edited.size)
63
64 return (
65 <Box>
66 <Text color="cyan" bold>HUD </Text>
67 <Text>⏱ {minutes}m 🔧 {tools} tools 📝 {files} files </Text>
68 <Text color={percent < 80 ? 'cyan' : 'red'}>🧠 {bar(percent)} {percent}% </Text>
69 <Text>{mood(percent)} 💸 {cost}</Text>
70 </Box>
71 )
72 })
73}
74