Claude Code Tools

media-library-organizer-skill

github

A Claude Code skill for organizing media libraries (movies, TV, anime) — clean junk, merge scattered episodes, normalize folder names, verify completeness against TMDB

Stars
⭐ 35
License
MIT
Last Updated
2026-04-19
Source
github

Media Library Organizer

A Claude Code skill for systematically cleaning, merging, renaming, and verifying media libraries — making them ready for Jellyfin / Emby / Plex auto-scraping.

What It Does

StepDescription
Scan & AnalyzeSurvey directories, flag junk files, duplicates, misplaced content
Clean JunkRemove SMB residuals, .DS_Store, download fragments, empty dirs
Identify DuplicatesFind same content across folders by title/year/quality matching
Merge Scattered EpisodesCombine split episodes from different release groups
Normalize Folder NamesRename to Title (Year) format for media server recognition
Verify vs TMDBCompare local episode counts against TMDB totals
Report & ConfirmPresent findings, wait for user confirmation before deletions

Workflow

Scan & Analyze → Clean Junk → Identify Duplicates → Merge Scattered Episodes
    → Normalize Folder Names → Verify vs TMDB → Report & Confirm

Installation

npx skills add Innei/media-library-organizer-skill

This automatically installs the skill into your Claude Code environment.

Manual Install

Copy the skill into your Claude Code skills directory:

# Global (all projects)
git clone https://github.com/Innei/media-library-organizer-skill.git ~/.claude/skills/media-library-organizer

# Project-specific
git clone https://github.com/Innei/media-library-organizer-skill.git .claude/skills/media-library-organizer

Then invoke it in Claude Code by telling Claude to organize your media library, or use the slash command:

/media-library-organizer

Standalone Scripts

The scripts/ directory contains standalone bash scripts that can be used independently:

# Scan media directory for issues
./scripts/scan-media.sh /path/to/media

# Check episode completeness
./scripts/check-episodes.sh /path/to/TV/

# Suggest folder name normalization (dry run)
./scripts/normalize-names.sh /path/to/Movie/

Example

Before:

Movie/
  默杀.A.Place.Called.Silence.2024.2160p.HQ.WEB-DL.60fps.H265.10bit.DDP5.1-PTerWEB/
  [白蛇:浮生].White.Snake.Afloat.2024.2160p.120fps.WEB-DL.HEVC.10bit.TrueHD5.1-QHstudIo/
  Zootopia.2016.2160p.DSNP.WEB-DL.DDP5.1.Atmos.DV.H.265-HHWEB/
TV/
  Mobius.S01.2160p.iQIYI.WEB-DL.AAC2.0.HDR.H.265-MWeb/
  Mobius.S01.2025.1080p.WEB-DL.AAC.H264-JKCT/
  [不眠日].Mobius.2025.S01.2160p.WEB-DL.HEVC-QHstudIo/

After:

Movie/
  默杀 (2024)/
  白蛇:浮生 (2024)/
  疯狂动物城 (2016)/
TV/
  不眠日 (2025)/          ← 3 folders merged, best quality kept

Safety

  • Never auto-deletes content — always confirms with user first
  • Tiered safety system — only truly safe junk (SMB residuals, .DS_Store) is removed without asking
  • PT/BT seeding awareness — warns before renaming folders that may be actively seeding
  • Dry-run scriptsnormalize-names.sh only prints suggested renames, never executes

Docs

Detailed step-by-step instructions for each phase:

Common Pitfalls

MistakeFix
Renaming breaks PT/BT seedingConfirm with user if they’re still seeding
Gap detection misses tail truncationMust compare against TMDB total count
macOS grep lacks -P flagUse egrep -o instead of grep -oP
Merging without checking overlapsAlways verify no episode overlap before merge
Guessing Chinese titles from EnglishSearch TMDB for authoritative names

Requirements

  • Bash 4+
  • find, du, awk, egrep (standard Unix tools)
  • TMDB access for episode verification
  • Claude Code (for skill usage)

License

MIT