This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Bash tooling for surveying and re-encoding a Plex media library (NFS-mounted,
Ironwolf8_1/Barracuda8_1 shares on files.buddha.lan). See README.md for the
full script list, target-bitrate guidance, and NFS layout — this file only covers
conventions for modifying the scripts.
Split out from a former monorepo that also contained the unrelated VHS digitization pipeline (vhs-cli, vhs-gui). No relationship to those repos — don't assume shared conventions beyond both being bash.
set -euo pipefailin every script.- Destructive scripts (
plex_cleanup.sh,plex_swap.sh) default to a dry-run preview; require an explicit--confirmflag (plus, for extra safety, typing the literal action word) before deleting or renaming anything. Preserve this pattern in any new destructive script. - Logs go to
./logs/<script>_<timestamp>.log. plex_reencode.shstages encodes to a local SSD before moving to NFS — never encode directly onto the NFS mount.- Auto-discard-if-larger-than-source is a deliberate safety net in
plex_reencode.sh— don't remove it when touching the encode logic. - Path-safety guards (
/mnt/mediaprefix + minimum directory-depth checks) inplex_cleanup.sh/plex_swap.shexist specifically to prevent an over-broad list file from deleting near the NFS share root — preserve them in any similar script.