mpg: A Multi-Project Gateway for Claude Code (Retired)
A Discord-based router that gave Claude Code multi-project coordination, agent personas, per-thread worktrees, and observability — until the platform absorbed it.
2026-05-18
Executive Summary
mpg (multi-project-gateway) is a Discord-based control plane for Claude Code that I ran as my primary development interface from March to May 2026. It routed messages from multiple Discord channels into per-project Claude Code sessions, supported agent personas with explicit handoff grammar, gave each thread its own git worktree, and exposed a dashboard for token, cost, and session metrics.
It shipped through 0.6.0 and drove most of my AI-first development workflow for two months. As of May 2026, mpg is in maintenance — most of what it did has been absorbed by Claude's official surfaces (Claude Remote, skill-based personas, the official Discord integration), and a pricing change for Agent SDK and claude -p usage made running mpg at API rates uneconomical (~$800/month for modest personal use).
This is the retrospective writeup. The longer reflection lives in The Death of a Product: Notes from Wrapping Up mpg.
The Problem
By early 2026 I was running Claude Code across half a dozen projects in parallel — yamakei.info, intentlayer, householdos, ayumi, rallyhub, mpg itself. The friction wasn't capability; the model could already do most of what I needed. The friction was interface:
- The official Claude Code Discord plugin only supported one project per bot token.
- Switching projects meant switching tmux panes or terminals — not something I could do from a phone.
- There was no first-class way to coordinate multiple agents inside one workflow (e.g., a PM agent dispatching to an Engineer agent).
- Parallel agent work on the same repo caused conflicts when two sessions wrote to the same files.
- There was no observability layer for token spend, session length, or cache-hit patterns across projects.
Each of those was a small thesis: a thing AI-first development needed that the platform didn't yet ship.
What I Built
A Discord bot that acts as the gateway. Each project gets one or more channels; each thread gets a Claude Code session. The bot routes messages, manages session lifecycle, and surfaces telemetry through a separate web dashboard.

Core capabilities:
- Multi-project routing. One bot token, many projects. Channel-to-project mapping with per-project Claude Code configurations, environment variables, and tool allowlists.
- Per-thread git worktrees. Each Discord thread gets its own worktree under
.claude/worktrees/. Agents working in parallel on the same repo don't step on each other; cleanup happens via git's existing semantics when the thread is resolved. - Persona system with explicit handoff grammar. A
HANDOFF @agent:syntax in a message hands the conversation off to a different persona (e.g., from aPlannerpersona to anImplementerpersona) with structured context. Personas were Markdown files with system prompts + tool allowlists. - Session-introspection bridge. A
!sessioncommand surfaces the underlying Claude Code session ID and resume command, so I could pick up work on a desktop CLI where I'd started on phone Discord. - Telemetry dashboard. Per-session token use, cost, model, cache hit rate, duration. Aggregated by project and persona. The dashboard turned out to be the highest-leverage feature — see "What I Learned."
Architecture
The "AI" part was a single claude CLI invocation per turn. Almost all of the lines of code went into coordination: routing, handoffs, worktree lifecycle, session state, telemetry.

What Shipped
- 0.1.x — Single-project Discord proxy with a thin session abstraction. Replaced my tmux-based workflow (essay).
- 0.2.x — Multi-project routing. Per-project config files and per-project worktree roots.
- 0.3.x — Per-thread git worktrees. Concurrent agent work on the same repo stopped causing conflicts.
- 0.4.x — Persona system +
HANDOFFgrammar. First-class multi-agent coordination inside one workflow (essay). - 0.5.x — Telemetry collection and dashboard. Token, cost, cache, session metrics surfaced per project and persona.
- 0.6.0 — Final stable release. Polish, bug fixes,
!sessionresume bridge, persona inheritance.
What I Learned
The bottleneck was interface, not capability. The model could already do almost everything I needed before mpg existed. What I was actually building was a way to reach the model, organize work across it, and see what it was doing. The version that mattered most wasn't the one that added a new capability — it was the one that added the dashboard.
Coordination is the actual problem. By lines of code, the bulk of mpg was routing, handoffs, worktree management, and session state. The AI was a single CLI call. Most of the value in AI-first tooling sits in the social and operational scaffolding around the model, not in the model layer itself.
Worktrees are the right unit for agent parallelism. Containers are too heavy. File locks are too fragile. Git worktrees gave me isolation at exactly the right level — shared repository, independent working state — and git's existing semantics handled cleanup for free.
Observability has to exist before you think you need it. I added the dashboard because I felt blind about cost. I didn't expect that having visibility would change how I worked. Once I could see which personas burned the most tokens, which projects had pathological cache-miss patterns, which sessions ran longer than they should — I started organizing my work around that signal. AI workflows are invisible by default; you can't manage what you can't see.


Status Now: Maintenance Mode
By May 2026, the platform had largely absorbed mpg's reasons for existing:
- Claude Remote handles most remote-access cases.
- Skill-based personas cover most of what mpg's persona system did.
- The official Claude Code Discord integration matured to handle multi-project use natively.
A few things mpg still does better — initiating a new session for a workspace directly from Remote, persona-based handover with explicit grammar, the !session resume bridge — and I'll keep using it for those. But "almost as good as mpg, plus first-party and stable" wins in nearly every workflow.
The Agent SDK / claude -p pricing change in May 2026 made the decision concrete sooner than I expected. Running mpg at API rates costs ~$800/month for modest personal use; the subscription economics that justified it are gone.
mpg is in maintenance: no new features, occasional fixes, narrowed scope to the cases where it still earns its keep. Tools the platform absorbs in a year aren't failures — they're signal that the thesis was directionally right and the platform agreed.
Links
- Repo: github.com/yama-kei/multi-project-gateway
- Origin essay: From tmux to Discord
- Multi-agent evolution: From Message Router to Agent Team
- Why the chat-app interface won: The Familiar Interface
- Retrospective essay: The Death of a Product