Claude Code Integration

Persistent memory for Claude Code

What you discussed yesterday, your decisions, your project context: available in every session, on every machine. And it survives compaction.

The whole install
$ npx memoryrouter-claude init
Get your memory key →

14-day free trial. No charge today. 2-minute setup.

Sessions start cold. Compaction eats context.

Cold sessions

Every new session starts from CLAUDE.md plus local notes. The conversational context you built yesterday (what you tried, what failed, what you decided) is not there. So you re-explain, or your agent rediscovers things it already learned.

Compaction loss

Long sessions hit the context limit and Claude Code compacts the conversation into a summary. The specifics are gone: exact errors, exact reasoning, the thing you said once. Your agent ends up working from a paraphrase of its own past.

Stuffing everything into CLAUDE.md does not scale: the file bloats, every session pays the full token cost, and most of it is irrelevant to the task at hand. Static context is not memory. You need retrieval.

How it works: five hooks

memoryrouter-claude wires five Claude Code hooks. No daemon, no wrapper binary, no patched install.

1

SessionStart

Warms up your memory vault so the first retrieval of the session is instant.

2

UserPromptSubmit

Calls /v1/memory/prepare on every prompt and injects the relevant memories before the model sees your message. Not your whole history. The relevant slice.

3

Stop

Captures each turn to memory as you work. Context accumulates continuously, not in a batch at the end.

4

PreCompact

Flushes the full conversation to memory BEFORE compaction destroys it. The context window shrinks. The memory does not.

5

SessionEnd

Final flush on exit so the tail of every session is preserved.

# every prompt:

you type → relevant memories injected → Claude answers with yesterday's context in hand

# every turn:

exchange captured to your vault → memory compounds as you work

Compaction-proof memory

The PreCompact hook flushes the entire conversation to your vault the moment before Claude Code compacts it. Compaction still happens, your context window still gets reclaimed, but nothing is destroyed.

Three hours later (or three weeks later, on a different machine) you ask about that fix and it comes back, specifics intact. Memory inside the context window is temporary. Memory outside it compounds.

Built to be trusted

🛡️ Fails open

If the API is down, slow, or unreachable, every hook exits cleanly and Claude Code proceeds untouched. Memory is an enhancement, never a gate. Your agent is never blocked by our uptime.

📦 Zero dependencies

The npm package has no dependencies. What you install is what runs. Audit it yourself on npm.

🔒 Your key stays local

Stored at ~/.memoryrouter/config.json with 0600 permissions. Never written into your Claude Code settings or your repo.

🔄 Clean on, clean off

Non-destructive settings merge on install. npx memoryrouter-claude off removes the hooks and restores your settings. status shows vault stats anytime.

All commands

npx memoryrouter-claude init # wire the hooks, store your key

npx memoryrouter-claude status # vault stats

npx memoryrouter-claude off # clean uninstall, settings restored

Pricing

14-day free trial on every plan. No charge today. BYOK, no inference markup.

Starter

$20/mo

200M tokens included

then $0.50/1M

Growth

$100/mo

1B tokens included

then $0.20/1M

Scale

$200/mo

2B tokens included

then $0.10/1M

Two minutes to a Claude Code that remembers

Grab a key, run npx memoryrouter-claude init, and your next session starts with yesterday's context. If it is not obviously better within the trial, one command turns it off.