Recovering Deleted Apple Music Playlists with Claude Cowork

A detailed use case shows how Claude Cowork helped recover 20+ years of deleted Apple Music playlists after a user accidentally wiped their entire library while troubleshooting an iCloud sync issue. The recovery involved reconstructing 75 playlists and slotting 8,185 tracks back into them.
The Problem
The user deleted every playlist in their Apple Music library and the entire Apple Music cloud library in June 2025 while trying to fix an iCloud sync issue. This included roughly 20 years of curation, imports from Spotify, and 7 years of Apple Music preference building. The only remaining data was a damaged Favorites list and some Discovery playlists.
What Claude Cowork Did
After the user described the problem and pointed to an Apple data export folder, Claude Cowork:
- Found and parsed the
Apple Music Library Playlists.jsonandTracks.jsonfiles inside the export - Cross-referenced a 256,617-row Play Activity CSV to reconstruct deleted playlist contents (modification dates showed all deletions occurred on 2025-06-01)
- Recovered 31 of 34 deleted playlists from play history alone with full track lists
- Wrote Python scripts to generate a formatted Excel report with 4 sheets: Summary, Active Playlists, Deleted/Recovered, and Full Library sorted by play count
- Generated 14 AppleScript shell scripts split across active and deleted playlists that searched the Music.app library and automatically slotted tracks into recreated playlists
- Debugged multiple rounds of AppleScript syntax errors, encoding issues (em dashes and special characters causing Script Editor to misidentify files as Chinese), and iCloud permission errors
- Built a master
RUN_ALL.shscript to run all 14 restore scripts sequentially
The Tools Built On the Fly
After the AppleScript restore pass, 1,254 tracks remained unfound (either from Apple-curated playlists or with artist names stripped during ASCII conversion). Claude built three custom HTML tools:
- Apple Music Quick-Add.html – Looked up each NOT FOUND track against the iTunes Search API using JSONP (to bypass CORS from a local file), showed confidence badges (exact/close/title/partial), and created
music://deep links to open tracks directly in the desktop Music app - Apple Music Album Add List.html – Pivoted from individual tracks to whole albums once adding albums proved faster. Grouped the 1,254 missing tracks into 437 unique albums, looked up each via the iTunes API, and generated 'Open in Music' deep links that jumped straight to albums in the desktop app. Sorted by track count so the most impactful albums came first
- Both tools used localStorage for checkbox persistence so the user could work across multiple sessions without losing progress
The album tool was particularly effective – instead of clicking through 1,254 individual tracks, the user added whole albums in seconds each, completing 437 albums in a fraction of the time.
📖 Read the full source: r/ClaudeAI
👀 See Also

Developer Builds HIPAA-Compliant Healthcare App Using Claude AI with Xano and Bolt
A developer built a HIPAA-compliant internal healthcare management system using Claude 4.6 with no-code tools Xano for backend and Bolt for frontend, implementing field-level encryption, RBAC middleware, and audit logs.

OpenClaw AI Agent Finds Federal Job Match and Creates Daily Automation
A user tasked their OpenClaw AI agent with finding a federal job on usajobs.gov that matched their salary requirements and preserved special retirement benefits, resulting in a specific job description match and a daily notification automation.

Building Jarvis: A Self-Hosted AI Operations Layer with OpenClaw
A developer shares their architecture for a personal AI assistant running on a Mac mini 24/7, using OpenClaw, n8n, Obsidian, and a cascade of AI models to manage small business operations.

How I built 62 free tools in a month using Claude Code + a loop script
A developer shipped 62 browser-based, SEO-ready tools in 30 days using a shell script called Ralph that runs Claude Code autonomously in layers, plus a parallel cook.sh to run multiple tools at once.