Best Memory Tools for Claude Code (2026)
Five tools that give Claude Code memory across sessions, agents and machines, with install commands, honest caveats and when CLAUDE.md is enough.
By agentools
- Engram: Simple local memory, one binary
- ai-memory: Switching agents mid-task
- Graphicle: Code graph plus project memory
- Beads: Long tasks that survive compaction
- Mem0: Hosted memory with semantic search
Every new Claude Code session starts with the agent knowing nothing about yesterday. It forgets the decision you made about the auth flow, the test that is flaky on purpose, and the half-finished refactor you stopped in the middle of. You spend the first ten minutes re-explaining, or you let it rediscover things the slow way and pay for the tokens.
Before installing anything, be honest about whether you need a tool. Claude Code already reads CLAUDE.md files at the start of every session and keeps its own auto memory notes per project. If you work alone, in one repo, with one agent, a well kept CLAUDE.md gets you most of the way for free.
A memory tool starts paying off when one of these is true: you switch between Claude Code, Codex and Cursor in the same project, you work across several machines or with a teammate, your project notes have outgrown one file, or long tasks keep getting lost when the context compacts. The five tools below each solve a different version of that problem. Install commands come from each project's own docs.
At a glance
| Tool | Best for | Pricing | Type |
|---|---|---|---|
Engram | Simple local memory, one binary | Open source | MCP server and CLI |
ai-memory | Switching agents mid-task | Open source | Memory server + CLI |
Graphicle | Code graph plus project memory | Open source | CLI + MCP server + local app |
Beads | Long tasks that survive compaction | Open source | CLI |
| Hosted memory with semantic search | Free tier | API + SDK |
The 5 picks

1. Engram
Local persistent memory for any coding agent, in one binary
Engram is a single Go binary with SQLite full text search behind an MCP server, a CLI, an HTTP API and a terminal UI. The agent saves decisions and context per project and recalls them in the next session. It detects the project from the repo, so memories from one codebase do not leak into another, and engram tui lets you browse what the agent has stored, which I find more reassuring than a black box.
brew install gentleman-programming/tap/engram
engram setup claude-code
Setup installs a Claude Code plugin with hooks; restart Claude Code afterwards. The same engram setup command supports Codex, Cursor, Gemini CLI, OpenCode and about ten others. The caveat: search is full text, not semantic, so memories need the right words to come back. Cloud sync exists but is optional, and it is MIT licensed.
Pricing: Open sourceMCP server and CLI

2. ai-memory
One shared memory for every coding agent you switch between
ai-memory by Fabio Akita targets the exact pain of quitting Claude Code mid-task and opening Codex in the same folder. The second agent picks up a handoff with where you left off, what failed and what is still open. It works across more than twenty harnesses and stores memory as plain markdown in a git-backed wiki, so you can read and edit it yourself.
curl -fsSL https://github.com/akitaonrails/ai-memory/releases/latest/download/install.sh | sh
ai-memory setup
The installer checks the release checksum, and ai-memory setup shows a plan of every agent it will wire before it changes anything. Claude Code users can also install it as a plugin: claude plugin marketplace add akitaonrails/ai-memory && claude plugin install ai-memory@ai-memory. The caveat: it runs a background per-user service, which is more moving parts than a plain MCP server. It is MIT licensed with no paid tier.
Pricing: Open sourceMemory server + CLI

3. Graphicle
Code graph and project memory for coding agents in one local Rust program
Graphicle combines two things most people run separately: a code graph of the repo (calls, imports, impact) and a memory of docs, decisions and past agent sessions. Every excerpt it returns cites the exact file and lines, and memories the agent writes wait for your approval before they count. It runs locally with no account, no API key and no telemetry.
brew install graphicle-ai/tap/graphicle
cd your-repo
graphicle setup
Setup indexes the repo, connects the agents it finds, turns on session capture and installs Git hooks to keep the index current. It lists and backs up every file it changes, and graphicle disconnect undoes all of it. The caveat: it touches your repo (hooks and an AGENTS.md section unless Claude Code is the only agent), so read the change list before you accept.
Pricing: Open sourceCLI + MCP server + local app

4. Beads
Issue tracker and memory built for coding agents
Beads is memory shaped like an issue tracker. Instead of a loose markdown TODO file, the agent works from a dependency-aware task graph: it asks what is ready, claims a task, closes it and records durable facts. When the context compacts halfway through a big job, the plan is still there, and several agents can share one backlog without stepping on each other.
brew install beads
cd your-project
bd init
bd setup claude
There is also npm install -g @beads/bd if you prefer npm. The caveat: it remembers work, not general knowledge. It will not recall why you picked Postgres last month unless that ended up in a task, so it pairs well with one of the other tools here.
Pricing: Open sourceCLI
5. Mem0
Long-term memory layer for AI agents
Mem0 is the best known memory layer for AI apps, and it now ships a Claude Code plugin with hooks that recall memories on your first prompt and extract new ones in the background. Search is semantic, so a memory about "payment retries" can come back when you ask about "failed charges".
claude plugin marketplace add mem0ai/mem0
claude plugin install mem0@mem0-plugins --scope user --config api_key="$MEM0_API_KEY"
The caveats: the plugin uses the hosted platform, so your project notes leave your machine, and you need an API key. The Hobby tier is free with 10,000 adds and 1,000 retrievals a month; Starter is $19 a month. The open source library can be self-hosted, but that is more work than any other option here.
Pricing: Free tierAPI + SDK
More to consider
Hy MemoryChat, working and coding memory for agentsObsidian-TCAn Obsidian MCP server with permissions, audit logs and memory inside your vault
Context ModeContext saving, memory and guardrails for coding agents
XERJLocal search engine so coding agents stop reading files one by one
SerenaThe IDE for your coding agent
How I would choose
- One agent, one repo: stay with
CLAUDE.mdand Claude Code's own memory. Add a tool only when you feel the gap. - Local, simple, inspectable: Engram.
- You hop between Claude Code, Codex and Cursor: ai-memory, since handoffs are its whole point.
- Big codebase where the agent keeps getting lost: Graphicle, because the code graph cuts down on blind file reads.
- Multi-day features and parallel agents: Beads, often next to Engram or ai-memory.
- You want semantic recall and do not mind a hosted service: Mem0.
Pick one. Running two general memory servers at once gives the agent two places to look and two sets of instructions competing for context.
Memory is not free
Every memory tool adds MCP tool definitions to the context and, if it uses hooks, injects recalled notes into prompts. Bad memories are worse than none: an outdated decision that keeps getting recalled will steer the agent wrong for weeks. I review stored memories every so often and delete anything stale, which is why I value tools with a browser or plain files.
If your real problem is the agent reading too much code rather than forgetting, a search tool like XERJ or Serena may help more than memory. I cover those in 7 tools to cut your coding agent's token bill. For notes that already live in Obsidian, Obsidian TC puts permissions and an audit log between the agent and your vault.