/cube prints a random 3x3 scramble

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 36 lines1import type { EngineInterface, Register } from 'claude-code'
2
3// WCA event ids; cubing.js generates random-state scrambles for each, as TNoodle does.
4export const EVENTS: Record<string, string> = { '2': '222', '3': '333', '4': '444' }
5
6const scramble = async ($: EngineInterface, event: string) => {
7 const dir = `${$.plugin.root}/scramble`
8 if (!(await $.fs.exists(`${dir}/node_modules/cubing`))) {
9 $.ui.toast('Installing the scrambler (first run only)…')
10 const installed = await $.process.run(['npm', 'install', '--silent', '--no-audit', '--no-fund'], { cwd: dir, timeoutMs: 180_000 })
11 if (installed.exitCode !== 0) throw new Error(installed.stderr.trim() || 'npm install failed')
12 }
13 const ran = await $.process.run(['node', `${dir}/scramble.mjs`, event], { cwd: dir, timeoutMs: 60_000 })
14 const last = ran.stdout.trim().split('\n').pop() ?? ''
15 if (ran.exitCode !== 0 || !last.startsWith('"')) throw new Error(ran.stderr.trim() || 'scrambler failed')
16 return JSON.parse(last) as string
17}
18
19export const register: Register = on => {
20 on('session.start', async ($, e, next) => {
21 await $.command.register({ name: 'cube', description: 'Print a WCA random-state scramble: /cube, /cube 2 or /cube 4' })
22 return next(e)
23 })
24
25 on('command.run', { command: 'cube' }, async ($, e) => {
26 const size = e.args.trim() || '3'
27 const event = EVENTS[size]
28 if (!event) return { text: 'Sizes: /cube 2, /cube (3x3) or /cube 4' }
29 try {
30 return { text: `🧊 ${size}x${size}: ${await scramble($, event)}` }
31 } catch (err) {
32 return { text: `cube: could not scramble (${err instanceof Error ? err.message : String(err)}). Needs node and npm.` }
33 }
34 })
35}
36