# The claude layer's state worth a backup, as rsync filter rules (a # blacklist, so what's new gets backed up, too), for /home/ of a guest # with configs/claude.nix, e.g., from the host, as root in the guest: # # rsync -aHAX --numeric-ids --delete --delete-excluded -e ssh \ # --filter='merge configs/claude/rsync-filter' root@GUEST:/home/ BACKUP/ # # What that keeps: the repositories in ~claude/src (uncommitted files, # branches only there), the remotes' directories (worktrees, notes), their # transcripts, memory, links to claude.ai sessions (~claude/.claude/projects), # files handed to them (~claude/.claude/uploads), trust and settings # (~claude/.claude.json), and the remotes started with claude-remote # (/home/.var/lib/claude). uids are fixed, so --numeric-ids holds. # # To restore: into a fresh home image, at the same paths (worktrees # record theirs), then, as root, runuser -l claude -c 'claude auth login', # as the login isn't in the backup. # # Keep this up to date with what the layer and Claude Code put there. # Scratch: never backed up. ~claude/src/tmp holds repositories not worth # a backup (third parties', like nixpkgs), with a symlink in ~claude/src # each (which gets backed up, as a symlink). - /claude/tmp/ - /claude/remotes/*/tmp/ - /claude/src/tmp/ # A secret (the claude.ai login); log in again after a restore. - /claude/.claude/.credentials.json - /claude/.cargo/credentials.toml # Rebuildable, transient, or synced again from the account. - /lost+found/ - /claude/.cache/ - /claude/.cargo/registry/ - /claude/.cargo/git/ - /claude/.claude/backups/ - /claude/.claude/bridge-spawn/ - /claude/.claude/cache/ - /claude/.claude/session-env/ - /claude/.claude/sessions/ - /claude/.claude/shell-snapshots/ - /claude/.claude/plugins/ - /claude/.claude/skills/synced/ - /claude/.claude/.last-cleanup - /claude/.claude/mcp-needs-auth-cache.json