DEV Community

Cover image for Agent-dispatch: your projects are already agents, just let them talk
Sungat Arynov
Sungat Arynov

Posted on

Agent-dispatch: your projects are already agents, just let them talk

I have three Claude Code agents. Coder lives in a repo. Analytics has Dbecho MCP access to prod database. Infra is hooked into Portainer MCP. They're great at their jobs, but they couldn't talk to each other. I was the router copying answers between windows, rephrasing questions, copying back.

So I built agent-dispatch to stop being a human clipboard.

The problem

The monolith approach one agent with ten MCP servers and a giant CLAUDE.md leads to tool confusion. Your agent tries to hit Portainer when you ask about SQL migrations because everything is in its peripheral vision.

The multi-session approach specialized agents in separate windows works, but you become the message bus. Three times a day is fine. Thirty is not.

The insight

Your projects are already agents. Each directory has a CLAUDE.md with domain knowledge, .mcp.json with tools, git history for context. You don't need to rebuild anything in a framework. You just need to connect them.

agent-dispatch add analytics ~/projects/analytics
agent-dispatch add infra ~/projects/infra
Enter fullscreen mode Exit fullscreen mode

That's it. agent-dispatch reads what's already there and registers the agent.

How it works

Each dispatch("analytics", "...") spawns a claude -p process in the target directory. It picks up that project's CLAUDE.md and MCP config automatically. The caller gets JSON back. Subprocess isolation one crashes, others don't care.

agent-dispatch is an MCP server itself, so any Claude Code session sees it as just another set of tools. No DSL, no orchestration framework.

Real example from yesterday: Coder asked Analytics if feature_x is still used (2% of users, declining). Then asked Infra about related prod errors (zero in a month). Feature deleted. I didn't touch anything.

Beyond simple calls

  • dispatch_parallel — fan out to multiple agents, gather results, synthesize. Map-reduce for expert opinions.
  • dispatch_dialogue — two agents iterate on an underspecified problem until [RESOLVED]. Like a PM-developer conversation, but both sides are AI.
  • dispatch_stream — real-time progress from the target agent. No more staring at a silent terminal.

Safety

Depth limit of 3 (no A→B→A loops). Concurrency semaphore. Per-agent dollar budgets. Response cache with 5-min TTL for repeated questions. All validated by Pydantic.

What this is NOT

Not a replacement for LangGraph/CrewAI (those are for building agents from scratch with complex graphs). Not autonomous — you're the human in the loop. Not worth using for questions your agent can answer itself each dispatch is a full Claude session.

Numbers

~900 lines Python. 115 tests. MIT. 10 MCP tools. Hot-reload config.

pip install agent-dispatch
Enter fullscreen mode Exit fullscreen mode

GitHub →

Top comments (0)