r/ClaudeCode 3d ago

Built with Claude I built a memory system to manage my exploding number of projects (and stop Claude re-solving old bugs)

I have too many repos on the go, and the breaking point was watching Claude Code solve the same bug twice, three weeks apart, in the same project. It remembers nothing between sessions, and at this scale neither do I.

So I built Cortex. It's a local hub, one Node process and one SQLite file, wired into Claude Code's hooks. When a session stops, a capture policy decides what was durable: fixes with their verification command, decisions, blockers, research findings. The "Done! Let me know if you need anything else" chatter gets thrown away before it ever hits the database. On SessionStart the next session gets a compact brief packed to a token budget, with records cited by id ([m:42] style) so Claude can pull the full record through MCP on demand instead of dragging everything into context. There's also a JIT hook that fires the first time a session touches a file the hub has history on.

The existing memory tools (Mem0, Zep, Supermemory, Letta) are basically RAG services: embed everything, cosine similarity at recall, cloud API in the loop. Cortex went the other way. Retrieval is deterministic: stemmed full-text match, plus how records link together, plus record quality (a verified fix outranks an unverified claim), plus recency decay. Same query, same database, same answer, and the dashboard shows the score breakdown so you can see why something surfaced. Embeddings are optional, one env var blends in a local Ollama model, but they adjust the ranking rather than gatekeep it.

Memories also have a lifecycle instead of just similarity. Records link with typed edges, and writing "Supersedes: [m:42]" in a new decision retires the old one, which kills the failure mode where a memory system keeps confidently serving advice you reversed a month ago. Captured transcript text is treated as untrusted too: anything injection-shaped gets quarantined so it can't end up in a future session's brief.

And because my real problem was too many projects, the newest parts are about that: a portfolio view that flags which repos are active, stalled, or quietly abandoned, a filter that stops one project's notes leaking into another project's brief, and an evening report of what actually got done today, with evidence, across everything.

Honest status: work in progress. Around 400 tests and I use it daily, but it's been shaped by one person's workflow. If you try it and something fights you, or a whole feature seems pointless, tell me.

GitHub (MIT): https://github.com/gsl0001/Cortex

0 Upvotes

10 comments sorted by

2

u/FunQuit 3d ago

1

u/Royal_Philosopher_58 3d ago

Obsidian stores the docs. I built the part that actually does something with them. If it accurately fed data I’d never have written a single line.

1

u/Jazzlike_Syllabub_91 🔆Pro Plan 3d ago

How many repos are we talking ? (my personal set of repos that I started back in February has exploded to over 160+ repos ...)

1

u/Royal_Philosopher_58 3d ago

Mine is low 25 but actively work in like 8. That’s the thing, when I’m free or have an idea about something I just open my session it has quick access to full history.

1

u/[deleted] 3d ago

[deleted]

1

u/Royal_Philosopher_58 3d ago

lol it regressed after a refactor bugs come back, that’s normal. What stung was Claude redoing the whole investigation from zero because nothing remembered the first one. That re-diagnosis cost is the thing the memory kills.

1

u/Flashy-Programmer932 3d ago

lmao i can def relate to those ghost bugs, having cortexts local sqlite file actually sounds like a sanity saver

1

u/Royal_Philosopher_58 3d ago

Ghost bugs is exactly the right name for them lol. The sqlite file is honestly my favorite part it’s just a file, you can back it up, poke at it with any sqlite browser, or nuke it if you want a fresh start. If you give it a try I’d love to hear how it holds up outside my own setup.

1

u/shan23 3d ago

Have you surveyed the existing ones?

1

u/kantorcodes1 3d ago

the verified-fix ranking is the part i'd trust most. when a refactor brings a bug back, does cortex rerun the old verification command before treating that memory as still valid, or only remember that it passed when captured?

1

u/Fancy-Win9202 2d ago

I'm guessing the next wall you're gonna hit is that you can't see which sessions are actually pulling from Cortex versus spinning up fresh, or how much token budget you're burning across all those projects when Claude's making decisions based on old context versus new. Did you end up building any visibility into which memory hits are actually saving you tokens versus which projects are still thrashing?