steveyegge/gastown
{ "createdAt": "2025-12-16T00:33:33Z", "defaultBranch": "main", "description": "Gas Town - multi-agent workspace manager", "fullName": "steveyegge/gastown", "homepage": "", "language": "Go", "name": "gastown", "pushedAt": "2026-01-20T01:40:04Z", "stargazersCount": 4723, "topics": [], "updatedAt": "2026-01-20T01:40:08Z", "url": "https://github.com/steveyegge/gastown"}Gas Town
Section titled “Gas Town”Multi-agent orchestration system for Claude Code with persistent work tracking
Overview
Section titled “Overview”Gas Town is a workspace manager that lets you coordinate multiple Claude Code agents working on different tasks. Instead of losing context when agents restart, Gas Town persists work state in git-backed hooks, enabling reliable multi-agent workflows.
What Problem Does This Solve?
Section titled “What Problem Does This Solve?”| Challenge | Gas Town Solution |
|---|---|
| Agents lose context on restart | Work persists in git-backed hooks |
| Manual agent coordination | Built-in mailboxes, identities, and handoffs |
| 4-10 agents become chaotic | Scale comfortably to 20-30 agents |
| Work state lost in agent memory | Work state stored in Beads ledger |
Architecture
Section titled “Architecture”graph TB Mayor[The Mayor<br/>AI Coordinator] Town[Town Workspace<br/>~/gt/]
Town --> Mayor Town --> Rig1[Rig: Project A] Town --> Rig2[Rig: Project B]
Rig1 --> Crew1[Crew Member<br/>Your workspace] Rig1 --> Hooks1[Hooks<br/>Persistent storage] Rig1 --> Polecats1[Polecats<br/>Worker agents]
Rig2 --> Crew2[Crew Member] Rig2 --> Hooks2[Hooks] Rig2 --> Polecats2[Polecats]
Hooks1 -.git worktree.-> GitRepo1[Git Repository] Hooks2 -.git worktree.-> GitRepo2[Git Repository]
style Mayor fill:#e1f5ff style Town fill:#f0f0f0 style Rig1 fill:#fff4e1 style Rig2 fill:#fff4e1Core Concepts
Section titled “Core Concepts”The Mayor 🎩
Section titled “The Mayor 🎩”Your primary AI coordinator. The Mayor is a Claude Code instance with full context about your workspace, projects, and agents. Start here - just tell the Mayor what you want to accomplish.
Town 🏘️
Section titled “Town 🏘️”Your workspace directory (e.g., ~/gt/). Contains all projects, agents, and configuration.
Rigs 🏗️
Section titled “Rigs 🏗️”Project containers. Each rig wraps a git repository and manages its associated agents.
Crew Members 👤
Section titled “Crew Members 👤”Your personal workspace within a rig. Where you do hands-on work.
Polecats 🦨
Section titled “Polecats 🦨”Ephemeral worker agents that spawn, complete a task, and disappear.
Hooks 🪝
Section titled “Hooks 🪝”Git worktree-based persistent storage for agent work. Survives crashes and restarts.
Convoys 🚚
Section titled “Convoys 🚚”Work tracking units. Bundle multiple beads that get assigned to agents.
Beads Integration 📿
Section titled “Beads Integration 📿”Git-backed issue tracking system that stores work state as structured data.
Bead IDs (also called issue IDs) use a prefix + 5-character alphanumeric format (e.g., gt-abc12, hq-x7k2m). The prefix indicates the item’s origin or rig. Commands like gt sling and gt convoy accept these IDs to reference specific work items. The terms “bead” and “issue” are used interchangeably—beads are the underlying data format, while issues are the work items stored as beads.
New to Gas Town? See the [Glossary]!(docs/glossary.md) for a complete guide to terminology and concepts.
Installation
Section titled “Installation”Prerequisites
Section titled “Prerequisites”- Go 1.23+ - go.dev/dl
- Git 2.25+ - for worktree support
- beads (bd) 0.44.0+ - github.com/steveyegge/beads (required for custom type support)
- sqlite3 - for convoy database queries (usually pre-installed on macOS/Linux)
- tmux 3.0+ - recommended for full experience
- Claude Code CLI (default runtime) - claude.ai/code
- Codex CLI (optional runtime) - developers.openai.com/codex/cli
# Install Gas Towngo install github.com/steveyegge/gastown/cmd/gt@latest
# Add Go binaries to PATH (add to ~/.zshrc or ~/.bashrc)export PATH="$PATH:$HOME/go/bin"
# Create workspace with git initializationgt install ~/gt --gitcd ~/gt
# Add your first projectgt rig add myproject https://github.com/you/repo.git
# Create your crew workspacegt crew add yourname --rig myprojectcd myproject/crew/yourname
# Start the Mayor session (your main interface)gt mayor attachQuick Start Guide
Section titled “Quick Start Guide”Getting Started
Section titled “Getting Started”Run
gt install ~/gt --git &&cd ~/gt &> config agent list &> mayor attachand tell the Mayor what you want to build!
Basic Workflow
Section titled “Basic Workflow”sequenceDiagram participant You participant Mayor participant Convoy participant Agent participant Hook
You->>Mayor: Tell Mayor what to build Mayor->>Convoy: Create convoy with beads Mayor->>Agent: Sling bead to agent Agent->>Hook: Store work state Agent->>Agent: Complete work Agent->>Convoy: Report completion Mayor->>You: Summary of progressExample: Feature Development
Section titled “Example: Feature Development”# 1. Start the Mayorgt mayor attach
# 2. In Mayor session, create a convoy with bead IDsgt convoy create "Feature X" gt-abc12 gt-def34 --notify --human
# 3. Assign work to an agentgt sling gt-abc12 myproject
# 4. Track progressgt convoy list
# 5. Monitor agentsgt agentsCommon Workflows
Section titled “Common Workflows”Mayor Workflow (Recommended)
Section titled “Mayor Workflow (Recommended)”Best for: Coordinating complex, multi-issue work
flowchart LR Start([Start Mayor]) --> Tell[Tell Mayor<br/>what to build] Tell --> Creates[Mayor creates<br/>convoy + agents] Creates --> Monitor[Monitor progress<br/>via convoy list] Monitor --> Done{All done?} Done -->|No| Monitor Done -->|Yes| Review[Review work]Commands:
# Attach to Mayorgt mayor attach
# In Mayor, create convoy and let it orchestrategt convoy create "Auth System" gt-x7k2m gt-p9n4q --notify
# Track progressgt convoy listMinimal Mode (No Tmux)
Section titled “Minimal Mode (No Tmux)”Run individual runtime instances manually. Gas Town just tracks state.
gt convoy create "Fix bugs" gt-abc12 # Create convoy (sling auto-creates if skipped)gt sling gt-abc12 myproject # Assign to workerclaude --resume # Agent reads mail, runs work (Claude)# or: codex # Start Codex in the workspacegt convoy list # Check progressBeads Formula Workflow
Section titled “Beads Formula Workflow”Best for: Predefined, repeatable processes
Formulas are TOML-defined workflows stored in .beads/formulas/.
Example Formula (.beads/formulas/release.formula.toml):
description = "Standard release process"formula = "release"version = 1
[vars.version]description = "The semantic version to release (e.g., 1.2.0)"required = true
[[steps]]id = "bump-version"title = "Bump version"description = "Run ./scripts/bump-version.sh {{version}}"
[[steps]]id = "run-tests"title = "Run tests"description = "Run make test"needs = ["bump-version"]
[[steps]]id = "build"title = "Build"description = "Run make build"needs = ["run-tests"]
[[steps]]id = "create-tag"title = "Create release tag"description = "Run git tag -a v{{version}} -m 'Release v{{version}}'"needs = ["build"]
[[steps]]id = "publish"title = "Publish"description = "Run ./scripts/publish.sh"needs = ["create-tag"]Execute:
# List available formulasbd formula list
# Run a formula with variablesbd cook release --var version=1.2.0
# Create formula instance for trackingbd mol pour release --var version=1.2.0Manual Convoy Workflow
Section titled “Manual Convoy Workflow”Best for: Direct control over work distribution
# Create convoy manuallygt convoy create "Bug Fixes" --human
# Add issues to existing convoygt convoy add hq-cv-abc gt-m3k9p gt-w5t2x
# Assign to specific agentsgt sling gt-m3k9p myproject/my-agent
# Check statusgt convoy showRuntime Configuration
Section titled “Runtime Configuration”Gas Town supports multiple AI coding runtimes. Per-rig runtime settings are in settings/config.json.
{ "runtime": { "provider": "codex", "command": "codex", "args": [], "prompt_mode": "none" }}Notes:
- Claude uses hooks in
.claude/settings.jsonfor mail injection and startup. - For Codex, set
project_doc_fallback_filenames = ["CLAUDE.md"]in~/.codex/config.tomlso role instructions are picked up. - For runtimes without hooks (e.g., Codex), Gas Town sends a startup fallback
after the session is ready:
gt prime, optionalgt mail check --injectfor autonomous roles, andgt nudge deacon session-started.
Key Commands
Section titled “Key Commands”Workspace Management
Section titled “Workspace Management”gt install <path> # Initialize workspacegt rig add <name> <repo> # Add projectgt rig list # List projectsgt crew add <name> --rig <rig> # Create crew workspaceAgent Operations
Section titled “Agent Operations”gt agents # List active agentsgt sling <bead-id> <rig> # Assign work to agentgt sling <bead-id> <rig> --agent cursor # Override runtime for this sling/spawngt mayor attach # Start Mayor sessiongt mayor start --agent auggie # Run Mayor with a specific agent aliasgt prime # Context recovery (run inside existing session)Built-in agent presets: claude, gemini, codex, cursor, auggie, amp
Convoy (Work Tracking)
Section titled “Convoy (Work Tracking)”gt convoy create <name> [issues...] # Create convoy with issuesgt convoy list # List all convoysgt convoy show [id] # Show convoy detailsgt convoy add <convoy-id> <issue-id...> # Add issues to convoyConfiguration
Section titled “Configuration”# Set custom agent commandgt config agent set claude-glm "claude-glm --model glm-4"gt config agent set codex-low "codex --thinking low"
# Set default agentgt config default-agent claude-glm
# View configgt config showBeads Integration
Section titled “Beads Integration”bd formula list # List formulasbd cook <formula> # Execute formulabd mol pour <formula> # Create trackable instancebd mol list # List active instancesCooking Formulas
Section titled “Cooking Formulas”Gas Town includes built-in formulas for common workflows. See .beads/formulas/ for available recipes.
Dashboard
Section titled “Dashboard”Gas Town includes a web dashboard for monitoring:
# Start dashboardgt dashboard --port 8080
# Open in browseropen http://localhost:8080Features:
- Real-time agent status
- Convoy progress tracking
- Hook state visualization
- Configuration management
Advanced Concepts
Section titled “Advanced Concepts”The Propulsion Principle
Section titled “The Propulsion Principle”Gas Town uses git hooks as a propulsion mechanism. Each hook is a git worktree with:
- Persistent state - Work survives agent restarts
- Version control - All changes tracked in git
- Rollback capability - Revert to any previous state
- Multi-agent coordination - Shared through git
Hook Lifecycle
Section titled “Hook Lifecycle”stateDiagram-v2 [*] --> Created: Agent spawned Created --> Active: Work assigned Active --> Suspended: Agent paused Suspended --> Active: Agent resumed Active --> Completed: Work done Completed --> Archived: Hook archived Archived --> [*]MEOW (Mayor-Enhanced Orchestration Workflow)
Section titled “MEOW (Mayor-Enhanced Orchestration Workflow)”MEOW is the recommended pattern:
- Tell the Mayor - Describe what you want
- Mayor analyzes - Breaks down into tasks
- Convoy creation - Mayor creates convoy with beads
- Agent spawning - Mayor spawns appropriate agents
- Work distribution - Beads slung to agents via hooks
- Progress monitoring - Track through convoy status
- Completion - Mayor summarizes results
Shell Completions
Section titled “Shell Completions”# Bashgt completion bash > /etc/bash_completion.d/gt
# Zshgt completion zsh > "${fpath[1]}/_gt"
# Fishgt completion fish > ~/.config/fish/completions/gt.fishProject Roles
Section titled “Project Roles”| Role | Description | Primary Interface |
|---|---|---|
| Mayor | AI coordinator | gt mayor attach |
| Human (You) | Crew member | Your crew directory |
| Polecat | Worker agent | Spawned by Mayor |
| Hook | Persistent storage | Git worktree |
| Convoy | Work tracker | gt convoy commands |
- Always start with the Mayor - It’s designed to be your primary interface
- Use convoys for coordination - They provide visibility across agents
- Leverage hooks for persistence - Your work won’t disappear
- Create formulas for repeated tasks - Save time with Beads recipes
- Monitor the dashboard - Get real-time visibility
- Let the Mayor orchestrate - It knows how to manage agents
Troubleshooting
Section titled “Troubleshooting”Agents lose connection
Section titled “Agents lose connection”Check hooks are properly initialized:
gt hooks listgt hooks repairConvoy stuck
Section titled “Convoy stuck”Force refresh:
gt convoy refresh <convoy-id>Mayor not responding
Section titled “Mayor not responding”Restart Mayor session:
gt mayor detachgt mayor attachLicense
Section titled “License”MIT License - see LICENSE file for details