MemoryLake
Back to all articles
Pain PointMay 22, 20267 min read

Why does Claude Code forget my project context?

You finally got Claude Code dialed in: it knows the repo, it knows the conventions, it just shipped a clean PR. You close the terminal, open it again tomorrow, run `claude`, and the agent is back to asking what your project does and which package manager you use.

`CLAUDE.md` is right there. So why is the context gone?

The short answer

Claude Code forgets project context because every new session starts with a fresh context window, CLAUDE.md is loaded as static rules (not memory), and --resume has documented bugs where prior conversation context is not fully restored. Auto Memory captures short notes, not transcripts. A persistent project memory layer keeps the full context loadable on every run.

Why Claude Code forgets project context

Claude Code is built around the idea that each session is a fresh agent. Three mechanics drive the forgetting:

1. Every session begins with an empty context window. Claude Code starts each run with a clean slate, then loads CLAUDE.md, any referenced files, and your prompt. The window itself — typically 200K tokens on Claude Sonnet 4.5/4.6/4.7 — is generous but per-session. Long agentic runs that read many files fill it faster than you would expect.

2. `CLAUDE.md` is rules, not memory. Anthropic's own docs describe CLAUDE.md as a static onboarding file the agent reads at session start. It is perfect for "use pnpm, write tests with Vitest, never edit /legacy/*". It is not a transcript store. The rationale behind decisions does not belong there, and the substance of past sessions does not live there.

3. `--continue` and `--resume` have known context-loss issues. A widely-discussed GitHub issue (anthropics/claude-code #43696) reports that resumed sessions can start fresh as if it were a new conversation, losing accumulated context. Even when resume works, sessions cannot see each other — there is no cross-session search.

The result: rules stick, agent state evaporates.

What you lose when Claude Code forgets project context

Every fresh claude invocation costs you re-orientation:

  • The reasoning behind decisions vanishes. "We chose to keep the legacy users_v1 table read-only because of the migration cost" was in yesterday's session. Today's Claude Code suggests writing to it.
  • Multi-session work loses the thread. Refactors that span three sessions need the plan in front of the agent every time. With CLAUDE.md you can pin one paragraph; you cannot pin a 12-step plan with rationale.
  • You burn tokens re-loading the same files. Every session re-reads the same specs, re-discovers the same conventions, re-asks the same clarifying questions.

Claude Code's built-in workarounds (and where each falls short)

Claude Code ships three features aimed at persistence. Each helps; none replaces real project memory.

`CLAUDE.md` is the right tool for stable rules and onboarding. It loads every session. Anthropic's official guidance is to put durable instructions there, not in earlier messages. The flip side: CLAUDE.md is best kept short — it competes with everything else for context room — which makes it the wrong home for evolving project history.

Auto Memory lets Claude save its own notes during sessions, organized into user preferences, feedback, project context, and reference pointers. Useful for "user prefers concise diffs". Not designed for full transcripts or decision logs.

`/resume` and `--continue` are meant to pick up prior sessions with full context. In practice, users have reported (issue #43696, April 2026) that resumed sessions can start blank, and even when they work, sessions cannot see each other.

You can read the official Claude Code docs for the full feature set.

For stable rules, the natives are solid. For project context that spans sessions and tools, they fall short.

Where Claude Code's built-in memory falls short

The deeper issue: most teams running Claude Code also use Cursor for fast iteration, Cascade for IDE-tight workflows, and ChatGPT for design discussions. CLAUDE.md does not travel to any of them. Each tool gets its own copy of the project rules and its own siloed history. Context fragments across tools and the project pays.

Memory needs to follow the project, not the editor.

How MemoryLake fixes Claude Code forgetting project context

MemoryLake is a cross-model memory layer that connects to Claude Code via native MCP support. Instead of relying on a static CLAUDE.md, you give the project its own memory and Claude Code reads from it on every session.

  • Per-project memory, not per-file. Specs, ADRs, past claude transcripts, and decision logs live in the project. Claude Code fetches what is relevant per turn instead of trying to fit everything in CLAUDE.md.
  • 10,000× more context than raw prompting. MemoryLake's retrieval engine reads from billions of tokens of project memory and returns only the bits that matter. You stop burning tokens re-loading the same specs.
  • Portable to every other AI. The same project memory works in Cursor, Windsurf, Claude Desktop, ChatGPT, and Gemini. Switch tools mid-project and your context follows.

MemoryLake scored 94.03% on the LoCoMo long-context benchmark — the top published result as of 2026 — with millisecond retrieval and AES-256 end-to-end encryption.

Connect MemoryLake to Claude Code in 3 steps

  1. Create a project and load your context. Sign in to MemoryLake, open Project Management, click Create Project, and name it after your repo (e.g., "acme-api — Claude Code project"). Upload your specs, ADRs, and past claude transcripts through the Document Drive (PDF, Markdown, Word, Excel, images all supported). Add short standing instructions in the Memories tab — keep CLAUDE.md lean and let MemoryLake hold the long-form context.
  2. Generate an MCP Server endpoint. Open the MCP Servers tab inside your project, click Add MCP Server, name it "Claude Code integration", and click Generate. MemoryLake returns an API key ID, secret, and endpoint URL. Copy the secret immediately — it is shown only once.
  3. Add the server to Claude Code's MCP config. Run claude mcp add memorylake --transport http <endpoint-url> and add the Bearer token when prompted. (You can also edit ~/.claude.json directly if you prefer — keep an eye on trailing commas; JSON does not allow them.) Restart claude. The agent now has a memorylake tool it can call at the start of every session to load project context.

Frequently asked questions

Does Claude Code remember my project context across sessions?

Claude Code loads CLAUDE.md and any referenced files at the start of every session, so static rules persist. The substance of past sessions does not — each claude invocation starts with a fresh context window. Auto Memory saves short notes, not transcripts.

How do I make Claude Code remember project context between sessions?

Connect Claude Code to an external memory layer like MemoryLake via the native MCP integration (claude mcp add or ~/.claude.json). Project files, decisions, and past transcripts are stored once and fetched per session, so the agent opens with full context.

Why does Claude Code forget what we discussed even when I use --resume?

A documented issue (anthropics/claude-code #43696, April 2026) reports that --resume and --continue can start fresh as if the session were new, losing accumulated context. Even when resume works, individual sessions cannot search across each other.

What is Claude Code's context window size?

Claude Code typically runs on Claude Sonnet 4.5/4.6/4.7 with a 200K-token window per session. Long agentic runs that read many files and run many tools fill that window faster than the raw spec suggests, and a new session resets it.

Can I share my Claude Code project context with Cursor or ChatGPT?

CLAUDE.md is Claude Code-specific. MemoryLake stores memory in a model-neutral Project, so the same project context works in Claude Code, Cursor, Windsurf, Claude Desktop, ChatGPT, and any tool that speaks MCP or REST.