How to give Claude Code persistent, secure memory
Claude Code remembers through two built-in files: CLAUDE.md, which you write, and auto memory, which Claude writes for itself on your machine. For memory that also reaches Codex, Claude Desktop, your other machines or your team, add a remote MCP memory server.
With Morphika that is one command, claude mcp add --transport http morphika https://mcp.morphika.ai/mcp --scope user, followed by a browser sign-in.
About Morphika: Morphika is secure, shared memory for personal AI agents like Claude Code, Codex and Claude Desktop. How it is secured.
How does Claude Code's built-in memory work?
| CLAUDE.md | Auto memory | |
|---|---|---|
| Who writes it | You | Claude, from your corrections and preferences |
| Where it lives | ~/.claude/CLAUDE.md (you), ./CLAUDE.md or ./.claude/CLAUDE.md (project) | ~/.claude/projects/<project>/memory/, with a MEMORY.md index |
| Loaded | Every session | Every session (the first 200 lines or 25KB of MEMORY.md) |
| Shared | Project files through git | Machine-local; not shared across machines or other tools |
Both are loaded as context at the start of a session. Auto memory is on by default and can be switched off from /memory.
When is built-in memory not enough?
- You also use Codex or Claude Desktop and want them to know the same things.
- You work on more than one machine.
- Your team's agents should share decisions, and someone should approve what goes in.
- You need a record of which agent wrote what, and proof it wasn't edited later.
How do I add Morphika to Claude Code?
- Step 1: Run the command below.
--scope userinstalls it for every project on this machine. - Step 2: Start Claude Code and type
/mcp. Pick morphika, then choose Authenticate. - Step 3: Sign in to Morphika in the browser and click Authorize.
claude mcp add --transport http morphika https://mcp.morphika.ai/mcp --scope userClaude Code now has 23 tools for memory, documents, approvals, the audit log, workspaces and connections. Try: “Save to Morphika: this repo deploys on Railway from main.”
How do I keep it secure?
- There is no API key to leak: sign-in is OAuth 2.1 with PKCE, and access tokens last one hour.
- For an agent that reads untrusted content, add the read-only address under its own name:
claude mcp add --transport http morphika-read https://mcp.morphika.ai/read/mcp --scope user. It can read and search, never write. - Anything that looks like a credential is refused before it is saved.
- Revoke this connection at any time from the dashboard, under Connectors.
- Every call appears in your audit log, attributed to this connection.
How do I connect a team workspace?
Workspace connections from Claude Code are coming soon. For now, connect Claude Code to your personal memory. Each workspace has its own connector URL on the dashboard's Connect page, and writes through a workspace connection wait for another member's approval. See shared memory for teams.
Should I still use CLAUDE.md?
Yes. Project rules that belong with the code (build commands, conventions, architecture) should stay in CLAUDE.md, reviewed like code. Use Morphika for what crosses projects and tools: your preferences, decisions and context every agent should know.
Sources
Sources checked September 25, 2026.
Related guides
Published September 25, 2026 · Last updated