Back to Blog
TutorialMay 8, 20268 min read

How to Add Persistent Memory to Claude Code in 2 Minutes

Stop re-explaining your codebase to Claude Code every session. Connect MemoryLake via MCP and let your assistant pick up exactly where you left off — free for individual developers.

Watch: Claude Code blanks on a new session → MemoryLake connected → Claude Code answers as if no time had passed.

The Stateless Problem

Inside a single Claude Code session, the assistant is sharp. It reads your code, follows your reasoning, and remembers the design choices you have made over the last hour. Then you close the terminal, open it again the next morning, and the slate is blank.

You re-explain the project structure. You re-paste the key files. You re-tell it "we use Result<T, E> here, never try/catch." You re-explain why the monorepo uses pnpm but the lambdas use npm. Every. Single. Session.

This is not an Anthropic bug — Claude Code is stateless by design. Sessions are independent on purpose, so that nothing leaks between tasks or repos. But that design choice leaves a gap: there is no place for the things you want Claude Code to remember forever. The fix has to live outside the product itself, as a dedicated memory layer the assistant can read from at session start and write to as you work.

What MemoryLake Adds

MemoryLake is that memory layer. It runs alongside Claude Code, not inside it. Once connected over MCP (Model Context Protocol), Claude Code automatically pulls in the relevant project memory when a session starts and archives new context as you work — architectural decisions, naming conventions, the trade-offs you discussed last week, even the rationale for choosing one library over another.

You do not fork Claude Code, wrap it, or change how you invoke it. There is no custom CLI to learn. The MCP server is standard, the config is one JSON block, and the memory store lives on MemoryLake — not on Anthropic's infrastructure. Anthropic only ever sees the specific memory snippets that get injected into the prompt for the current message.

A few practical properties matter. Branch-aware context means the right memory loads with the right git branch. Team-shared memory means you and a teammate can share the same project store with role-based access. Cross-tool portability means the same memory is reachable from Cursor, OpenClaw, Cline, or any other MCP client — so the work you put into one tool is not stranded there.

Two-Minute Setup

Step 1 — Sign up at app.memorylake.ai. There is no credit card requirement for individual use; the free tier is sufficient for a single developer working across multiple projects. Once signed up, create a project to scope this memory store (e.g., "acme-api" or "personal-side-projects").

Step 2 — Add the MCP server to Claude Code. From your MemoryLake dashboard, copy the MCP config block. It looks like this: { "mcpServers": { "memorylake": { "url": "https://mcp.memorylake.ai", "headers": { "Authorization": "Bearer YOUR_TOKEN" } } } }. Paste it into your Claude Code settings under MCP Servers.

Step 3 — Open a new session. The first time the gateway connects, MemoryLake handshakes and registers the project. From that moment on, every Claude Code session in this repo loads the relevant memory automatically at session start and archives important new context as you work. Total wall-clock time: about two minutes, most of it spent waiting for the page to load.

How It Works Alongside /context

Claude Code already has a native /context command. It is great at what it does — pulling specific files and chunks into the active session — but it has no notion of persistence. When the session ends, /context is gone.

MemoryLake is the complement, not the replacement. Think of /context as your short-term workspace (what is on the desk right now) and MemoryLake as your long-term project memory (what is in the filing cabinet). The two are designed to coexist: short-lived working context stays in /context for the session, while long-lived architectural decisions, conventions, and prior conversations live in MemoryLake and are pulled in automatically when relevant.

There is no setup needed to make them work together. The MCP server registers MemoryLake as one more context source Claude Code can read from. If you use /context to load a file, that does not also store the file in MemoryLake — and vice versa. Each tool is doing what it is best at, and you do not have to think about the seam.

What Engineers Use It For

"Claude Code remembered an architecture trade-off we discussed three weeks ago — no re-explanation needed. I had completely forgotten the rationale myself, and it surfaced the right reasoning when I asked about a related change."

"Switched git branches and Claude Code knew the context that belonged to each branch. The feature branch had its own design notes; the main branch had the production guardrails. Same repo, different brain depending on where I was."

"Shared the same project memory with a teammate. Their Claude Code picked up where mine left off — the project conventions, the open questions, the decisions in flight. Onboarding a new engineer to the repo went from a week of pairing to about half a day."

FAQ

Does it work alongside Claude Code's native /context command?

Yes — they are complementary. Short-term context stays in /context for the active session; long-term project memory lives in MemoryLake and is loaded automatically. There is no configuration conflict, no priority order to set.

Does it slow Claude Code down?

Memory loads happen asynchronously at session start. End-to-end latency impact is under 100ms — imperceptible during a normal workflow. Retrieval during a session adds about 50ms to context assembly, which is rounding error compared to LLM inference time.

Can my team share Claude Code memory?

Yes. Create a team project in MemoryLake; all members' Claude Codes can read from and write to the same memory store, with role-based access. Personal memories stay private; team memories are shared. Memberships are managed from the dashboard.

Does Anthropic see my MemoryLake data?

Only the memory snippets that get injected into the prompts you send to Claude. The underlying memory store lives separately on MemoryLake's infrastructure, not Anthropic's. You can audit exactly what gets injected from the MemoryLake dashboard.

Does it work with the Claude Code desktop app, CLI, and IDE plugins?

Yes — anywhere Claude Code supports MCP servers, MemoryLake works. The same memory project is reachable across surfaces, so the rationale you discussed in the desktop app is available in the CLI the next morning.

Conclusion

Claude Code is one of the sharpest coding assistants available, and statelessness is a deliberate, defensible design choice — but it leaves a gap that every serious engineer feels by the second week of use. The fix is not to wait for Anthropic to ship persistence; the fix is to add a memory layer that lives outside the product and works the same regardless of which model you are calling.

MemoryLake fills that gap in two minutes. Add the MCP server, open a new session, and the assistant stops being a sharp stranger every morning. The compounding value shows up around week two — when you ask a question and Claude Code already knows the answer it gave you ten sessions ago.

Set it up once. Stop re-explaining your project. That is the whole pitch.

Set up Claude Code memory

Free for individual developers. Two minutes from signup to your first persisted memory.

References

  1. Anthropic. (2025). "Model Context Protocol (MCP) Specification." modelcontextprotocol.io
  2. MemoryLake. (2026). "Claude Code Integration Guide." memorylake.ai/integrations/claude-code