In partnership with

Login or Subscribe to participate

Every session with Claude Code, Cursor, or Copilot starts from zero.

Which means there is neither any memory of your codebase conventions nor the architectural decision you spent two hours debating last Tuesday.

You re-explain it, it listens. But then you close the session and it’s gone.

There are real, implementable solutions to this. But first:

Tools of the Week

It installs as a Claude Code plugin, injects your profile at session start, and auto-captures decisions when a session ends. Has a team memory namespace so one engineer's fix becomes everyone's context next session.

A lightweight MCP server that gives Claude a per-project file store for architectural decisions and conventions. Free, local, no third-party and requires one npx command to set up.

Anthropic's official guide to CLAUDE.md, auto memory, and the full file hierarchy. The right place to start before reaching for any third-party tool.

Why This Happens

LLMs are stateless.

Every conversation is a new context window with no knowledge of what came before is a fundamental property of how transformer-based models work.

Claude Code, Cursor, and Copilot all share this limitation.

The model powering your session is not the same continuous entity you talked to yesterday.

It's a fresh instantiation reading whatever context you give it at startup. The only memory that survives is the context you explicitly provide.

The Three Approaches

Approach 1: CLAUDE.md (native, free, manual)

Claude Code reads a CLAUDE.md file at the start of every session. Whatever is in that file becomes part of Claude's initial context, automatically.

You write it and Claude reads it. There is no further setup beyond creating the file.

The file hierarchy matters:

  • ~/.claude/CLAUDE.md: global, applies to all your projects

  • <project-root>/CLAUDE.md: project-specific, shared via git

  • <project-root>/CLAUDE.local.md: personal overrides, gitignored

  • <project-root>/.claude/rules/*.md: scoped rules by file type or directory (glob patterns)

A practical example of what goes in ~/.claude/CLAUDE.md:

And a project-level CLAUDE.md:

Two rules for CLAUDE.md: keep it under 200 lines, and put the most important things first.

Claude reads it sequentially and weighs the top more heavily.

A 500-line file consumes 3,800 tokens and hurts adherence, while a clean 80-line file reduces corrections by around 40% on large projects.

Claude Code v2.1.59+ also has auto memory: Claude writes notes about your corrections and preferences into a memory folder.

Run /memory in session to see and edit what it's saved. Everything is plain markdown.

Where CLAUDE.md fails: it only carries what you wrote and doesn't capture session learnings automatically unless auto memory is on. It requires discipline to maintain.

Teams that don't version it and keep it updated end up with a stale file that contradicts the actual codebase.

Approach 2: Memory MCP servers (structured, cross-project, composable)

MCP lets you give Claude Code external tools.

A memory MCP server stores facts, decisions, and patterns in a persistent store and lets Claude query them mid-session.

Three open-source options worth knowing:

memory-bank (@allpepper/memory-bank-mcp): per-project file-based memory.

Claude reads and writes to a ~/.claude/memory-bank directory. It is best for capturing architectural decisions and project notes.

mcp-knowledge-graph: stores entities and relationships.

"Use express-rate-limit" gets associated with "rate limiting" and "your preferences" as structured nodes. Better for cross-project preferences than file-based notes.

mcp-memory-service: runs a local server with vector search.

It supports semantic queries like "how did I handle auth in the last project?" and works with Claude Desktop, OpenCode, and Gemini CLI.

It also has a session harvest tool that extracts learnings from Claude Code transcripts.

Then add to your Claude Code MCP config:

MCP memory tools work automatically once installed and Claude calls them when it needs context.

Where MCP memory fails: Claude controls when it queries. You can't force a memory lookup at session start.

If the model doesn't decide to check memory for a given task, it won't. This is what the plugin approach below addresses.

Approach 3: Supermemory Claude Code plugin (automated capture + injection)

Dhravya Shah from Supermemory built a Claude Code plugin that addresses the MCP limitation. Two things it adds:

Context injection on session start: A user profile loads into Claude's context before the first turn.

Claude knows your preferences, recent project context, and team decisions before you type anything.

Auto capture on session end: Conversation turns are saved to Supermemory automatically, without /remember thisprompts.

It captures based on signal keywords you configure.

Install:

Configure what triggers a save in ~/.supermemory-claude/settings.json:

For teams, use per-repo config at <project-root>/.claude/supermemory.json:

repoContainerTag is the key feature for teams.

All engineers on the same repo share a memory namespace. One person figures out a tricky migration pattern and everyone's Claude Code knows it next session.

Where Supermemory fails: it requires a Pro plan.

The ~99% LongMemEval benchmark Dhravya tweeted is from an experimental agentic flow, not the production engine and the real-world recall on messy multi-topic sessions will be lower.

You're also sending session data to a third party. Check their data policy before installing if your codebase has IP concerns.

Approach 4: memory-mcp (self-hosted, tiered, hooks-based)

The most technically complete open-source option. Builds a two-tier memory system using Claude Code's hook system:

  • Tier 1: CLAUDE.md: top 150 lines of high-frequency knowledge, auto-generated and auto-updated

  • Tier 2: .memory/state.json: full memory store, queryable mid-session by keyword, tag, or natural language

It hooks fire after every response (Stop), before compaction (PreCompact), and at session end (SessionEnd).

They extract learnings from the transcript using Claude Haiku (cost: ~$0.001 per extraction) and update both tiers automatically.

The self-hosted angle is the main reason to pick this over Supermemory i.e, no third party, all data stays local and it works offline.

Cost for a full day of active development: $0.05–0.10 in Haiku API calls.

The Common Pattern Underneath

Every solution above does the same thing: information that would otherwise live only in session context gets written to disk and re-injected on startup.

A reasonable default for most developers is a clean, opinionated CLAUDE.md for static preferences and conventions, plus one of the MCP/plugin options for dynamic session learnings.

You don't need all four.

Pick based on whether you need team sharing (Supermemory), local-only (memory-mcp), or structured queries (knowledge-graph MCP).

My Take

The problem is not new.

Developers have been filing GitHub issues about Claude Code's session amnesia since late 2025.

CLAUDE.md solves 80% of this if you actually write it well.

Most developers add two lines ("use TypeScript, prefer async/await") and forget about it.

A proper CLAUDE.md is a living document i.e, your stack, constraints, decisions you've made and why, and commands you always forget.

Treat it like onboarding docs for a new engineer who happens to be your agent.

The hybrid approach (Tier 1 CLAUDE.md + Tier 2 searchable store) is where this is heading.

Large context windows mean you can stuff more notes into the current session, but those notes disappear when you close it.

Structured memory that survives session boundaries is the only real fix.

On Supermemory's ~99% LongMemEval claim: the direction is right, but the benchmark tests multi-session recall under controlled conditions. Real codebases are messier.

The teams getting the most out of Claude Code are building better context systems, What are you building?

Until next time,
Vaibhav 🤝🏻

If you read till here, you might find this interesting

#Partner 1

88% resolved. 22% loyal. Your stack has a problem.

Those numbers aren't a CX issue — they're a design issue. Gladly's 2026 Customer Expectations Report breaks down exactly where AI-powered service loses customers, and what the architecture of loyalty-driven CX actually looks like.

#Partner 2

How Much Is Your Credit Worth?

Guess how much good credit can save you?

Up to $200,000 over your lifetime, according to Time Magazine.

Better credit means lower rates on mortgages, auto loans, and more. Cheers Credit Builder is an affordable, AI-powered way to start building credit — even from scratch. No credit score required and no hard credit check — just a quick ID verification.

Choose a plan that fits your budget, link your bank account, and make simple monthly payments. We report to all three major credit bureaus with accelerated reporting to help you build credit faster.

Many users see their credit scores increase by 20+ points within a few months, helping them prepare for goals like buying a home, leasing a car, or qualifying for better rates.

Your funds are FDIC-insured through Sunrise Banks, N.A., and returned at the end of your plan (minus interest). Cancel anytime with no penalties.

Start building smarter today — your future self could thank you six figures later.

Reply

Avatar

or to participate

Keep Reading