一键导入
memory-backup
Backs up auto-memory files to a private GitHub repo. One-command setup, committed daily via Task Scheduler (or on-demand). Restore is a single clone.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Backs up auto-memory files to a private GitHub repo. One-command setup, committed daily via Task Scheduler (or on-demand). Restore is a single clone.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Show token / tool usage stats from the local telemetry log. Use when you want to know "which tools am I burning context on", "which skills are expensive", or "was yesterday's session mostly Read/Grep or actually productive".
Parallel quality audit with 7 specialized agents (Opus). Finds bugs, violations, and quality issues. Use audit for fixes, brainstorm for features.
Manage environment variables with Doppler — auto-install CLI, login, link projects, wrap commands with `doppler run`. Replaces scattered .env files with a hub/spoke architecture.
Scaffolds new projects or onboards existing ones. Detects stack, creates monorepo/single-app, configures strict tooling. Use for greenfield or first-time setup.
Archives completed stories from prd.json to reduce token usage.
Autonomous task execution with testing and security. Works through all tasks without stopping.
| name | memory-backup |
| description | Backs up auto-memory files to a private GitHub repo. One-command setup, committed daily via Task Scheduler (or on-demand). Restore is a single clone. |
| triggers | ["memory backup","backup memory","restore memory"] |
| allowed-tools | Bash, Read, Write, Edit, Glob |
| model | opus |
| user-invocable | true |
| argument-hint | [setup|now|restore|status] |
Version-controlled snapshot of ~/.claude/projects/*/memory/ in a private GitHub repo. Survives Windows reinstalls, gives you git diff on your agent memory over time.
ONLY:
~/.claude/projects/*/memory/*.md — auto-memory, feedback files, project notes~/.claude/CLAUDE.md — global user config (if present)~/.claude/rules/*.md — shared rulesNOT:
~/.claude/projects/*/sessions/ — session JSONL (huge, ephemeral)~/.claude/projects/*/tasks/ — native tasks (per-session, ephemeral)~/.claude/hooks/, ~/.claude/skills/, ~/.claude/agents/ — live in claude-auto-dev repo already~/.claude/settings.json — may contain machine-specific paths, regenerated from repo# 1. Create the private repo
gh repo create $(gh api user --jq .login)/claude-memory --private --description "Auto-memory backups (claude-auto-dev)" --clone --add-readme
cd claude-memory
# 2. Initial snapshot
mkdir -p memory rules
cp -r ~/.claude/projects memory/projects-raw # we'll filter next
# Keep only memory/ subdirs, drop everything else
find memory/projects-raw -mindepth 2 -maxdepth 2 -type d ! -name memory -exec rm -rf {} +
# Flatten: projects/<slug>/memory/*.md → projects/<slug>/*.md
# (keeping slug as dir so we know which project)
mv memory/projects-raw memory/projects
cp ~/.claude/CLAUDE.md . 2>/dev/null || true
cp -r ~/.claude/rules . 2>/dev/null || true
# 3. Commit
git add .
git commit -m "feat: initial memory snapshot"
git push -u origin main
# 4. Save repo path for future runs
echo "$(pwd)" > ~/.claude/.memory-backup-path
Report the repo URL. User should bookmark it.
memory backup now (on-demand sync)BACKUP_DIR=$(cat ~/.claude/.memory-backup-path)
cd "$BACKUP_DIR"
# Refresh memory/ subtree
rm -rf memory/projects
mkdir -p memory/projects
for dir in ~/.claude/projects/*/; do
slug=$(basename "$dir")
if [ -d "$dir/memory" ]; then
cp -r "$dir/memory" "memory/projects/$slug"
fi
done
# Refresh top-level files
cp ~/.claude/CLAUDE.md . 2>/dev/null
rm -rf rules && cp -r ~/.claude/rules . 2>/dev/null
# Commit only if changed
if ! git diff --quiet || ! git diff --cached --quiet; then
git add .
git commit -m "backup: $(date +%Y-%m-%d\ %H:%M)"
git push 2>&1 | tail -3
echo "Backed up."
else
echo "No changes since last backup."
fi
memory backup statusBACKUP_DIR=$(cat ~/.claude/.memory-backup-path 2>/dev/null) || { echo "Not set up. Run 'memory backup setup'."; exit 0; }
cd "$BACKUP_DIR"
echo "Repo: $(git config --get remote.origin.url)"
echo "Last commit: $(git log -1 --format='%ar — %s')"
echo "Local memory dir timestamps:"
ls -la ~/.claude/projects/*/memory/*.md 2>/dev/null | awk '{print $NF, $6, $7, $8}' | sort | tail -10
memory restoreAfter Windows reinstall, restore memory state in one command:
# Assumes you've already installed claude-auto-dev (hooks/skills/agents)
gh repo clone $(gh api user --jq .login)/claude-memory ~/claude-memory
cd ~/claude-memory
# Restore memory files
for dir in memory/projects/*/; do
slug=$(basename "$dir")
mkdir -p ~/.claude/projects/$slug/memory
cp -r "$dir"/* ~/.claude/projects/$slug/memory/ 2>/dev/null
done
# Restore CLAUDE.md + rules
cp CLAUDE.md ~/.claude/CLAUDE.md 2>/dev/null
cp -r rules ~/.claude/ 2>/dev/null
# Save path for future backups
echo "$(pwd)" > ~/.claude/.memory-backup-path
echo "Restored. Memory loaded on next Claude session start."
Create ~/claude-memory/backup.cmd:
@echo off
cd /d %USERPROFILE%\claude-memory
bash -c "source ~/.claude/hooks/memory-backup.sh"
Register task (runs at 11 PM daily):
$action = New-ScheduledTaskAction -Execute "$env:USERPROFILE\claude-memory\backup.cmd"
$trigger = New-ScheduledTaskTrigger -Daily -At "23:00"
$settings = New-ScheduledTaskSettingsSet -StartWhenAvailable -DontStopOnIdleEnd
Register-ScheduledTask -TaskName "ClaudeMemoryBackup" -Action $action -Trigger $trigger -Settings $settings -Description "Daily backup of ~/.claude/projects/*/memory/"
Verify it runs:
Get-ScheduledTask -TaskName "ClaudeMemoryBackup" | Get-ScheduledTaskInfo
~/.claude/secrets/ or anything under ~/.claude/projects/*/tasks/ — those can contain ephemeral sensitive state.env values never touch memory files (that's Doppler's job).gitattributes LFS rule for files >10MBauto — on session end (via Stop hook), fires background memory backup now if repo existsiterate — after convergence, commits the new learningssetup-project offers to restore memory first