Gastown: Orchestrating Multi-Agent Development at Scale
When one AI coding agent isn't enough, how do you coordinate dozens of them? Gastown offers a compelling answer to this emerging challenge.
The Multi-Agent Problem
AI coding assistants like Claude Code have fundamentally changed how developers work. But there's a ceiling: a single agent operating within a context window can only handle so much complexity. For large-scale refactoring, multi-component features, or ambitious architectural changes, you need more than one agent.
Enter the coordination problem. Running multiple agents simultaneously introduces challenges that don't exist with a single assistant: How do agents communicate? How do you prevent conflicting changes? What happens when an agent crashes mid-task? These aren't theoretical concerns—they're practical barriers that anyone scaling AI-assisted development will encounter.
Gastown, created by Steve Yegge, is a multi-agent orchestrator designed specifically for AI coding agents. It's infrastructure for managing agent lifecycles, distributing work, and maintaining state across sessions—essentially Kubernetes for your AI coding workforce.
Core Architecture: Towns, Mayors, and Workers
Gastown organizes work through several key abstractions. At the highest level, a Town represents your workspace—a collection of projects, agents, and the infrastructure connecting them. Each Town has a Mayor: an AI coordinator (itself running Claude Code) with full context about the workspace, projects, and available agents. The Mayor creates work items, dispatches workers, and coordinates the overall effort.
Workers are the individual coding agents, each prompted to fulfill specific roles. Gastown defines seven well-defined worker roles, allowing specialization—some agents might focus on writing tests, others on documentation, and others on core implementation. This role-based approach mirrors how effective human teams operate: clear responsibilities with defined handoff points.
Convoys group related work items, providing tracking across projects. Think of a convoy as a feature branch for work coordination—it bundles all the tasks, agent assignments, and progress tracking needed to complete a larger objective.
The Propulsion Principle
Every orchestration system needs a fundamental operating principle, and Gastown's is elegantly simple: "If there is work on your hook, you must run it."
This Propulsion Principle (also called GUPP) addresses a critical challenge with AI coding agents: they end. Context windows fill up. Sessions terminate. Crashes happen. In a traditional setup, this means lost state and interrupted work.
Gastown's hooks persist independently of agent lifecycles. Work assignments survive crashes and restarts. When an agent wakes, it checks its hook, finds pending work, executes it, and either picks up the next item or requests shutdown. There's no ambiguity about what to do—the hook is the source of truth.
Formulas: Workflows That Survive Failure
Complex tasks require multi-step workflows. Gastown implements these through Formulas—reusable workflow templates with explicit dependencies. Each formula defines a sequence of steps, prerequisites, and expected outputs.
The key insight is crash recovery. Because formulas track completed steps, an interrupted workflow resumes from the last checkpoint rather than starting over. This is crucial at scale: when running 20-30 agents, the probability that something fails approaches certainty. Resilient workflows aren't optional—they're table stakes.
Beads: Git-Backed State Management
Traditional orchestrators maintain state in databases or message queues. Gastown takes a different approach with Beads, a Git-backed issue tracker where all work state lives. This design choice has several advantages:
- Persistence by default: Everything is versioned and stored in your repository
- Offline capability: Agents can work without network connectivity
- Debugging friendliness: You can inspect the full history of state changes
- No infrastructure dependency: No external databases to maintain
By storing work state in the same repository as the code, Gastown ensures that the project's complete context—source files, work items, and agent history—remains unified and portable.
Graceful Degradation
One of Gastown's more practical design decisions is graceful degradation. Every worker can operate independently or in small groups. You can run the full orchestration stack, a subset of components, or even "no-tmux" mode for simpler setups.
This modularity lowers the barrier to entry. You don't need to adopt the entire system to benefit from parts of it. Start with a few coordinated agents, add the Mayor when you need cross-project visibility, scale up components as your needs grow. The architecture supports incremental adoption rather than demanding full commitment upfront.
Practical Implications
What does multi-agent orchestration mean for day-to-day development? Consider a large refactoring effort: extracting a module into its own package while maintaining backward compatibility, updating all import paths, adding proper tests, and documenting the changes.
With a single agent, this might take multiple sessions as context windows fill and you restart with accumulated context. With Gastown, you could assign different aspects to specialized agents: one handles the core extraction, another updates imports, a third writes tests, and a fourth handles documentation. The Mayor coordinates handoffs, the convoy tracks overall progress, and formulas ensure each step completes before dependents begin.
The potential efficiency gain isn't just parallelism—it's also about keeping each agent's context focused. A test-writing agent doesn't need the full history of implementation debates; it needs the interface specification and testing requirements. Specialized context means better outputs.
Looking Forward
Gastown represents an early but significant step toward production multi-agent development environments. The core challenges it addresses—state persistence, work distribution, crash recovery, and agent coordination—will only become more pressing as AI coding tools improve and developers seek to leverage more of them simultaneously.
Whether Gastown's specific approach becomes standard or influences future tools, the problem space it explores is clearly important. As individual AI agents become more capable, the question shifts from "how do I get an agent to help me?" to "how do I coordinate multiple agents effectively?" That's a fundamentally different challenge, and tools like Gastown are leading the way in addressing it.
Resources
- Gastown on GitHub — Source code and documentation
- Beads — Git-backed issue tracker