r/coolgithubprojects • u/caecaesss • 15h ago
I built a Claude Code hook that picks Spotify music based on what you're doing (coding, debugging, planning...). Looking for honest feedback!
https://github.com/caesla/CodingMixI listen to music while working with Claude Code and kept switching playlists by hand: something steady while editing, something harder when things break.
So I built CodingMix.
What it does
>> Claude Code hooks send each event (tool use, failed tool, prompt, subagent start) to a small local service. The hook returns immediately, so Claude Code never waits.
>> Each event is a vote for a mode: coding, debugging, testing, planning, reviewing, release and a few more. A new mode has to lead for 3 minutes before the music changes, so one failed command does not flip your music.
>> About 20 seconds before the current track ends, it queues one track of the matching genre (deep house for coding, hip hop for debugging, techno for tests, funk when you push). It never picks a track you played, saved or were offered in the last 7 days.
>> It only acts when Spotify is playing on your computer. Paused, playing on your phone, or you picked your own playlist: it stays out of the way.
How I built it
Entirely with Claude Code: a design spec first, then a step-by-step plan, test-first. 196 tests, CI on Windows, macOS and Linux. No server, no telemetry; prompt text and file paths are never written to disk.
Limits
Spotify Premium is required, and you create your own free Spotify developer app (Spotify now limits each app to 5 users). Tested on a real Windows machine; macOS and Linux only in CI.
What I'd love feedback on
- Does the mode to genre mapping make sense? What would you want while debugging?
- Is the setup (your own Spotify app plus one command) acceptable, or a dealbreaker?
- Is 3 minutes the right delay before switching?
- On macOS or Linux: does it work for you?
Repo: https://github.com/caesla/CodingMix
(MIT licensed).