summaryrefslogtreecommitdiffstats
path: root/configs/claude
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 18:20:19 +0000
committertv <tv@krebsco.de>2026-11-21 21:29:02 +0000
commit836f55385d6c6455da480e032ffc8e06b41bb265 (patch)
tree21eee7d14ffda831de2ce35cc202bc032a297ef0 /configs/claude
parentde94bcca581de95c7edff9f8febbde115ba7e11c (diff)
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.
Diffstat (limited to 'configs/claude')
-rw-r--r--configs/claude/rsync-filter46
1 files changed, 46 insertions, 0 deletions
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