Skip to content

Claude Code persistent memory

Persistent memory for Claude Code with MCP

Connect Claude Code to a durable, self-managing memory that survives sessions and remains available to your other AI agents.

Client
Coding agent · CLI and editor
Availability
Available on current Claude Code releases
Markdown

One-command setup

Connect OceanDB to Claude Code

claude mcp add --transport http --scope user oceandb https://app.oceandb.ai/api/mcp
  1. 1. Add the remote server. Run the command in a terminal. User scope makes the same memory available in every Claude Code project on this machine.
  2. 2. Authorize OceanDB. Open /mcp inside Claude Code, select OceanDB, and complete the browser sign-in and approval flow.
  3. 3. Initialize the memory loop. Ask Claude Code to call onboarding_status and follow the returned next step.
  4. 4. Verify cross-session recall. Save one durable project decision with remember, open a fresh session, and ask Claude to recall it.
Check the current Claude Code MCP documentation

What persistent memory adds to Claude Code

Claude Code has several useful continuity layers, but they do different jobs. The current context window holds the active task. CLAUDE.md and repository rules tell the agent how to work in a codebase. Product-managed memory can preserve Claude-specific context.

OceanDB is the external layer for facts that should remain queryable across sessions, repositories, and clients. It is useful for decisions whose rationale is not visible in the code, recurring preferences, deployment constraints, prior failed approaches, and work that another agent may continue later.

The distinction keeps the repository authoritative for code instructions while allowing lived project history to accumulate without turning one instruction file into a transcript.

A practical Claude Code memory policy

Add the standing memory instruction to Claude Code after the connection succeeds. It tells the agent to recall before asking for known context and to capture durable facts as they emerge.

Good Claude Code memories include:

  • why the team rejected an otherwise plausible library;
  • a production constraint that cannot be inferred locally;
  • the user’s preferred review or release-note style;
  • an unresolved migration risk for a future session;
  • the result of a tool-based investigation that would be expensive to repeat.

Keep transient command output, secrets, and facts already maintained clearly in the repository out of memory.

Test the connection across sessions

In one Claude Code session, say:

Remember that database migrations in this project must be additive until the next maintenance window.

Start a new session and ask:

What constraint applies to database migrations in this project?

Claude should use recall rather than relying on the previous transcript. The OceanDB dashboard shows the raw entry, its workspace, and any later consolidation.

Let Claude run the Dreamer

Capture is intentionally fast. Maintenance happens separately. The OceanDB Dreamer is a public skill that Claude runs client-side to consolidate raw entries into cited pages, typed links, proposals, and insights.

That separation matters for Claude Code: the coding session can save a decision immediately without spending its active context reorganizing everything. A later Dreamer run does the slower editorial work under the same user’s authorization. Install and run the Dreamer after the first memories have accumulated.

Use the same memory outside Claude

User-scoped setup makes OceanDB available across Claude Code projects. The remote store goes further: authorize Codex, Cursor, or ChatGPT with the same identity and each client reaches the same personal and shared workspaces.

Claude Code remains one capable interface into the memory. It does not become the owner of it.

Common questions

Does Claude Code already have memory?
Claude Code can load instructions and product-managed memory. OceanDB adds a separate, queryable store that can also be used by Codex, Cursor, ChatGPT, and other authorized MCP clients.
Does OceanDB replace CLAUDE.md?
No. CLAUDE.md should keep repository instructions that belong with the code. OceanDB is for durable decisions, preferences, discoveries, relationships, and cross-project context that should be recalled selectively.
Where are OceanDB credentials stored?
Claude Code completes OAuth in the browser and manages the resulting authorization. The setup command does not put a long-lived OceanDB API key in the repository.
Can a team share Claude Code memory?
Yes. OceanDB separates personal and shared workspaces. The agent can recall shared decisions when the signed-in person is a member of that workspace.

One memory, ready in every agent.

Connect Claude Code, capture the first durable fact, and keep the store under your own identity.

Start remembering