DEV Community

Lian Matsuo
Lian Matsuo

Posted on

Garbage Collector for Claude Code's Memory

GitHub logo lianmatsuo / remcycle

Garbage collection for Claude Code's memory. A mod that rereads your sessions every day, keeps what you decided, and questions the notes that have gone stale.

remcycle. Garbage collection for Claude Code's memory. A mod that rereads your sessions every day, keeps what you decided, and questions the notes that have gone stale.

Checks Licence: Apache-2.0 Needs Claude Code 2.1.287 or later

A Claude Code session with the remcycle panel beside it. The panel shows two questions waiting for a ruling, nine memories and where they came from, what was learned lately, and what earlier sessions left open.

The shop project in the pictures is made up.

Claude Code starts every session fresh, and the notes it keeps about your projects pile up until the old ones are wrong. remcycle keeps everything you and Claude said, and once a day it reads the new sessions in the background, keeps what you actually decided, and questions the rest. The sessions after that start knowing it.

  • Sessions that start informed. Each new session is handed what you have said applies to all your work, what was learned about the project, and what earlier sessions left unfinished.
  • Memory you can trust. Every memory points at the words it came from. Something only Claude concluded is never loaded as if you had said it, and a note you already had is never replaced without asking you.
  • A list that stays short. Stale, repeated and contradictory notes are found and put to you…




Using Claude everyday, I noticed that the notes and memories Claude has been accumulating about my projects kept going stale. After some weeks, there was also nothing that told me which notes were things I had actually said and which were guesses Claude had written down on its own. By the time I knew it, my memory files were filled with tens of incorrect or redundant notes.

I tried what already existed first. Claude's own auto memory is notes Claude writes by itself and loads into every session, but nothing says where the note came from. Memory skills such as gstack's /learn keeps lessons Claude picks up while you run gstack's commands, but they're Claude's conclusions rather than your decisions, and nothing links them back to the conversation they came from. Other memory layers such as claude-mem or Mem0 mostly only summarise and index what happened, but nothing goes back and asks whether an old note still holds. They were all missing the other half of memory, something that takes out what no longer holds and cleans the context to avoid rot.

I built remcycle as a Claude Code mod. The mod copies all claude sessions that were started that day. Once a day, a pass reads those sessions, pulls out what I decided, and checks it against the memory that is already there. Outdated, repeating, or contradicting notes come back to me as a question, and the mod shows those questions in a /remcycle UI panel where I can choose to keep the note, retire it, or talk it through with Claude. The mod also hands each new session a "Context pack" which is a collection of fresh, relevant context that may be important for the project you are working on. It also gives Claude a recall tool over the archive.

Please try it from the Github Link, I'd love to hear whether if what it kept matches what you actually decided. And I'm curious to how others handle this today. Do you prune Claude's memory by hand, or start fresh?

Top comments (1)

Collapse
 
promptalo profile image
PromptAlo •

Turning stale notes into questions is the right call, since retiring a note should stay your decision. Outdated notes usually get caught when a new decision contradicts them. The case that check can miss is the note nothing touches anymore: a decision about a module you deleted never conflicts with a new session, it just keeps loading. Tracking when each note last mattered to a session would surface those too, and they are usually the easiest ones to retire.