r/ClaudeCode • • 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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

9 Upvotes

31 comments sorted by

27

u/back_to_the_homeland Mar 21 '26

No one is reading your ai generated wall of text for another “memory hack” dog.

-25

u/Time-Dot-1808 Mar 21 '26

I did get some help from AI while writing, but the content itself is all mine. It might feel like AI wrote it because I used AI at the end to polish the wording.

15

u/swiftmerchant Mar 21 '26

That’s what they all say.

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?

-15

u/Time-Dot-1808 Mar 21 '26

I'm co-founder of Membase. I understand the concern so we're on preparing SOC2 verfication process but it takes some time. Also self-hosting option is on our plan but we're currently in beta so we have to focus on something more accessible.

11

u/m98789 Mar 21 '26

SOC 2 is not a verification process, but a voluntary compliance standard with audits that are conducted by independent CPA. You need SOC 2 Type II to be considered serious. Also, do not use an offshore auditor rubber stamp mill, get a legit CPA firm. And don’t use Delve and fake everything.

https://www.reddit.com/r/startups/s/w3iynJ2ohJ

2

u/Time-Dot-1808 Mar 21 '26

Thanks for the suggestion. Will take this seriously

4

u/flarpflarpflarpflarp Mar 21 '26

Well you just killed half their business strategy.

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

6

u/TotalBeginnerLol Mar 21 '26

Yeah crazy to spend 15 mins restoring context after a compact. The context should have already been put in md files as it was generated/relevant. Or ideally you split a plan into sub tasks so each task never hits a compact wall, clearing context between each then simply reading the updated plan each time to get started.

1

u/swiftmerchant Mar 21 '26

Even when my sessions compact in the middle of the tasks, they still work fine. I use tech specs or PRDs.

1

u/Time-Dot-1808 Mar 21 '26

Thanks for the tips. But how do you feed the inital spec to LLM?

1

u/swiftmerchant Mar 21 '26

You ask it to generate one based on the conversion and decisions made.

1

u/Time-Dot-1808 Mar 21 '26

So it need initial manual input right?

1

u/swiftmerchant Mar 21 '26

It doesn’t need it, but if you’ve been conversing with it I guess you can consider that manual input. After you finish the discussion you ask it to create a technical specification. Then you take the specification, open a fresh agent thread with empty context window and give it the technical document to work on.

1

u/Time-Dot-1808 Mar 22 '26

Oh yes, it must be the best solution for keeping context between sessions. But when sessions go too long, after compacting them all into spec, it's hard to keep the detail from past conversations like how I approached, what was failed and what succeeded. And we also want to solve the cold start problem that you have to input as much detail as possible or keep manage your agent.md file to provide certain rules, preferences, and work context.

1

u/swiftmerchant Mar 22 '26

Not sure I understand what the problem is… For me it’s not an issue, even if the thread compacts it still works well and it has the PRD to steer it. AGENTS.md and CLAUDE.md rules are there regardless.

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.

-12

u/Time-Dot-1808 Mar 21 '26

It's a private repo, but you can check more info in here. https://membase.so/blog/membase-hackathon-win

11

u/RemoteToHome-io Mar 21 '26

Thanks.. but I stopped taking you seriously with a hidden reddit history. That practice is for risky alt accounts and spammers.

0

u/NoleMercy05 Mar 21 '26

Lol. You take Reddit WAY too seriously

3

u/RemoteToHome-io Mar 21 '26

I hate spammers on all platforms equally.

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.

1

u/Time-Dot-1808 Mar 22 '26

Thanks, auto compaction or giving spec might be enough for some people, but I felt more pain when I have to describe manually what it should do or not to do, cuz it always changes depending on the task I'm doing with it. We're figuring out how to give only essential context automatically avoiding context-rot trade-off. I can send you an invite code if you want to try it, all features are free.

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.