Windows only: a small floating strip over Windows Terminal that previews each [Image #N] you paste or drop, until you send

One long session of building Claude Code mods on Windows 11, written up honestly: what shipped, what I tried and threw away, and why. Most mod repos only show the finished screenshot. This one also keeps the failures, because they say more about the mod API than the wins do.
Status: experimental, day one. Built on Claude Code 2.1.291 and still loading on 2.1.292. Tested on one machine: Windows 11, Windows Terminal 1.24, Cascadia Code, a cream background (
#F2F0DA), 134 columns, fullscreen mode. The mod API is new and may change under you. Issues welcome.
| Piece | Status | One-line lesson |
|---|---|---|
| fuel-bar | in daily use | The engine gives you context, auto-compact threshold and rate limits for free after every turn. No polling, no tokens. |
| thai-mode | in daily use | You can re-render tool rows, groups, spinner and turn duration. You cannot touch the prompt box. |
| task-band | new, day two | The engine tells a mod when an agent ends right away, but shell/monitor/workflow ends only reach it at the next tool call while Claude is busy. And there is no progress % for anything. |
| paste-peek | new, day three | The mod API can draw images only through the kitty protocol, which Windows Terminal lacks. A tiny native window beside the terminal does the job, and Claude Code already saves each pasted image to disk before you send. |
| Matrix intro | in daily use | A sequential intro always leaves a blank gap. Run it in parallel and stop on a file Claude writes before its first frame. |
| Safe updater | in daily use | Auto-update on Windows can leave claude.exe as a 500-byte stub. Stage, verify, then rename-and-swap. |
| Right-side pane + widgets | dropped | The dock frame belongs to the engine, and Thai text breaks in the Windows Terminal grid with every font I tried. |
| project-band above the prompt | dropped | Engine notifications render between your band and the prompt, and you cannot intercept them. |
| matrix-rain as a mod | dropped | session.start fires after the first frame. Too late for a loading screen. |
| Rounded prompt box | not possible | The prompt input is not a render site. |
| Context Router, prismantis | declined | Already built in / clashes with thai-mode and adds tokens per prompt. |

Two lines under the prompt:
T77 │ Opus 5.5 · medium │ ━━━━━━──── 53.7% 519.3k/1M │ 5h 26.0% (1h57m) · 7D 47.0% (3d) turn · model · effort · gauge to the auto-compact point (not to the raw window) · 5-hour and 7-day quota with time to reset.PROJECT · ✦ 24.2° night rain 39% · worked 4:32 hr, plus the latest mod toast on the right for 8 seconds.Why I built it: I was using ccusage statusline, and on a 1M-context model it showed context above 100% (147% on my screen). The engine already knows the right numbers.
How it works:
session.measure fires after every turn with context.tokens, context.window and rateLimits[] (five_hour, seven_day, each with percentUsed and resetsAt). session.usage({ breakdown: 'summary' }) adds autoCompactThreshold. Zero tokens, no process spawned.turn.step carries the current effort.PromptHint render site. If you return two lines, the engine keeps its own mode pill (⏵⏵ auto mode on) on the first line and indents the second by the pill's width. I tried drawing my own pill. The engine's pill stays anyway, so I gave up and kept theirs.ipwho.is for a rough location, then api.open-meteo.com. No keys, cached 30 min. This sends your IP to ipwho.is. Delete loadWeather if you don't want that.ui.toast can be intercepted (return { value: undefined }), so mod toasts land at the end of line 2 instead of popping over the transcript.dependencies: ["thai-mode"] in plugin.json lets fuel-bar read thai-mode's state and translate the hint itself. Two mods never fight over the same render site.Colors are hand-picked for a light cream background. On a dark theme you'll want to change the C palette in register.tsx.

Rewrites, with a built-in dictionary (no model calls):
ToolUse): Read → อ่านไฟล์, Bash → รันคำสั่ง, and MCP tools as service · Thai verbToolResult): "read 120 lines (40–159 of 300)", "added 4 · removed 1 lines", with the diff still drawn by the engine's Code componentToolGroup): กำลังเขียน 1 ไฟล์ · แก้ 1 ไฟล์ · รัน 1 คำสั่ง…requesting / thinking / responding / tool-input / tool-use)ctrl+b hint/thai toggles it, and the choice persists in $.store.
Things I learned:
Edit gets folded into a ToolGroup, so your nice single-row rendering mostly shows up only in ctrl+o.
A framed band above the prompt (AbovePrompt) titled "งานเบื้องหลัง" (background work). Each running subagent, Workflow, background shell and Monitor gets one chip with its own gauge, 3 per page:
What the API gives you (build 2.1.292):
agent.spawn answers with an agentId. Its end is turn.complete carrying that agentId, and it arrives immediately. Workflow agents come through agent.spawn too, with e.workflow.runId.backgroundTaskId. Monitor and Workflow results carry taskId (Workflow also runId and workflowName).prompt.submit with origin.kind === 'task-notification', with <task-id> and <status> in the text. When Claude is idle that is instant. While a turn runs it waits for the next tool-call boundary (I measured 4.3 s late).await next(e).Things that bit me:
Box takes borderStyle but has no border title. Laying a position: "absolute" title over the border line shifted the whole screen sideways and left it garbled until a resize forced a full redraw. The frame is now three plain Text rows sized to bodyColumns (the engine draws [-] at the far right of the band).
Windows only. Experimental, day one. Claude Code shows a pasted image as [Image #1] and nothing else, so you can't tell whether you attached the right screenshot until Claude answers. paste-peek opens a small strip in the bottom-right corner of your Windows Terminal window with a thumbnail of every [Image #N] in your draft:
[Image #2] from the draft and #2 leaves the strip. Send the message and the strip closes.Alt+V pastes and for files dragged onto the terminal.Why a separate window: the mod API has an Image element, but the engine draws it only through the kitty graphics protocol, which Windows Terminal doesn't speak, so you just get the alt text. I also tried a Raster of half-block characters (▀, two pixels per cell). It works everywhere, but a 6-row thumbnail is about 21×12 pixels, which is too blurry to tell screenshots apart.
How it works:
$.prompt.read()) every 250 ms and writes the list of [Image #N] numbers to a small state file in %TEMP%.peek.exe (C#, WinForms, about 475 lines in native/peek.cs). The exe watches the state file with a FileSystemWatcher and closes itself when the file goes empty, which the mod does on submit.%TEMP%\claude\<project-slug>\<session-id>\images\<N>.<ext> as soon as you paste or drop it, before you send. This is undocumented and may change in a future version. Claude Code skips this when transcript saving is off (for example a session started from inside another Claude session, which shows a "Transcript saving is off" notice), and the strip then says "no preview". My first build read the clipboard instead, and a dragged file then showed whatever image was last copied.EVENT_SYSTEM_FOREGROUND and location changes. No polling.Measured on my laptop: about 24 MB private memory and 0% CPU while the strip is open, nothing at all while there are no images, and the strip appears in about 0.2 s.
No binary in this repo. On first use the mod compiles native/peek.cs with the C# compiler that ships with Windows (%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\csc.exe, .NET Framework 4.x) into %LOCALAPPDATA%\paste-peek\. That takes about a second, once.
Options (/config): label language (en / th), theme (dark / light), and the distance from the window's bottom and right edges. The default bottom distance clears a two-line footer. Raise it if the strip covers your prompt.
Tested end to end in a fresh session: first-use compile, dark theme, English labels, a pasted image showing in the strip. Not handled yet: more than one terminal tab in the same window (the strip follows the window, not the tab), and terminals other than Windows Terminal.

Katakana rain in ink-on-cream with the folder name decoding in the middle, shown while Claude Code loads (about 4.7 s on this laptop). It is not a mod. It is a tiny C# exe started by the launcher.
The path there was three failures:
claude. However long the intro runs, you still get a blank or log-only screen between the intro ending and Claude's first frame.session.start fires after Claude has drawn its first screen. The rain lands on top of Claude, and in fullscreen mode Ctrl+L does not clear it.What works:
claude-launcher.cmd does start "" /b matrix-intro.exe and then call claude at the same moment. The rain shows within ~0.7 s.numStartups in <CLAUDE_CONFIG_DIR>\.claude.json every 120 ms. Claude bumps it 0.4–0.7 s before drawing its first frame, which is the "ready" signal. Hard cap: 20 s.cls, but only if the intro actually ran (it drops a marker file).-p, --version, --help and subcommands. CLAUDE_MATRIX_INTRO=0 disables it.Batch trap: claude installed by npm is claude.cmd. If you write claude %* instead of call claude %* in a .cmd, nothing after that line ever runs.
Half-width katakana take exactly one cell in Windows Terminal with Cascadia Code, so the columns line up.
Build it with the C# compiler that ships with Windows:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /optimize+ /codepage:65001 windows\matrix-intro.cs
On this machine, Claude Code's own auto-update repeatedly left node_modules\@anthropic-ai\claude-code\bin\claude.exe as a ~500-byte stub ("This version of claude.exe is not compatible…"), or failed with "claude.exe in use" while another session was open. Its warning also showed up in the middle of the screen:

windows/claude-update-safe.ps1:
npm view @anthropic-ai/claude-code version.--version.claude.exe.old-<timestamp> (Windows allows renaming a running exe, not overwriting it), then moves the new one in. Open sessions keep running the old file. New sessions get the new one..old-* files on the next run, and logs to %LOCALAPPDATA%\claude-update-safe\claude-update.log.Set "env": { "DISABLE_AUTOUPDATER": "1" } in settings.json so the built-in updater stops fighting it. matrix-intro.exe launches the script hidden at every start if it sits in the same folder.
This only applies to the global npm install. The native installer manages its own versioned folders.
Right-side pane with widgets (project name, a 3-tab reminder list, weather, other open sessions). Inspired by paneline and flightdeck. It worked technically (Pane render site with fullscreen: true), but:
เ ปิด). I tried Noto Sans Thai, Leelawadee, Tahoma, Tlwg Mono and Tlwg Typo. None fixed it. This is a WT grid limit, not a font problem.viewport.columns in PromptHint is the transcript width, not the full window./pane.project-band above the prompt (AbovePrompt, one line: project · weather · time worked). It looked good until Claude Code showed its own notice (Auto-update failed …). Engine notices render between AbovePrompt and the prompt, and they are standing warnings, not ui.toast, so a mod can't catch them. I merged the band into fuel-bar's second line instead.
matrix-rain as a mod. See the intro section: session.start is too late.
Rounded prompt box. I mocked it in a browser first. That was a mistake, because the prompt input is not one of the render sites, so a mod can't change it. A custom theme can recolor the border (promptBorder) but not reshape it.
CLAUDE.md from parent folders, and @path imports work.ToolUse, ToolGroup and TurnDuration (the same sites as thai-mode), and its diagramHints adds about 190 tokens to every prompt.The HUD in one popular mod's demo video (LIFE / LEVEL / XP bars across the top) is rendered with Revideo in its demo/ folder. The README says as much: "Nothing in it is captured". It isn't something the mod draws in your terminal. Before you promise someone a feature you saw in a GIF, grep the mod's hooks/ folder.
Mockups in a browser lie about fonts, colors and cell widths. What I used instead:
wt -w new <file.cmd>. Start-Process with arguments quotes the whole command line and fails with 0x80070002.CASCADIA_HOSTING_WINDOW_CLASS. Capture it with PrintWindow(hwnd, dc, 2) after SetProcessDPIAware(). That works even when the window is behind another one. CopyFromScreen only sees what's visible.SendInput + KEYEVENTF_UNICODE. SendKeys follows the active keyboard layout: with Thai active, /exit arrives as /59.claude plugin marketplace add <path-to-clone>\mods
claude plugin install fuel-bar@field-notes-mods --scope user
claude plugin install thai-mode@field-notes-mods --scope user
claude plugin install task-band@field-notes-mods --scope user
claude plugin install paste-peek@field-notes-mods --scope user
Plugins are read from that folder in place: edit a file, then run /reload-plugins. claude plugin test <folder> runs the tests (fuel-bar 7, thai-mode 5, task-band 13, paste-peek 4).
For the intro: compile windows/matrix-intro.cs, then put matrix-intro.exe, claude-update-safe.ps1 and claude-launcher.cmd in one folder on your PATH.
บันทึกการทำ mod ให้ Claude Code บน Windows ในหนึ่งวัน ทั้งชิ้นที่ใช้จริงและชิ้นที่ลองแล้วทิ้ง
/thai ใช้สลับเปิด/ปิด[Image #N] ที่วางหรือลากมาไว้ในข้อความ ก่อนกดส่ง คลิกเพื่อขยาย ลบ [Image #N] แล้วรูปหายจากกรอบ กดส่งแล้วกรอบปิดเอง ซ่อนเมื่อสลับไปหน้าต่างอื่น ใช้ RAM ประมาณ 24 MB เฉพาะตอนมีรูปแนบ ไม่แนบไฟล์ exe ไว้ใน repo แต่จะคอมไพล์จากโค้ดต้นฉบับตอนใช้ครั้งแรกnumStartups เพิ่ม ถ้ารันเรียงกันจะมีจอว่างเสมอclaude.exe เหลือไฟล์ 500 ไบต์ ใช้วิธีติดตั้งแยกไว้ก่อน ตรวจว่าใช้ได้ แล้วค่อยเปลี่ยนชื่อสลับไฟล์session.start มาช้ากว่าจอแรกถ้าใช้ Windows Terminal กับภาษาไทย ให้เตรียมใจไว้ว่าสระบนและวรรณยุกต์จะกินช่องของตัวเอง ฟอนต์แก้ไม่ได้
MIT
hooks/register.ts 122 lines1import type { EngineInterface, Register } from 'claude-code'
2
3import { imageNumbers, peekArgs, projectSlug, stateText } from './logic'
4import type { PeekOptions } from './logic'
5
6const VERSION = '0.2.0'
7
8const sources = new Map<number, string>()
9let statePath = ''
10let imagesDir = ''
11let exePath = ''
12let written = ''
13let running = false
14let broken = false
15let args: string[] = []
16
17async function ensurePaths($: EngineInterface) {
18 if (statePath && imagesDir) return
19 const temp = (await $.env.get('TEMP')) ?? 'C:\\Windows\\Temp'
20 const sid = await $.session.id()
21 statePath = `${temp}\\peek-${sid}.txt`
22 const sessionDir = `${temp}\\claude\\${projectSlug(await $.session.cwd())}\\${sid}`
23 imagesDir = `${sessionDir}\\images`
24 if (await $.fs.exists(sessionDir)) return
25 try {
26 for (const entry of await $.fs.list(`${temp}\\claude`)) {
27 const dir = `${temp}\\claude\\${typeof entry === 'string' ? entry : entry.name}\\${sid}`
28 if (await $.fs.exists(dir)) {
29 imagesDir = `${dir}\\images`
30 return
31 }
32 }
33 } catch {}
34}
35
36async function ensureExe($: EngineInterface): Promise<boolean> {
37 if (exePath) return true
38 const local = (await $.env.get('LOCALAPPDATA')) ?? (await $.env.get('TEMP')) ?? 'C:\\Windows\\Temp'
39 const dir = `${local}\\paste-peek`
40 const exe = `${dir}\\peek-${VERSION}.exe`
41 if (!(await $.fs.exists(exe))) {
42 const windir = (await $.env.get('WINDIR')) ?? 'C:\\Windows'
43 const csc = `${windir}\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe`
44 if (!(await $.fs.exists(csc))) {
45 $.ui.toast('paste-peek: C# compiler not found (needs .NET Framework 4.x)')
46 return false
47 }
48 await $.process.run(['cmd.exe', '/d', '/c', 'if', 'not', 'exist', dir, 'mkdir', dir])
49 const r = await $.process.run([
50 csc, '/nologo', '/target:winexe', '/optimize+', '/codepage:65001',
51 `/out:${exe}`, '/r:System.Windows.Forms.dll', '/r:System.Drawing.dll',
52 `${$.plugin.root}\\native\\peek.cs`,
53 ])
54 if (r.exitCode !== 0 || !(await $.fs.exists(exe))) {
55 $.ui.toast('paste-peek: could not build peek.exe, see the debug log')
56 $.ui.log(r.stdout + r.stderr, { to: 'debug' })
57 return false
58 }
59 }
60 exePath = exe
61 return true
62}
63
64async function launch($: EngineInterface) {
65 if (running || broken) return
66 running = true
67 try {
68 if (!(await ensureExe($))) {
69 broken = true
70 return
71 }
72 const child = $.process.spawn({ argv: [exePath, statePath, ...args] })
73 for await (const _ of child) void _
74 } catch {
75 } finally {
76 running = false
77 }
78}
79
80async function sync($: EngineInterface, text: string) {
81 const nums = imageNumbers(text)
82 if (nums.length === 0 && sources.size === 0) return
83 await ensurePaths($)
84 for (const n of [...sources.keys()]) if (!nums.includes(n)) sources.delete(n)
85 for (const n of nums) if (!sources.has(n)) sources.set(n, `dir\t${imagesDir}`)
86 const next = stateText(sources)
87 if (next !== written) {
88 written = next
89 await $.fs.write(statePath, next)
90 }
91 if (sources.size > 0 && !running) void launch($)
92}
93
94async function poll($: EngineInterface) {
95 const { text } = await $.prompt.read()
96 await sync($, text)
97}
98
99export const register: Register = (on, options) => {
100 args = peekArgs(options as Partial<PeekOptions>)
101
102 on('session.start', async ($, e, next) => {
103 $.clock.every(250, () => poll($))
104 return next(e)
105 })
106
107 on('prompt.edit', async ($, e, next) => {
108 const r = await next(e)
109 if (r.text.includes('[Image #') || sources.size > 0) void sync($, r.text)
110 return r
111 })
112
113 on('prompt.submit', async ($, e, next) => {
114 if ((e.origin.kind === 'composer' || e.origin.kind === 'bridge') && sources.size > 0) {
115 sources.clear()
116 written = ''
117 await $.fs.write(statePath, '')
118 }
119 return next(e)
120 }).catch(async ($, e, next) => next(e))
121}
122hooks/logic.ts 29 lines1export function imageNumbers(text: string): number[] {
2 const found = text.match(/\[Image #\d+\]/g) ?? []
3 const nums = found.map(s => Number(s.slice(8, -1)))
4 return [...new Set(nums)].sort((a, b) => a - b)
5}
6
7export function projectSlug(cwd: string): string {
8 return cwd.replace(/[^A-Za-z0-9]/g, '-')
9}
10
11export function stateText(sources: ReadonlyMap<number, string>): string {
12 return [...sources.entries()]
13 .sort((a, b) => a[0] - b[0])
14 .map(([n, src]) => `${n}\t${src}`)
15 .join('\n') + (sources.size ? '\n' : '')
16}
17
18export type PeekOptions = { language: string; theme: string; bottom_offset: number; right_offset: number }
19
20export function peekArgs(o: Partial<PeekOptions>): string[] {
21 const num = (v: unknown, d: number) => (typeof v === 'number' && Number.isFinite(v) ? Math.round(v) : d)
22 return [
23 '--lang', o.language === 'th' ? 'th' : 'en',
24 '--theme', o.theme === 'light' ? 'light' : 'dark',
25 '--bottom', String(num(o.bottom_offset, 91)),
26 '--right', String(num(o.right_offset, 27)),
27 ]
28}
29