DEV Community

Cover image for Claude Code Is Great. It Also Forgets Everything.
iCe Gaming
iCe Gaming

Posted on

Claude Code Is Great. It Also Forgets Everything.

Claude Code is great. I use it most days. Then I close the session, open a new one in the morning, and I am briefing a very sharp intern who has never met me.

The architecture I already explained is gone. The fix I rejected last week is back on the table. The reason we dropped Redis lives in a chat I can no longer see. The model is the same. The memory is not.

This is not a model-quality problem. The models are already good enough to do real work in a repo. The expensive part is the tax you pay at the start of every session: re-teaching the agent the project, the decisions, and the dead ends, just so it can reach the point where it was useful yesterday.

Markdown is a briefing, not memory

The usual answer is a markdown file. CLAUDE.md, AGENTS.md, a growing MEMORY.md, maybe an auto-memory file the agent appends to when it feels like it. I have used all of these. They are a reasonable briefing. They are not memory.

A briefing is loaded in full, every session, whether today's task needs it or not. That is fine when the file is two dozen lines of install commands and the test incantation. It stops being fine when the file becomes the dumping ground for every lesson, preference, and near-miss from the last three months. Every line costs context. The one line you needed is sitting under a pile of advice about a migration you finished in June.

Real memory is a lookup. You ask a question, and the relevant bit comes back, with enough of the original wording that you can trust it, and a pointer to where it came from. A markdown file cannot do that. It is either in the window or it is not. There is no "search last month's checkout investigation." There is only "read this blob again."

It also goes stale without anyone noticing. The file still says "use the v2 client." The v2 client was removed. The agent trusts the file, because that is what the file is for.

And the moment you use more than one agent, the briefing splits. Claude Code in the morning, Cursor in the afternoon, maybe Codex for a quick pass. Each one has its own file, or no file at all. None of them know what the others learned. You become the sync layer.

I am not saying you should delete CLAUDE.md. Keep it for the stable rules: how to install, how to test, the conventions that do not change. That is what it is good at. Do not ask it to remember a year of decisions.

What I wanted instead

I wanted the agent to remember the way a teammate does. Not by rereading the entire wiki at standup, but by recalling the one investigation that matters for this prompt, in the words it was originally written in, with a citation I can check.

That is what I built Palace for. It is one Rust binary and one SQLite file. It stores the original text, not an LLM summary. It embeds locally and searches with hybrid vector and BM25. There is no API key and no cloud on the default path.

Not associated in any way with the popular mempalace python.

The important part is not that a memory database exists. Plenty of people have a store they forget to query. The important part is that recall happens without the model having to remember to search.

The plugin, and the hooks that do the remembering

Palace now ships as a Claude Code plugin. If the palace binary is on your PATH:

/plugin marketplace add AncientiCe/palace-rs
/plugin install palace@palace-rs
Enter fullscreen mode Exit fullscreen mode

palace install still wires the always-on rule and the user-level hooks, so memory works in every project without a per-repo edit. After that, you do not paste last week's notes into the prompt. The hooks do the lookup.

At session start, Palace injects the memory protocol, your standing preferences, recent diary entries for this project, and the top drawers of the project's wing. The new session is not empty. It already has a short, cited briefing that came from actual work, not from a file you have been hand-curating.

At prompt submit, it searches with the question you just typed and injects matching drawers before the agent answers. If you ask "why did we switch the queue to SQLite?" and there is a decision on file, it shows up, with the drawer it came from. You did not have to type palace_search. The hook did.

While the agent greps and reads files, a post tool use hook can surface related decisions so an earlier choice appears without a separate search.

When the session did real work but saved nothing, a stop hook asks the agent once to write a diary entry and record decisions before it finishes. Memory compounds only if something gets written back.

All of those hooks fail open. If the palace is missing or empty, Claude Code works as it always did. Auto-recall stays inside the current project, so a drawer from another repo does not wander in.

That is the difference I care about. Markdown asks you to maintain a briefing. Hooks look up the cited bit at the moment it is useful, and they put yesterday's lessons back when the session ends.

The number I will stand behind

I do not want this to be a vibes argument, so I run a public retrieval eval.

On LongMemEval s_cleaned (470 questions, each over a haystack of about 50 sessions and 115k tokens), Palace's exchange-pair setup, the same way it mines real chats, reaches retrieval recall R@1 0.915, R@5 0.987, R@10 0.996. There is no LLM and no GPU in the retrieval path.

That number is "did the right session appear in the top results," not "did a model then answer the question." I am careful not to line it up against QA leaderboard scores. They measure a different thing. The method is in the repo, including what was and was not tuned. I would rather someone rerun it than take the figure on faith.

It is not only a Claude Code plugin

The same binary talks to other agents, because the memory should follow the work, not the editor.

  • OpenCode: npm i opencode-palace
  • LangGraph: pip install langgraph-store-palace
  • Antigravity: palace install --client antigravity

Cursor, Codex, and a few others are supported the same way, through MCP plus hooks. The store is still one SQLite file on your machine.

If this is useful, the repo is https://github.com/AncientiCe/palace-rs. If you just wanted the argument, that is fine too: stop asking a markdown file to be a memory system, and stop re-teaching a capable agent from zero every morning.

Top comments (0)