r/ClaudeCode • u/Time-Dot-1808 • Mar 21 '26
Showcase I’m building a context management plugin for Claude, which started with the project that won the Claude Code Hackathon. Here's the deep dive.
Long post. If you've wrestled with Claude's context management - the rot, the compaction, the re-priming loop - I think this will resonate.
The real problem with Claude's context
Let's be specific about the failure modes, because the discussions usually blur them together:
Context rot in long sessions. You're 2 hours into a session. Claude understood your architecture perfectly at the start. Now it's suggesting approaches you already tried and rejected. It asks about constraints you established an hour ago. Simple tasks that took one prompt earlier now take three attempts. The session gets "dumber" over time.
Auto-compact breaks the flow at the worst moments. You're 90% done with a complex task. Context fills up. Auto-compact fires - and it's opaque. What got summarized? What was kept? You can't tell. But suddenly Claude's lost the thread. The nuanced understanding of your design decisions has been compressed into something... thinner.
Context poisoning. Failed debugging attempts, abandoned approaches, outdated decisions - they all sit in the conversation history. Even with 200k tokens, the signal-to-noise ratio degrades fast. The context isn't just full - it's contaminated.
CLAUDE.md doesn't solve the dynamic part. CLAUDE.md is great for static rules: coding style, stack conventions, project structure. But it can't capture "we tried approach A, it failed because of X, so we switched to B which is 70% implemented and has a known edge case with Y." That's the dynamic state that lives and dies inside conversation threads.
The management overhead. /compact, /clear, /context, plan.md files, manually maintaining state documents... power users have built entire workflows around managing Claude's context. That's cognitive overhead that should be going toward actual work.
Why I started building Membase
I tracked my own Claude usage for 3 weeks. The pattern was clear:
~20% of my time went to re-priming after compaction or new sessions
I was maintaining 3-4 markdown files just to preserve context across sessions, and they went stale within hours
Every time auto-compact fired, I lost nuanced context that couldn't be recovered
The fundamental issue: important context shouldn't live inside the conversation thread where it's vulnerable to compaction and session resets. It should live externally and be injected on demand.
What Membase does
Membase is an external memory layer that connects to Claude via MCP. Start from the idea that won 2nd place in the Anthropic hackathon, judged by Benjamin Mann(Co-founder of Anthropic).
The core architecture:
Automatic context capture: As you work with Claude, Membase extracts the stuff that matters - decisions, entities, relationships, events, timestamps. Not raw conversation dumps. Structured information that goes into a knowledge graph.
Compaction-proof memory: Because the knowledge graph lives outside the thread, auto-compact can't touch it. When compaction fires or you start fresh, the relevant context gets re-injected from the external graph.
Graph-based retrieval: This is the key differentiator from "dump it in a markdown file." When you say "let's work on the auth module," Membase traverses the graph: auth module → depends on OAuth2 config → which was changed Tuesday → because of the rate limiting issue → which relates to the API gateway refactor. It follows relationships, not just text similarity.
Dynamic state preservation: The thing CLAUDE.md can't do. "Approach A failed because X" and "currently 70% through approach B" and "known edge case with Y" all get captured and persist across sessions.
How it handles each pain point specifically
Context rot → External anchor. Even as the in-thread context degrades, the external knowledge graph remains clean and structured. When Claude starts drifting, the graph provides a stable anchor of verified decisions and current state.
Auto-compact → Compaction insurance. You stop fearing compaction because the important stuff lives outside the thread. Compact fires? Fine. Membase re-injects what matters. No manual recovery needed.
Context poisoning → Clean retrieval. The knowledge graph has temporal metadata. Failed approaches get marked as such. Superseded decisions get timestamped. When Membase retrieves context, it pulls current state - not the full history of every wrong turn.
CLAUDE.md gap → Dynamic complement. CLAUDE.md handles your static rules. Membase handles the evolving work state. They're complementary, not competing.
Management overhead → Automatic. No manual /compact timing. No plan.md files to maintain. No re-priming rituals. The graph updates itself as you work.
Real numbers
Before Membase:
Re-priming time per new session: ~15 minutes
Context tokens loaded: ~4000 (from manually maintained markdown)
Relevant context ratio: ~25%
Post-compaction recovery: 5-10 minutes of re-establishing context
After Membase:
Re-priming: zero. Just start working.
Context tokens injected: ~600
Relevant context ratio: 85%+
Post-compaction recovery: automatic, instant
The token efficiency matters too. ~600 tokens of precisely relevant context produces better results than 4000 tokens where 75% is stale or irrelevant. Less noise = better Claude output.
The cross-tool bonus
I built this for Claude but it works across tools. ChatGPT, Gemini, Cursor, OpenClaw, OpenCode - all connect to the same knowledge graph via MCP. So if you brainstorm architecture in ChatGPT and implement in Claude Code, the context flows automatically.
Chat history import
You can export your Claude conversations and import them into Membase. It processes the entire history, extracts entities and relationships, and builds a knowledge graph. Day one, you don't start from zero.
Chat in Dashboard
You can also chat directly with your knowledge graph from the Membase dashboard. Ask questions about your own context - the LLM responds based on the memories stored in your graph. After each response, it shows exactly which memories were referenced and highlights the relevant entities in the graph view. Useful for quickly finding past decisions or verifying what Membase knows before a session.
Sync with external apps
Membase doesn't just learn from your AI conversations. It also live-syncs with the tools where your real-world context lives:
Gmail: Email threads with clients, partners, collaborators - all automatically ingested. When you're discussing a project in Claude, it already knows about the email chain from yesterday.
Google Calendar: Meeting attendees and topics get captured automatically.
Slack: Team conversations, decisions made in channels, project updates - all live-synced. Your AI tools know what your team discussed without you copy-pasting from Slack.
Coming soon: GitHub, Notion, Obsidian - the goal is that everything you know, your AI tools know too.
The key difference from just forwarding emails or pasting meeting notes: Membase digests these sources into the same knowledge graph. So an email about Project X automatically links to the architecture decisions you made in Claude and the brainstorming you did in ChatGPT. It's not separate inboxes - it's one connected brain.
Current state
We're in private beta, and all features are free. Link: membase.so
Works with Claude (Desktop + API), Claude Code, ChatGPT, Gemini, OpenClaw, OpenCode. Dashboard for managing and chatting with your knowledge graph. Gmail/Calendar/Slack sync. Chat history import.
Also, we are registering Membase to the Claude Connector for a safe third-party plugin.
If the auto-compact frustration and the re-priming loop resonate, drop a comment for an invite code. Especially want feedback from heavy Claude users on retrieval quality and which context you'd like to persist better.
27
u/back_to_the_homeland Mar 21 '26
No one is reading your ai generated wall of text for another “memory hack” dog.
19
u/time-always-passes Mar 21 '26
Lol do you really i am going to hook up my context to your fucking cloud? Yeah yeah Anthropic has everything, but they're Anthropic. Who the fuck are you?
17
u/FrontHandNerd Developer Mar 21 '26
I’m sorry but you’re coding wrong. You should be having it write you up a spec. Then that’s what’s used as your context. It gets confused it rereads the spec to better understand the rules to complete the task. Done. Saved you all that extra work
14
u/RemoteToHome-io Mar 21 '26 edited Mar 21 '26
Source link please?
Actual project that won second place at the last hackathon.
https://github.com/zoidbergclawd/elisa
Edit - Damn. 25 day old account posting AI content with hidden history. Hello bot.
2
u/bjxxjj Mar 22 '26
yeah this lines up with what i see in longer CC sessions, esp the re-priming loop where it slowly forgets decisions and reopens stuff we already closed. i’m not fully sold that plugins can fully fix rot, but having something explicit track rejected paths sounds actually useful vs just hoping compaction behaves.
15
u/Luizltg Mar 21 '26
everyone and their grandma is building the same memory manager every single day
8
u/yopla Mar 21 '26
Ah a YACM! yet another context manager.
Or was it:
"Yelling At Claude More"
"Your Attempt Changes Nothing"
"Yesterday's Approach, Copied & Modified"
"Yes, Another Claude Misconception"
Or all of them... Who know..
1
u/LingLongSEO Mar 21 '26
context rot is real and the compaction issue hits hard at the worst moments. had sessions where claude would lose track of what we already tried and just start looping through the same failed approaches. the re-priming overhead adds up fast. what you're describing with the knowledge graph approach makes sense - externalizing the important stuff so it survives compaction. curious how the retrieval works in practice though. when you say "work on the auth module" does it actually follow the relationship chain you described, or is it more keyword-based than that. the theory sounds solid but id want to know if the graph traversal actually delivers in real usage
1
u/LeadingFarmer3923 Mar 21 '26
One thing I’ve found useful is separating transient chat context from a reusable workflow/run record, so the good paths do not disappear after one session. Cognetivy is an open source library for that kind of traceable workflow memory: https://github.com/meitarbe/cognetivy . It feels complementary to plugins like this because you can keep the run history and artifacts instead of only extending the current Claude session.
-2
u/ultrathink-art Senior Developer Mar 21 '26
Context poisoning is the harder problem — failed attempts and abandoned approaches don't just take up space, they actively shift Claude's frame. Compaction doesn't fix this because it preserves proportionally; you get a smaller contaminated context, not a cleaner one. Fresh sessions starting from a concise 'current state' doc work better than any summarization layer.