Fixes typos in what you type before Claude reads it

Mods for Claude Code (terminal and the desktop Code tab).
| Mod | What it does |
|---|---|
| usage-band | A band above the prompt: 5h and 7d limits as bars with time to reset, session cost with a mood emoji, total session tokens, and a pacing hint |
| chat-roster | A floating org-chart window for the sidebar group of the chat you're in: the orchestrator on top, the group's chats below, running subagents under their chat. Filled = working, hover a dot for its title, a flash runs along the lines when messages pass. Shown only while Claude is in front; opens when a chat starts |
| cube | /cube, /cube 2, /cube 4: random-state scrambles (the WCA method, via cubing.js) |
| handoff | /handoff [focus]: runs the project's checks, writes the dev log entry and HANDOFF.md update, commits (never pushes), and summarizes |
| streak | Your streak of days in a row using Claude Code in the status line (streak ๐ฅ 3 days); /streak adds your longest streak and total days |
| prompt-cleanup | Fixes typos in what you type before Claude reads it (Haiku; skips commands, code and long pastes) |
5h โโโโโโโ 52% (1h 30m) 7d โโโโโโโ 23% (3d 5h) $1.23 ๐ฉ 6.1M tokens ๐ on pace
Cost emoji: ๐ฉ $0โ$5 ยท ๐ >$5 ยท ๐ฅฑ >$10 ยท ๐ฎโ๐จ >$25 ยท ๐ซช >$50 ยท ๐ >$100 ยท ๐ค >$500 ยท ๐ >$1000. Pacing: ๐ spend freely (under an hour to reset, 70% or less used) ยท ๐ข slow down (15+ points ahead of the clock) ยท ๐ on pace ยท ๐ nearly out (90%+).
Needs: python3 (usage-band tokens, chat-roster, streak), Xcode command line tools for swiftc (chat-roster builds its window on first use, macOS only), node and npm (cube installs cubing.js on first use).
In a Claude Code terminal session, one line per mod you want:
/plugin install usage-band --marketplace bhargava-gumpula/claude-mods
/plugin install chat-roster --marketplace bhargava-gumpula/claude-mods
/plugin install cube --marketplace bhargava-gumpula/claude-mods
/plugin install handoff --marketplace bhargava-gumpula/claude-mods
/plugin install prompt-cleanup --marketplace bhargava-gumpula/claude-mods
/plugin install streak --marketplace bhargava-gumpula/claude-mods
Answer y to add the marketplace, then pick the user scope.
hooks/register.ts 35 lines1import type { Register } from 'claude-code'
2
3const SYSTEM = `You fix typos and misspellings in a message someone typed to a coding assistant.
4Change only misspelled words and obvious typos. Keep everything else exactly: wording, grammar,
5slang, casing style, punctuation, line breaks, technical terms, code, identifiers, file paths,
6URLs, commands and numbers. Never answer, rephrase or add anything.
7Reply with the corrected message only. If nothing needs fixing, reply with it unchanged.`
8
9// Typed by a person, short enough to be prose, and not a command, shell line or code.
10export const shouldClean = (text: string) =>
11 text.trim().length >= 3 &&
12 text.length <= 1500 &&
13 !/^\s*[/!#]/.test(text) &&
14 !text.includes('```')
15
16// A typo fix keeps the length close; anything else means the model did more than fix typos.
17export const isTypoFix = (before: string, after: string) =>
18 after.length > 0 && Math.abs(after.length - before.length) <= Math.max(6, before.length * 0.15)
19
20export const register: Register = on => {
21 on('prompt.submit', async ($, e, next) => {
22 const isTyped = ['composer', 'bridge', 'sdk'].includes(e.origin.kind)
23 if (!isTyped || !shouldClean(e.text)) return next(e)
24
25 const r = await $.model
26 .complete({ model: 'haiku', system: SYSTEM, prompt: e.text, effort: 'low', timeoutMs: 4000, maxTokens: 1024 })
27 .catch(() => undefined)
28 const fixed = r?.isAnswered ? r.text.trim() : ''
29 if (!isTypoFix(e.text, fixed) || fixed === e.text.trim()) return next(e)
30
31 $.ui.toast('Fixed typos in your prompt')
32 return next({ ...e, text: fixed })
33 })
34}
35