Abdeljabbar ElassaliEveryone hacks Claude Code memory with markdown files and plugins. Here's an honest breakdown of every method, from CLAUDE.md to handoff files to a real persistent memory layer.
Quick answer: Claude Code starts every session with a fresh context window. The common fixes are CLAUDE.md files, /remember handoff notes, and community memory plugins with session hooks. They all work locally and manually. If you want memory that persists automatically, is searchable, and follows you to other tools, connect an external memory layer over MCP. Details on every option below.
Claude Code is stateful within a session and amnesiac between them. Close the session, compact the context, start a new machine, and it's gone: the architecture decision from Tuesday, the bug you already diagnosed, the convention you agreed on. For real projects, this means paying the re-explanation tax every single day.
A CLAUDE.md file in your project root gets loaded into context automatically. Put your stack, conventions, commands, and gotchas there. It's the highest-ROI five minutes in Claude Code.
Limits: it's static. It doesn't record what happened, only what you wrote down by hand. And it never leaves the repo.
The community converged on a pattern: before ending a session, have Claude write a handoff note (what's done, what's next, non-obvious context) to a file like .remember/remember.md, and read it back next session. Several plugins automate this with hooks:
Popular implementations include the various claude-remember plugins on GitHub. They work, and they're a genuine improvement over nothing.
Limits, honestly assessed:
Claude Code can resume previous sessions. Useful, but it's the same machine, the same project, and you're resuming a conversation, not querying a memory. It doesn't compose knowledge across sessions or tools.
The setup I actually kept is Vilix AI, a persistent memory layer that Claude Code talks to over MCP (Model Context Protocol). Why it beats the file-based approaches:
It's automatic, not ceremonial. You connect Vilix AI once as an MCP server in Claude Code. Every turn runs a memory loop: get_context loads relevant memories before the reply, save_turn persists the exchange after. No /remember incantations, no hook scripts to maintain.
It retrieves instead of dumping. Memories are indexed with semantic and keyword search. A new session pulls what's relevant to the current task, not the entire .remember/ directory. Your context window stays lean.
It stores structured state, not just notes. Beyond conversation history, it holds projects and tasks (what's done, what's next) and rules, both personal user_rules and per-project project_rules like stack and conventions. That's the stuff you'd otherwise retype into every handoff file.
It leaves Claude Code. Same memory serves ChatGPT, Cursor, Codex, Grok, Manus, and your phone. Explain your project once, in any tool, and Claude Code already knows it next session. The memory is server-side in your account, so it survives machine switches, fresh clones, and context compactions.
Before: Monday I architect an API route in Claude Code. Tuesday's session starts blank. I paste the handoff file, which is now 400 lines, half stale. I spend 15 minutes re-explaining anyway.
After: Monday's session saved its turns automatically. Tuesday I just start working. When I ask about the route, the relevant decisions surface on their own. When I switch to Cursor in the afternoon, it's all still there.
claude-remember style plugins with hooks are a fun, capable setup.Markdown files were the prototype. A real memory layer is the product.