Demo: turn band, rm -rf guard, /hi command

Thirteen mods I wrote for Claude Code in October 2026, the week mods were announced. A mod is a plugin of TypeScript hooks that runs inside Claude Code: it can draw panes and bands in the terminal, add slash commands, give Claude new tools, and block or react to tool calls. I built these to see how far the system goes, and a few of them I now use every day.
The one I use most is interview-coach: it asks a placement interview question aloud, records my spoken answer, transcribes it on the Mac with Whisper, and scores pace, filler words and structure against my own CV stories.
| Mod | How you use it | What it does |
|---|---|---|
| interview-coach | /coach | Spoken mock interview in a side pane. Asks a question aloud, records from the mic, transcribes locally (Whisper large-v3-turbo via whisper.cpp), then shows speaking time against the target, words per minute, filler words, time spent on each step of the answer framework, and two stronger example answers drawn from your profile. Keeps a WPM trend across sessions. |
| nihongo | /nihongo | Japanese tutor pane: kana drill that weights look-alike pairs and brings misses back sooner, 44 N5 word cards, and a sentence builder where Claude Haiku sets a line from the week's grammar and corrects your kana answer. A word band above the prompt shows a new word each turn. |
| joka-pond | /pond | Animated ASCII pond that earns XP for every tool Claude uses and climbs a consulting ladder from Intern to Managing Partner. Storms when a tool fails, keeps a daily streak. |
| aurora | /visuals, /aurora | Truecolor pixel art: an aurora band above the prompt whose colours follow the time of day, plus a gallery (plasma, ocean sunset, warp, a 4-4-6 breathing lotus). |
| avatar | /buddy | A pixel companion docked beside the chat. Its mood follows Claude: thinking, happy after a reply, worried after a failure, sleepy after midnight. |
| chart | Claude calls it | Gives Claude a tool that draws bar, line, area and donut charts inline in the chat, with axes, labels and legends. |
| heatmap | Claude calls it | Inline truecolor heatmaps with heat, green and diverging palettes. |
| diagram | Claude calls it | Flowcharts drawn in the terminal: coloured boxes by role, laid out top to bottom with labelled arrows. |
| animate | Claude calls it | Plays short truecolor animations (fireworks, rain, aurora and others) inside a chat row at about 15 fps. |
| pixel | Claude calls it | Draws a pixel-art image in the chat from a JSON grid of colours. |
| change-ledger | /changes | Pane listing every file Claude created or edited this session. |
| em-dash-guard | automatic | Blocks any write or edit that adds an em dash, my house style for documents. |
| hello-mod | /hi | Starter mod: an instant reply with no model call, a guard that blocks rm -rf, and a toast at the end of each turn. |
statusline/statusline-command.sh is my status line: model, effort, context used, 5-hour and weekly usage with time left, folder and git branch, colour-coded green, yellow and red.
claude --plugin-dir ./mods/chart
Pass --plugin-dir once per mod you want. claude plugin validate ./mods/chart checks a mod before loading it.
interview-coach needs ffmpeg, whisper-cpp (brew install ffmpeg whisper-cpp) and a Whisper model file. Set the paths at the top of mods/interview-coach/hooks/register.tsx, and copy profile.example.md to the profile path with your own experiences.
$ context object can't be stored or passed around. Long-running work has to start from a worker in session.start; buttons only queue jobs for it.$.ui.blit instead.session.start becomes callable only from the next prompt.-progress flag must come before -i, or progress output never arrives.hooks/register.tsx 51 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { Turn } from '../types'
5
6const last = atom({ plugin: 'hello-mod', key: 'last' } as const, null)
7const isHidden = atom({ plugin: 'hello-mod', key: 'isHidden' } as const, false)
8
9export const register: Register = on => {
10 let startedAt = 0
11 let tools = 0
12
13 // 1. Instant slash command: answered by code, no Claude turn
14 on('session.start', async ($, e, next) => {
15 await $.command.register({ name: 'hi', description: 'hello-mod: instant reply, no Claude turn' })
16 return next(e)
17 })
18
19 on('command.run', { command: 'hi' }, async () => ({
20 text: `Hi Ishu. This reply came from hello-mod code, not from Claude. Tool calls so far this turn: ${tools}.`,
21 }))
22
23 // 2. Guard: block destructive Bash before it runs
24 on('tool.call', { tool: 'Bash' }, ($, e, next) => {
25 tools += 1
26 return /\brm\s+-rf\b/.test(e.command)
27 ? { deny: `hello-mod blocked this: "rm -rf" is not allowed in this session.` }
28 : next(e)
29 })
30
31 on('tool.call', ($, e, next) => {
32 if (e.tool !== 'Bash') tools += 1
33 return next(e)
34 })
35
36 // 3. Band above the prompt: stats of the last turn
37 on('prompt.submit', async ($, e, next) => {
38 startedAt = await $.clock.now()
39 tools = 0
40 return next(e)
41 })
42
43 on('turn.complete', async ($, e, next) => {
44 const seconds = Math.round(((await $.clock.now()) - startedAt) / 1000)
45 const turn: Turn = { seconds, tools }
46 await update($, last, () => turn)
47 $.ui.toast(`hello-mod: turn done in ${seconds}s`)
48 return next(e)
49 })
50}
51types/index.d.ts 8 lines1export type Turn = { seconds: number; tools: number }
2
3declare module 'claude-code' {
4 interface PluginState {
5 'hello-mod': { last: Turn | null; isHidden: boolean }
6 }
7}
8