Imagine walking into your dev floor and seeing a live leaderboard where every developer's Claude Code usage is represented as a tiny race car speeding down its own lane. That's exactly what the claude-code-race project delivers—a quirky, surprisingly polished dashboard that turns mundane coding sessions into ambient office competition. The project surfaced on Hacker News this week with just 6 points, but it's been quietly gaining traction in teams tired of invisible productivity metrics.
How the Racing Mechanic Actually Works
The system leverages Claude Code's built-in hook system at four key moments: UserPromptSubmit (when you send a prompt), PreToolUse (when Claude runs a tool), Stop (when thinking ends), and SessionStart. Each event posts to a central Node.js server via curl or Invoke-WebRequest, which aggregates daily and weekly counters before broadcasting real-time snapshots over WebSocket to any connected browser. The frontend is pure vanilla JavaScript—no React, no Vue, just DOM manipulation and CSS animations keeping things lean. The scoring rewards actual thinking: submitting a prompt nets +10 points while tool usage adds only +1. When Claude is "thinking" between UserPromptSubmit and Stop events, a yellow smiley badge pops above the car and it bobs faster on screen—giving you a visual cue that someone is actually engaged with their work rather than idling.
The Position Math Keeps Things Fair
Here's where the design gets clever. Rather than linear progression, positions use an asymptotic curve: position = (1 - exp(-score / 100)) * 0.82. This means early prompts produce visible jumps in lane position—two prompts puts you at 15%, five gets you to 32%—but reaching the front of the pack requires sustained work. The cap sits around 82% so nobody ever technically "wins" by touching a finish line. It's competitive without being surveillance-y, as the README explicitly notes.
Getting It Running
The server requires Node.js 18+ (tested on Node 22 LTS) and runs on Express with ws for WebSocket connections. Setup is straightforward: clone the repo, npm install, npm start on port 3000. For production deployments, there's a systemd unit file ready to drop in, and GNOME users can configure auto-start kiosk mode via Firefox so it displays full-screen after boot without any manual intervention. On the client side, developers run a simple installer script that idempotently appends hook entries to ~/.claude/settings.json—re-running replaces old entries rather than duplicating them. Windows gets PowerShell support alongside bash for Unix systems. Each developer can set a custom nickname via environment variable if $USER isn't what they want on the leaderboard.
What Gets Tracked (and What Doesn't)
Daily counters reset at UTC midnight, weekly on Monday. Players vanish from the dashboard after 30 minutes of inactivity and reappear automatically when they send their next event. There's no persistent history beyond date-stamped JSON dumps in data/stats.json—the README flags this as something that could be improved later. Sound effects for overtaking are intentionally omitted (nobody wants audio blast on an office TV).
Key Takeaways
- Hooks fire at UserPromptSubmit, PreToolUse, Stop, and SessionStart—zero instrumentation required beyond the config file
- Scoring favors thoughtful prompts (+10) over tool spam (+1), keeping the leaderboard meaningful
- Asymptotic position scaling prevents runaway winners while still rewarding consistent users
- No database, no framework—just Node + vanilla JS/CSS for trivial deployment
- Uninstall is clean: remove the folder and edit settings.json to strip hook entries
The Bottom Line
This hits that sweet spot of genuinely useful and completely unnecessary—exactly what the open-source ecosystem needs more of. Whether your team adopts it as a productivity conversation starter or just wants something fun on the office TV during standups, claude-code-race proves that even Anthropic's tooling can be bent toward absurdity when you know how to pull the right hooks.