The missing feedback loop between claude-memory-extractor and Claude Code's built-in MEMORY.md.
~/.claude/memories/extracted/*.md --> memory-sync --> MEMORY.md
(obra's output) (Claude Code's input)
Claude Code writes MEMORY.md during sessions — what it notices is important. But it has blind spots. You can have a session where it carefully notes one bug fix but completely misses a bigger mistake in the same conversation.
obra's memory extractor runs post-session over transcripts and catches what the agent missed: recurring patterns, implicit preferences, debugging strategies that worked. It scores each insight by confidence.
But these systems are disconnected. Extracted insights sit in ~/.claude/memories/extracted/ and never feed back into MEMORY.md for the next session.
memory-sync closes that loop.
# No dependencies. Just Python 3.12+.
git clone https://github.com/anupamchugh/memory-sync.git
cd memory-sync# See what you've got
python memory_sync.py --stats
# Preview what would sync (dry run)
python memory_sync.py --dry-run
# Sync high-confidence memories to all project MEMORY.md files
python memory_sync.py
# Sync to a specific project
python memory_sync.py --memory-md ~/.claude/projects/-Users-me-myproject/memory/MEMORY.md
# Only recent memories, higher threshold
python memory_sync.py --since 2026-02-01 --min-confidence 4.0
# List all your project memory locations
python memory_sync.py --list-projects- Reads all extracted memories from
~/.claude/memories/extracted/ - Filters by confidence score (default: >= 3.5)
- Deduplicates against existing MEMORY.md content
- Appends high-quality insights, respecting the 200-line limit
- Sorts by confidence (best insights first)
The confidence threshold is the curation layer. Not "remember everything" or "remember nothing" — remember what a second pass confirmed was worth remembering.
| Flag | Default | Description |
|---|---|---|
--min-confidence |
3.5 | Minimum confidence to sync (0-5) |
--since |
None | Only sync after this date |
--max-lines |
190 | MEMORY.md line limit (200 truncates) |
--dry-run |
false | Preview without writing |
--stats |
false | Show memory statistics |
--list-projects |
false | List all MEMORY.md locations |
Add to .claude/hooks/post_session.sh:
#!/bin/bash
python ~/Desktop/workspace/memory-sync/memory_sync.py --min-confidence 4.0Or as a cron job:
# Sync daily at midnight
0 0 * * * python ~/Desktop/workspace/memory-sync/memory_sync.py --min-confidence 3.5In-session memory and post-session extraction have orthogonal failure modes:
| System | Writes When | Blind Spot |
|---|---|---|
| MEMORY.md | Agent notices something | Agent's own mistakes |
| Extractor | Transcript review | Nothing — reads everything |
The gap was: extraction results never became next-session memory. This tool is the bridge.
- obra/claude-memory-extractor — the extraction engine
- Claude Code's memory system — the consumption side