HackerTrans
TopNewTrendsCommentsPastAskShowJobs

h1r1ms

no profile record

Submissions

Show HN: Subagent-reuse, an MCP to reuse Claude Code subagent context

1 points·by h1r1ms·4 mesi fa·3 comments

Show HN: subagent-reuse – MCP that stops Claude Code subagents re-reading files

2 points·by h1r1ms·4 mesi fa·1 comments

comments

h1r1ms
·4 mesi fa·discuss
Yeah, any feedbacks?
h1r1ms
·4 mesi fa·discuss
GitHub: https://github.com/itsamruth/subagent-reuse

Medium: https://medium.com/@itsamruth/stop-burning-tokens-how-to-use...

I built subagent-reuse after noticing that Claude Code subagents often re-read the same files and rebuild the same context from scratch.

It scans Claude’s local session storage, tracks which files each subagent has already read or modified, and routes new work to an existing agent when there’s enough overlap. It also warns when files have changed since that agent last saw them.
h1r1ms
·4 mesi fa·discuss
Try this mcp for agents https://github.com/itsamruth/subagent-reuse
h1r1ms
·4 mesi fa·discuss
GitHub: https://github.com/itsamruth/subagent-reuse

Blog post with full context: https://medium.com/@itsamruth/stop-burning-tokens-how-to-use...

I built this after noticing a painful pattern with Claude Code: every new subagent (planner, explorer, implementer, fixer) would re-read the same files from scratch — burning hundreds of tokens each time on files like src/auth/callback.ts.

subagent-reuse solves it by automatically scanning Claude's native session storage (~/.claude/projects/) and tracking exactly which files each subagent has already read and modified. It builds a SHA-256 Merkle tree per agent for fast lookup.

Before spawning a subagent, it runs route_task(task, files). - Strong file overlap → REUSE the existing agent - File changed since last read → staleness warning (only re-read what's needed) - No good match → CREATE_NEW + summaries of existing agents so Claude can decide

I kept routing purely structural (file overlap + directory + recency). No embeddings or word matching — the calling LLM is better at semantics anyway.

Install (one command):

    npx subagent-reuse --setup
It adds the MCP and auto-approves permissions.

This is part of a small stack I'm using to make Claude Code dramatically more efficient (routing + semantic search + memory).

Code is ~1000 lines of vanilla JS with 52 tests.

Would love feedback especially on the routing approach — is staying purely structural the right decision, or should I add something smarter when the task doesn't specify file paths?

Happy to answer any questions!
h1r1ms
·5 mesi fa·discuss
Are you referring to per-chat context graphs? Where each interaction updates a structured state (constraints, entities, dependencies), instead of relying on tools like Mem0/Supermemory that only persist raw memory.
h1r1ms
·6 mesi fa·discuss
Nice, hope it solves your problem. Let me know how it goes
h1r1ms
·6 mesi fa·discuss
Its good, also perplexity, gork some more startups uses E2B. https://e2b.dev/ have you tried this one? E2b also uses firecracker.
h1r1ms
·6 mesi fa·discuss
Have you tried amazon firecracker?
h1r1ms
·6 mesi fa·discuss
I think this is a universal problem: after a break, you reopen a project and spend more time rebuilding context than actually coding. I’m thinking of a Cursor-style chat that acts as project memory, it can answer “what did I do last?” and “what changed since then?” using git/PR history, and also lets me drop quick ideas for Project A while I’m working on Project B, so it reminds me when I come back. Would you use something like this, or is there a simpler workflow that already solves it?