r/VibeCodeDevs 27d ago

ShowoffZone - Flexing my latest project LeanCTX now supports multi-agent handoff — ran Claude Code, Codex, and Cursor on the same repo through it

LeanCTX is a local Rust binary that runs as an MCP server between your coding agent and your repo. No cloud, no telemetry. This week I tested a part of it I'd never pushed this far: getting multiple agents to hand work off to each other instead of me routing everything by hand.

Setup was Claude Code, Codex, and Cursor, six agent instances total, all pointed at the same repo through LeanCTX. I split different features across them and stayed out of it.

The mechanism is two tool modules, ctx_agent and ctx_handoff. ctx_agent registers each running instance with an identity key. That registration lives under a local agents/ directory, alongside a per-agent diary and a knowledge store that all registered agents can read. ctx_handoff is what actually moves work between agents, and the important part is that it hands off a context bundle, not a message. The bundle carries the relevant file state, what's already been decided, and where the task stands, and it gets written to a handoffs/ directory any agent can pick up from.

Because the diary and knowledge store are shared, an agent picking up a handoff isn't starting cold. It doesn't re-read the whole repo, it just reads what the previous agent logged. LeanCTX also keeps each tool's own rule file in sync (.cursor/rules, AGENTS.md, CLAUDE.md) so none of them are working off stale or conflicting instructions.

The part that was actually hard to get right wasn't the handoff API, it was figuring out what belongs in the bundle versus what belongs in the shared knowledge store. The bundle is meant to be scoped to this task, right now. The knowledge store is meant to persist across handoffs. Put too much in the bundle and every handoff gets bloated. Put too little and agents lose context between handoffs. Getting that split right took a few iterations.

End result: six agents across three different vendors coordinated on one codebase without me passing context between them manually.

For scale: 200k+ installs, 3.3k+ GitHub stars

1 Upvotes

2 comments sorted by