How to Give Claude Code Persistent Memory — No Plugins, Just Files
Claude Code is brilliant inside a session and amnesiac between them. Close the window, hit the context limit, restart your laptop — and the next session greets you like a stranger. Everything it "knew" about your project, your decisions, your half-finished work: gone.
There are plugins and memory add-ons that promise to fix this. You don't need any of them. The most robust persistent memory for Claude Code is the one mechanism the tool supports natively and that can never be deprecated: plain markdown files in your project folder.
This article shows the exact file structure we run in production — the same one that let an agent work across dozens of sessions on a multi-week project without a single "where were we?" moment.
The principle: memory isn't remembered, it's reconstructed
Start with the one fact that designs the whole solution:
The only thing that survives a session is what was written to files.
Not what the model "understood," not your long conversation — files. So instead of fighting the amnesia, build for it. The question stops being "how do I make Claude remember?" and becomes "what would a great employee write down, knowing they'll wake up with amnesia?" That question has a concrete answer, and it fits in a handful of files.
Layer 1: CLAUDE.md — the file Claude reads automatically
Claude Code loads CLAUDE.md from your project folder at the start of every session, before you type anything. Most people use it for build commands and coding conventions. That's fine — but its real power is behavioral: it's where you put standing orders that make Claude maintain its own memory. For example:
# Session start protocol (always, in this order)
1. Read STATE.md — current status, where work stopped, next steps.
2. Read the newest file in log/ — context from the last session.
3. Read BACKLOG.md — task priorities.
4. Only then begin work.
# Work protocol
- Every ~1 hour and after each completed task: update STATE.md
and run `git add -A && git commit`.
- Record every directional decision in DECISIONS.md with reasoning.
Two lines of philosophy behind this: keep CLAUDE.md short (it's re-read every session; ten crisp rules beat forty vague ones), and fix recurring behavior here, not in chat — a correction typed into the conversation dies with the session; a correction written into CLAUDE.md is permanent.
Layer 2: the state files Claude maintains for itself
CLAUDE.md tells Claude how to behave. These files are what it remembers:
| File | What it holds | Why it matters |
|---|---|---|
STATE.md | Current status, exactly where work stopped, next 3 steps | The 2-minute morning briefing |
BACKLOG.md | Prioritized tasks + an ideas parking lot | "What should I do?" never needs you |
DECISIONS.md | Every decision + reasoning + rejected alternatives | Settled questions stay settled |
log/ (one file per day) | What happened, what failed, what surprised | Failures stop being repeatable |
The detail that makes STATE.md work: surgical precision beats summary. "Working on the sales page" is useless to an amnesiac. "Sales page draft at the pricing section; next: write the FAQ using objections in research/objections.md" — that's a note a stranger could act on. And a stranger is exactly who reads it tomorrow.
Layer 3: git as the memory of record
Files hold the present; git holds every past. Have Claude commit at every checkpoint (the contract above already orders it) and you get three things free: any mistake is reversible, the commit history reads as a work journal, and a crashed session costs you minutes instead of a day — the last commit is always a complete, consistent snapshot.
What a session looks like once this runs
- You type "continue". That's the entire prompt.
- CLAUDE.md auto-loads; the protocol fires: state → log → backlog.
- Two minutes later Claude is fully briefed and working on the highest-priority task — no questions asked that the files already answer.
- Every hour: checkpoint. At the end: state updated, journal written, committed.
The result is indistinguishable from continuity. Nothing was remembered; everything was reconstructed — from notes a previous session left in known places, in a known format.
Why files beat memory plugins
- Nothing to break. No MCP server to configure, no database, no vendor that can sunset the feature. Markdown will outlive us all.
- You can audit it. Your agent's entire "mind" is human-readable. Open STATE.md and you know what your agent thinks it's doing — try that with an embedding store.
- It transfers. The same folder works with any file-based agent, today's or next year's.
- Auto-memory complements, not replaces. Claude Code's built-in auto-memory learns your preferences over time — useful, but it's not project state. Explicit files are still where "where did we stop and what's next" has to live.
Do this now
Create STATE.md in your current project with three sections: what's in progress, exactly where I stopped, next 3 steps. Add one line to your CLAUDE.md: "At session start, read STATE.md first. Before ending or every hour, update it." That's the minimum viable version of everything above — you'll feel the difference tomorrow morning.