Show HN: A skill for Claude Code that cleans up your memory file, diff by diff
A developer shares on Hacker News a tool that removes the bloat accumulated in Claude Code's memory file. The trick: it never prunes on its own, always asking for your input diff by diff, because if you don't trust the model not to bloat the memory, you shouldn't trust it to clean it either.
By Hacker News · June 25, 2026.
A user posts on Hacker News a small tool ('skill') for Claude Code that tackles a practical and concrete problem: the memory file that Claude Code uses to maintain context across sessions tends to fill up with redundant information, anecdotes and accumulated 'junk,' to the point that, according to the author, it stops helping and even hurts session performance.
The problem that motivates the tool is simple: over time, the author noticed that Claude Code stopped remembering things he had explicitly asked it to remember. Upon reviewing the memory file, he found it full of useless material —including anecdotes— that took up space and context without adding value.
The solution's design is deliberately conservative. Instead of letting the model decide what to delete autonomously, the tool works as an interactive interview process: it shows the user each possible change as a diff and asks for their opinion before applying it. The author argues that the reason it works is precisely that: if you don't trust the model not to bloat the memory in the first place, it makes no sense to entrust it with pruning without human supervision.
The author notes that he has tested the tool mainly in Claude Code, although he expects it to work in similar environments such as Codex, OpenCode or Composer, given that the memory file mechanism is analogous.
In general, the problem of 'context bloat' in persistent memory files (such as CLAUDE.md in Claude Code) is a known friction among developers who use AI assistants intensively. Instruction and memory files tend to grow uncontrollably as the user adds new preferences, corrections and project context, and most models lack native self-cleaning mechanisms with granular oversight.
The post has 1 point and 0 comments at the time of publication in the feed, indicating that it is a very recent contribution with still limited reach. There is no direct link to the repository or the code in the available metadata.