Claude Code

Claude Code memory that keeps the conversation
One command adds it.

CLAUDE.md and auto memory keep notes. MemoryRouter keeps what you and Claude actually worked out: your decisions, the approach you ruled out, the bug you spent three hours on. In every session, on every machine.

One command. Permanently.

How does Claude Code memory work?

Claude Code starts every session with a fresh context window and carries knowledge forward through two built-in systems. CLAUDE.md files hold the instructions you write, and the ones in your working directory and above it load at every session start. Auto memory, on by default in local sessions, holds notes Claude writes for itself, and only the first 200 lines or 25KB of its MEMORY.md index load at startup. Both are files on your machine, and neither one keeps the conversation itself.

Long sessions also compact. The project-root CLAUDE.md and auto memory come back from disk, but the conversation is summarized, so the reasoning behind a decision and the approaches you ruled out are the details most likely to thin out. MemoryRouter adds persistent conversation memory across sessions and tools on top of the built-ins, without replacing them.

Claude Code memory layers, checked against the Claude Code docs on 2026-10-05
LayerWho writes itWhat loads into a sessionAfter compactionScope
CLAUDE.md filesYouAt launch, from your working directory and every folder above it. Subdirectory files load on demand.Project-root file re-injected from diskProject, user, or organization. The project file is shared through git.
Auto memoryClaude, when it decides a note is worth keepingFirst 200 lines or 25KB of MEMORY.md. Topic files are read on demand.Re-injected from diskOne repository, shared across its worktrees. Machine-local, not shared across machines or cloud environments.
The session conversationYou and Claude, turn by turnOnly in the current sessionSummarized with the rest of the conversationOne session
MemoryRouter vault (added)Hooks save your prompt and the final response of each completed turnRelevant memories recalled before every promptRe-injected through a SessionStart hook on the compact sourceOne vault for every session, repo and machine, shared with your other AI tools

Sources, Claude Code docs: How Claude remembers your project, auto memory storage, what survives compaction, and the hooks reference. Checked .

Weighing other options? Best memory tools for Claude Code in 2026 and what Claude Code memory keeps and loses.

See the difference

NEW SESSION, NEXT MORNING

You: Which retry approach did we rule out yesterday, and why?

Claude: I don't have yesterday's conversation, and my notes for this project don't cover retries. Can you walk me through it?

The notes kept a few facts. The reasoning stayed in yesterday's session.

WITH MEMORYROUTER

You: Which retry approach did we rule out yesterday, and why?

Claude: Client-side retries. The upstream API isn't idempotent, so we moved retries behind the outbox in lib/queue/adapter.ts.

Recalled from yesterday's turns before the prompt reached Claude.

Sound familiar?

Compaction summarizing away the details of a long session

Re-explaining the codebase in every new session

Decisions from last week that Claude has no idea about

With MemoryRouter

Relevant project memory injected before every prompt

Every completed turn saved: your prompt and Claude's final answer. Zero tool noise.

Memory restored automatically after compaction, resume, and fork

Set up in 3 minutes

Grab your memory key, open a terminal in your project, run one command.

Step 1: Install the hooks
$ npx -y memoryrouter-claude init

The installer prompts for your Memory Key, validates it, and asks where to install: this project, this checkout only, or every project on this computer. The key stays in your home folder, never in the repo.

Step 2: Verify
$ npx -y memoryrouter-claude doctor

Start a new Claude Code session, then run doctor. A healthy setup ends with "Automatic memory integration is healthy."

Step 3: Watch it click

Tell Claude one unique fact about the project. Finish the turn. Open a brand new session in the same project and ask for it. It is already there.

OR

Just tell Claude Code to do it

Paste this into a Claude Code session. It asks for your key, runs the install, and verifies everything.

Install MemoryRouter automatic memory hooks for me in this project.

1. Ask me for my MemoryRouter Memory Key (from app.memoryrouter.ai) and wait for my reply before running anything.
2. Check prerequisites: run `node --version`. I need Node 18 or newer.
3. Run: npx -y memoryrouter-claude init
   When the installer prompts for the key, use the one I gave you. Do not write the key into any file in this repository.
4. Run: npx -y memoryrouter-claude doctor
   Report the result in plain language. A healthy setup ends with "Automatic memory integration is healthy."
5. Tell me to start a new Claude Code session in this project, tell you one unique fact, then open another new session and ask for that fact. That is how I confirm memory is working.

Never print, log, or repeat my Memory Key in plain text after I give it to you.

How it works

Without MemoryRouter:

You Claude Code Model Response (gone at compaction)

With MemoryRouter:

You Claude Code (memory recalled on UserPromptSubmit) Model Response (saved on Stop)

Hooks fire at deterministic Claude Code lifecycle points: SessionStart warms the vault, UserPromptSubmit recalls and captures, Stop saves the final answer, and compaction, resume, and fork all re-inject memory. Your Claude account and inference stay exactly where they are. MemoryRouter only stores and retrieves memories.

Pick your scope

Project

./.claude/settings.json

Best for teams. Commit the hook settings and every teammate gets memory. Keys stay private on each machine.

Local

./.claude/settings.local.json

Just you, just this checkout.

User

~/.claude/settings.json

Every project on this computer, all sharing your one vault.

One vault for everything

Every session, every repo, and every connected tool share one memory. Recall ranks by relevance, so the right context surfaces for the work in front of you.

Clean capture

Your prompt and Claude's final answer. Tool calls, patches, thinking, and subagent chatter are excluded automatically.

Survives everything

Compaction, resume, fork, new sessions, new machines, Claude Code updates. Your memory persists through all of it.

Key stays private

Your Memory Key lives under ~/.memoryrouter/ with owner-only permissions. Never in your repo or Claude settings.

Want Claude to search memory on demand too?

Hooks are the automatic engine. Add the MCP connection and Claude also gets explicit search and store tools for when you want to ask directly.

Add explicit memory tools
$ npx -y memoryrouter-claude mcp install --local
Sign in and pick the same vault
$ claude mcp login memoryrouter

All commands

npx -y memoryrouter-claude init # Install or upgrade hooks

npx -y memoryrouter-claude doctor # Health check

npx -y memoryrouter-claude status # Vault stats and OAuth vault match

npx -y memoryrouter-claude mcp install --local # Explicit MCP tools

npx -y memoryrouter-claude off # Remove hooks

npx -y memoryrouter-claude off --purge # Remove hooks and local state

Start free. Then just $20/mo.

14-day free trial. Cancel anytime.

14-DAY FREE TRIAL
$20/mo
200M tokens included every month
  • 200M memory tokens / mo included
  • Unlimited projects
  • Same memory in ChatGPT, Claude, Codex, and OpenClaw
  • 300 to 500 ms average recall on a typical vault
  • Your keys, your data, your control
Start free

No inference markup, ever.

FAQ

Never lose a session to compaction again

14 days free. Three minutes to install. Tomorrow's first session already knows everything from today.

Start free