ai-memory: Git-based Long-term Memory for Coding Agents

The ai-memory project provides long-term memory for coding agents by storing notes as plain Markdown files in a Git repository, avoiding vector databases. Notes are searchable, can be opened with Obsidian, and remain fully portable. It automatically records prompts, tool calls, and session nodes via hooks, turning the coding process into documentation. A key feature is handoff: when switching between supported tools like Claude Code, Codex, Cursor, or Gemini CLI, the new agent sees a summary of previous progress, architecture decisions, and failed attempts, eliminating the need to re-explain context. The project supports over 15 coding tools.
Key insights
Git-Based Memory Ensures Portability and Ownership of Notes
ai-memory stores all agent memory as plain Markdown files in a Git repository, meaning users can search, open with Obsidian, or back up the entire memory without vendor lock-in. Even if the tool is abandoned, the documentation remains fully accessible and owned by the user.
Automatic Recording via Hooks Reduces Manual Maintenance
The system uses hooks to automatically log prompts, tool calls, and session nodes, so the coding process itself generates the memory. This eliminates the need for developers to manually document context, making long-term memory effortless.
Handoff Feature Solves Context Loss When Switching Coding Tools
When a developer switches from Claude Code to Codex or another supported tool, ai-memory provides a summary of where the previous session left off, including architecture decisions and failed approaches. This avoids repetitive context-setting and streamlines multi-tool workflows.