AUGUST 5, 2025

Managing a music collection with AI

I started collecting music as soon as I found out about this new hot format called MP3 back in the 90s. Then I lost it all to streaming services - I probably still could recover it, but that would require going through old backups. And most of it was pirated anyway, which contradicts my current views on how things should work in the world (so does using Spotify, because artists get next to nothing). So I decided to rebuild my music collection officially buying it from sites like bandcamp.

Which brought up the question of organizing it all.

But both back in the day and now the worst part about a music collection was keeping it well-structured, with pretty file and folder names, sorted correctly, album art and all. I used to have energy to edit metadata by hand (heck, I remember ripping my own CDs into MP3s). But I'm too lazy for this shit now.

Enter Claude Code (but you could do the same with gemini, opencode, claude desktop with some MCP, etc).

The Setup

I keep my music collection in ~/Sync/Music/ with a strict directory structure: Artist/YEAR - Album Title/. This folder automatically syncs using syncthing to my home server, from where I can stream it wherever I want. When on my computer I use rmpc player to listen to it, because I'm so badass that only a terminal player will satisfy me.

When on the go I stream from a self-hosted Navidrome, but to be honest, I mostly listen to music while working.

To maintain consistency, I created a CLAUDE.md file in the music directory with organizational rules and import procedures (well, I actully told Claude what I want and it created the file for me, then I just edited it).

Then I asked it to bring order and reorganize my collection, which took it about 10 minutes, including the time to look up albums and artists info online. For example I had an album where all tracks were sorted alphabetically, so I told it to order them according to the actual album. The result is a perfect folder structure of ARTIST / YEAR - ALBUM, with album covers (although it did try to generate album art instead of looking it up online at some point).

Anyway, this is a very nice use of AI to handle a boring non-coding task. Some technical details:

The Import Process

When downloading a new album, I can run:

claude -p "import ~/Downloads/album.zip"

The CLAUDE.md file instructs Claude to:

Look how neat the import is:

Screenshot of Claude Code ipmorting an album into the music library

Here's the CLAUDE.md file used in case you want to try it yourself.


Are you looking for a comments section? I would love to hear your feedback, but managing a comments section is a separate job. You can reach me on Mastodon or send me an email to public@tarka.dev

2022-2025 © Attribution-ShareAlike 4.0 International