How to make Claude Code remember across sessions (and stop repeating mistakes)

By Sebastián Téllez · Last updated: October 3, 2026

Short answer: every Claude Code session starts with an empty context. What carries over between sessions is CLAUDE.md files, which you write, and auto memory, which Claude writes per project on your machine. To get that knowledge to other machines and to your other agents, connect a memory server over MCP such as NEXUS.

What Claude Code remembers on its own

According to Anthropic's documentation, Claude Code has two mechanisms that load at the start of every session:

  • CLAUDE.md files: instructions you write. They can be project-level (./CLAUDE.md, shared with your team through version control), personal (~/.claude/CLAUDE.md, for all your projects) or organization-wide.
  • Auto memory: notes Claude writes on its own from your corrections and preferences, in ~/.claude/projects/<project>/memory/. Each session loads the first 200 lines or 25 KB of MEMORY.md.

Both act as context, not enforced configuration: Claude takes them into account, but to block an action no matter what, the documentation itself recommends a PreToolUse hook.

Where it falls short

  • It is local to your machine. The documentation says it plainly: auto memory files are not shared across machines or cloud environments.
  • It is per repository. What Claude learned in one project does not reach another.
  • It is Claude Code only. Claude in the browser, ChatGPT or Cursor do not see it.
  • It has a load cap. Anything beyond the first 200 lines or 25 KB of MEMORY.md is not loaded at session start.

For one developer on one machine that is often enough. The problem shows up when the same decision has to be respected by another agent, on another machine or in another tool.

What matters isn't remembering, it's not repeating the costly mistake

An agent that forgets a preference is an annoyance. One that repeats something that already went wrong costs money or time. That is the case worth covering.

Illustrative example: in one session it was decided that payment records are never deleted, they are archived, because accounting audits them. Weeks later, from another computer, an agent proposes deleting old records to clean up the table. If the decision only lives in the first machine’s local memory, the second agent has no way of knowing it.

How to connect NEXUS to Claude Code

  • Create a free account at https://nexus.eblas.link/en/signup.
  • Add the server from the terminal:
terminal
claude mcp add --transport http nexus-agi https://nexus.eblas.link/mcp
  • Inside Claude Code, run /mcp and authorize in the browser. No tokens to copy.
  • Optional: ask your agent for the get_setup_kit tool. It returns hooks that recall memory at session start and on every message, and save what matters at the end. They are installed only if you approve.

Step-by-step details are in the documentation: https://nexus.eblas.link/en/docs

CLAUDE.md, auto memory and NEXUS: when to use each

They are not exclusive; each one covers a part:

  • CLAUDE.md: stable project rules you want versioned with the code.
  • Auto memory: preferences and learnings for that repository on that machine.
  • NEXUS: decisions, rules and mistakes that have to reach all your agents and machines, with validity: when something stops applying, it is marked as no longer valid instead of deleted.

Limits worth knowing

  • NEXUS knows what it is told. Without the hooks, it only has what the agent stores on purpose.
  • A memory can go stale: NEXUS tracks validity, but it cannot guess that something changed outside. Correct it when it happens.
  • The Free plan includes up to 150 new memories and 2 agents per month.

Does Claude Code have memory across sessions?

Yes. It loads the CLAUDE.md files you write and an auto memory Claude keeps per project on your machine. Both load at the start of every session.

Is Claude Code's memory shared across computers?

Auto memory is not: according to Anthropic's documentation it is machine-local. A project CLAUDE.md does travel with the repository through version control. To share decisions and mistakes across machines and tools you need an external memory, such as an MCP server.

Do I need to install anything to use NEXUS with Claude Code?

No. Add the server with claude mcp add and authorize with /mcp. The automatic-capture hooks are optional.

How much does NEXUS cost?

There is a Free plan with up to 150 new memories and 2 agents per month. Paid plans are optional.