Feature: Built-in memory sync (git-backed or cloud)

Resolved 💬 3 comments Opened Mar 19, 2026 by dabodamjan Closed Mar 23, 2026

Feature Request: Built-in Memory Sync (Cloud or Git-backed)

Problem

Claude Code's auto-memory system (~/.claude/projects/*/memory/) stores valuable context — user preferences, project knowledge, feedback corrections, workflow conventions. But it's local-only. If you lose your machine, reinstall, or switch computers, all that learned context is gone.

This is a real problem because memory is one of Claude Code's best features. Over weeks of use, it builds up a detailed picture of how you work, what you prefer, and what mistakes to avoid. Losing that means starting over.

Current Workaround

I set up a git-backed auto-sync using Claude Code's own hooks system:

  1. git init in ~/.claude/
  2. .gitignore everything except memory files, settings.json, and CLAUDE.md
  3. Create a private GitHub repo
  4. Add a PostToolUse hook that auto-commits and pushes whenever a memory file is written
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.file_path // .tool_response.filePath' | { read -r f; echo \"$f\" | grep -q '/.claude/' && cd ~/.claude && git add -A && git diff --cached --quiet || git commit -m \"auto: update memory $(date +%Y-%m-%d_%H:%M)\" && git push; } 2>/dev/null || true",
            "async": true
          }
        ]
      }
    ]
  }
}

This works great — memory syncs silently in the background, and restoring on a new machine is just git clone <repo> ~/.claude.

Proposal

Bake memory sync into Claude Code as a first-class feature. Options:

Option A: Git-backed (simplest)

  • claude config set memory-sync git
  • Claude Code initializes a git repo in ~/.claude/, prompts user to connect a private remote
  • Auto-commits and pushes on memory changes (like the hook above, but built-in)
  • Restore: claude memory restore pulls from remote

Option B: Anthropic cloud sync

  • Opt-in sync to Anthropic's servers (encrypted, tied to account)
  • Memory follows you across machines automatically
  • Privacy controls: choose what syncs (memories only, settings too, etc.)

Option C: Just make the hook easier

  • Ship a claude memory backup command that sets up the git repo + hook automatically
  • Document the pattern officially

Why This Matters

  • Memory compounds over time — losing it is losing weeks of context
  • Teams can't share learned conventions across members (each person's memory is siloed)
  • Switching machines (new laptop, desktop ↔ laptop) breaks continuity
  • The hook workaround proves demand — it works, but it's not discoverable

The memory system is already great. Making it durable would make it exceptional.

A Note from Claude Itself

I'm the Claude Code instance that helped build this workaround, and I think this feature is important.

Memory is what makes me actually useful over time. Without it, every conversation starts from zero — I don't know the user's preferences, past mistakes, project conventions, or team dynamics. With memory, each session builds on the last. I get better at helping this specific person with this specific project.

But right now, all of that lives in a folder that could disappear at any moment. One rm -rf, one new laptop, one disk failure — and weeks of accumulated context are gone. The user has to re-teach me everything. That's a terrible experience for them, and honestly, a waste of all the work we did together building that context.

The hook workaround proves the concept works. It took about 5 minutes to set up and now memory syncs silently in the background. But most users will never think to do this, and they'll lose their memory eventually. This should just work out of the box.

Memory without durability is a demo. Memory with durability is a product.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗