feat(claudecode): bidirectional sync with Claude Code native memory folder#203
feat(claudecode): bidirectional sync with Claude Code native memory folder#203jorgehara wants to merge 3 commits intoGentleman-Programming:mainfrom
Conversation
- Add internal/claudecode package with export/import/sync functionality - Export Engram observations to Claude Code's native memory folder as .md files - Import memories from Claude Code's memory folder into Engram - Add CLI commands: claude-code-export, claude-code-import, claude-code-sync - Support bidirectional sync between Engram and Claude Code memory - Allow users who switch between Claude Code native and other agents to have unified memory
- Add lazy bidirectional sync: when mem_search is called, automatically import new memories from Claude Code's native memory folder - Consistent with Engram philosophy: agent-driven, no auto-capture, import only on explicit user request (search) - Add comprehensive tests for Claude Code memory import - Add documentation explaining the feature and design decisions for Alan This enables users who switch between Claude Code native and other agents to have unified memory without manual sync steps.
PR Update: Lazy Import for Claude Code Memory Sync ✅Hi Alan! This PR adds bidirectional sync between Engram and Claude Code's native memory folder. Test ResultsAll tests passing: Key Design DecisionInstead of auto-sync on startup (which goes against Engram's "no auto-capture" philosophy), we use lazy import: when user calls This is consistent with how the OpenCode plugin handles Bug Fixed During TestingFound and fixed: Files
DocumentationSee Looking forward to your feedback! 🙏 |
Add 'engram agents' command that detects and shows usage statistics for all AI coding agents on the system (Claude Code, Gemini CLI, OpenCode, Cursor, Codex). Features: - Reads native history files from each agent - Shows sessions, projects, and activity range per agent - ASCII bar chart visualization for easy comparison - JSON output for scripting (--json flag) - Read-only, no data written to Engram store Consistent with Engram philosophy: simple, agent-driven, no auto-capture.
|
Closes #212 |
Summary
Add bidirectional sync between Engram and Claude Code's native memory folder (
~/.claude/projects/{slug}/memory/).Problem
Users who switch between Claude Code native and other agents (OpenCode, VS Code, JetBrains, etc.) have two disconnected memory systems:
.mdfiles in~/.claude/projects/{slug}/memory/~/.engram/engram.dbThis means:
Solution
New
engram claude-code-synccommand (andclaude-code-export/claude-code-importvariants) that synchronizes memories bidirectionally:Options:
--claude-projects-dir— Override default~/.claude/projects--project— Filter sync to a specific project--dry-run— Preview without making changesChanges
internal/claudecode/claudecode.gointernal/claudecode/markdown.gointernal/claudecode/exporter.gointernal/claudecode/importer.gointernal/claudecode/sync.gointernal/claudecode/claudecode_test.gocmd/engram/main.goTest Plan
go test ./internal/claudecode/...passesgo build ./cmd/engram/...succeeds.mdfiles are createdengram searchThis PR resolves a gap for users who prefer working in multiple IDEs/agents but want a unified memory system that works regardless of which agent they're using at any given moment.