From 836f55385d6c6455da480e032ffc8e06b41bb265 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 Nov 2026 18:20:19 +0000 Subject: configs/claude/rsync-filter: what of the claude layer's state to back up rsync filter rules for /home/ of a guest with configs/claude.nix: a blacklist of scratch (the remotes' tmp, never backed up, and src/tmp, for repositories not worth a backup, like third parties', symlinked from src), the claude.ai login (a secret; claude auth login again after a restore), and what's rebuildable, transient, or synced again from the account (caches, the crates cargo fetched, Claude Code's sessions, snapshots, plugins). What remains: the repositories (uncommitted files, branches only there), the remotes' directories, transcripts, memory, links to claude.ai sessions, uploads, trust and settings, and the remotes started with claude-remote. With how to use it, and how to restore. --- configs/claude/rsync-filter | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 configs/claude/rsync-filter (limited to 'configs') diff --git a/configs/claude/rsync-filter b/configs/claude/rsync-filter new file mode 100644 index 0000000..fff398d --- /dev/null +++ b/configs/claude/rsync-filter @@ -0,0 +1,46 @@ +# 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 -- cgit v1.3.1