It gives Claude Code a memory that survives closing the terminal. Free, Apache licensed, 90,000 stars. Works in Claude Code, OpenCode, Antigravity and OpenClaw. Here is the problem it solves. Every session starts from nothing. You explain the project, Claude works it out with you over an hour, you close the window, and all of that understanding is gone. Next morning you explain it again. Most people just accept that as how the tool works. claude-mem sits on five lifecycle hooks and watches the session while it happens. Tool calls get captured, compressed into short observations and written to a local SQLite database. Next time you open that project, the relevant history is already in context before you type anything. Setup is one command. Run npx claude-mem install, then restart Claude Code. Or add it as a plugin with /plugin marketplace add thedotmack/claude-mem followed by /plugin install claude-mem. The part that makes it work is how it reads back, and this is the bit worth stealing even if you never install it. It does not dump your history into context. It goes in three layers. Search returns a compact index of matching observations at roughly 50 to 100 tokens each. Timeline shows what was happening around one of them. Only then does it fetch full detail for the handful of IDs that actually matter, at about 500 to 1,000 tokens each. Filtering before fetching is where the saving comes from. My session this morning read 25,674 tokens of memory to stand on 204,350 tokens of previous work. That is 87% less than loading the lot. There is a privacy control worth knowing about. Anything you wrap in private tags never gets stored, which matters if your repo has client names or keys in it. Repo: https://github.com/thedotmack/claude-mem Docs: https://docs.claude-mem.ai The takeaway is not really the tool though. It is that context is a budget, not a bucket. Search first, fetch second, then you get the benefit of a long history without paying for it on every single prompt.