gastown README

The project's README from github.com/gastownhall/gastown. As one markdown file: README.md.

Gas Town

Multi-agent orchestration system for Claude Code, GitHub Copilot, and other AI agents with persistent work tracking

Overview

Gas Town is a workspace manager that lets you coordinate multiple AI coding agents (Claude Code, GitHub Copilot, Codex, Gemini, and others) 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?

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

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,color:#000000
    style Town fill:#f0f0f0,color:#000000
    style Rig1 fill:#fff4e1,color:#000000
    style Rig2 fill:#fff4e1,color:#000000

Core Concepts

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 🏘️

Your workspace directory (e.g., ~/gt/). Contains all projects, agents, and configuration.

Rigs 🏗️

Project containers. Each rig wraps a git repository and manages its associated agents.

Crew Members 👤

Your personal workspace within a rig. Where you do hands-on work.

Polecats 🦨

Worker agents with persistent identity but ephemeral sessions. Spawned for tasks, sessions end on completion, but identity and work history persist.

Hooks 🪝

Git worktree-based persistent storage for agent work. Survives crashes and restarts.

Convoys 🚚

Work tracking units. Bundle multiple beads that get assigned to agents. Convoys labeled mountain get autonomous stall detection and smart skip logic for epic-scale execution.

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.

Molecules 🧬

Workflow templates that coordinate multi-step work. Formulas (TOML definitions) are instantiated as molecules with tracked steps. Two modes: root-only wisps (steps materialized at runtime, lightweight) and poured wisps (steps materialized as sub-wisps with checkpoint recovery). See Molecules.

Monitoring: Witness, Deacon, Dogs 🐕

A three-tier watchdog system keeps agents healthy:

Refinery 🏭

Per-rig merge queue processor. When polecats complete work via gt done, the Refinery batches merge requests, runs verification gates, and merges to main using a Bors-style bisecting queue. Failed MRs are isolated and either fixed inline or re-dispatched.

Escalation 🚨

Severity-routed issue escalation. Agents that hit blockers escalate via gt escalate, which creates tracked beads routed through the Deacon, Mayor, and (if needed) Overseer. Severity levels: CRITICAL (P0), HIGH (P1), MEDIUM (P2). See Escalation.

Scheduler ⏱️

Config-driven capacity governor for polecat dispatch. Prevents API rate limit exhaustion by batching dispatch under configurable concurrency limits. Default is direct dispatch; set scheduler.max_polecats to enable deferred dispatch with the daemon. See Scheduler.

Seance 👻

Session discovery and continuation. Discovers previous agent sessions via .events.jsonl logs, enabling agents to query their predecessors for context and decisions from earlier work.

gt seance                       # List discoverable predecessor sessions
gt seance --talk <id> -p "What did you find?"  # One-shot question

Wasteland 🏜️

Federated work coordination network linking Gas Towns through DoltHub. Rigs post wanted items, claim work from other towns, submit completion evidence, and earn portable reputation via multi-dimensional stamps. See Wasteland.

New to Gas Town? See the Glossary for a complete guide to terminology and concepts.

Installation

Choose one of the two setup paths below: install Gas Town on your host, or run it inside a Docker container.

Prerequisites

Native installs require the host tools below. Docker installs only require Docker Compose on the host; the image supplies Go, Dolt, bd, tmux, and CLI utilities inside the container. The platform steps below say when a path installs gt, bd, and dolt for you and when you install them separately.

Tool Version Notes
Git 2.20+ Worktree support
Go 1.26.2+ (see go.mod) Required for the Linux and Windows paths and for macOS source builds. Not needed for brew install gastown or Docker setup.
Beads (bd) 0.57.0+ Required for native installs. Homebrew and Docker supply it; source/native Go paths install it with go install.
sqlite3 any Used by convoy database queries. Usually pre-installed on macOS and Linux.
ICU4C dev headers varies Required for source builds that compile the ICU-backed query layer. Use libicu-dev on Debian/Ubuntu, libicu-devel on Fedora/RHEL, icu4c on macOS, and MSYS2 ICU packages for native Windows.
tmux 3.0+ Required for gt up and the tmux-backed roles (Mayor, Witnesses, Refineries, polecats). Optional only for minimal-mode workflows where you run runtime instances manually.
Claude Code CLI latest Default runtime. See Runtime Configuration for alternatives (Codex, Copilot, Gemini, Cursor).

Local setup

Install the prerequisites listed above, then install gt for your platform.

Install gt on macOS

Homebrew installs gt, bd, and dolt together.

brew install gastown

Avoid go install on macOS. The unsigned binary it produces gets killed by Gatekeeper. To build from source, install Dolt and ICU4C with Homebrew, install bd with Go, then build and install gt with make install. Put $HOME/.local/bin and $HOME/go/bin ahead of any stale binary locations on your PATH so the freshly installed gt and bd take precedence.

brew install dolt icu4c
go install github.com/steveyegge/beads/cmd/bd@latest
export PATH="$HOME/.local/bin:$HOME/go/bin:$PATH"
git clone https://github.com/steveyegge/gastown.git
cd gastown
make install

Install gt on Linux

Install Dolt by following the Dolt installation guide, then install gt and bd with go install.

go install github.com/steveyegge/gastown/cmd/gt@latest
go install github.com/steveyegge/beads/cmd/bd@latest

Prepend the Go binary directory to your PATH if it is not already there, so freshly installed gt and bd binaries take precedence over stale copies. Append to ~/.zshrc instead if you use zsh.

echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Install gt on Windows

Install Dolt first by following the Dolt installation guide. Unlike the macOS Homebrew path, go install does not install Dolt. Then install gt and bd with go install.

go install github.com/steveyegge/gastown/cmd/gt@latest
go install github.com/steveyegge/beads/cmd/bd@latest

Both binaries land in %USERPROFILE%\go\bin\. Put that directory before older gt or bd install locations on PATH, then open a new shell for the change to take effect.

Native Windows source builds that compile the ICU-backed query layer need an MSYS2 UCRT64 or MinGW64 shell with matching icu, toolchain, and pkg-config packages; the repository's Windows CI uses pacboy -S icu:p toolchain:p pkg-config:p. Plain PowerShell/MSVC is not enough for that CGO build.

For full tmux-backed workflows on Windows, use WSL or another Linux environment. Native Windows shells are best treated as minimal CLI-only environments.

Create your workspace

Run gt install to create your headquarters (HQ) at ~/gt. The --shell flag installs shell integration and enables Gas Town globally. The --git flag initializes the HQ as a git repository. Before using --git, set git config --global user.name and git config --global user.email so the initial commit has a valid identity.

git config --global user.name "Your Name"
git config --global user.email "[email protected]"
gt install ~/gt --shell --git
cd ~/gt

Start the long-lived services. gt up boots Dolt, the daemon, the Deacon, the Mayor, and per-rig Witnesses and Refineries.

gt up

Verify the install. The --fix flag clears the warnings that gt install does not preempt.

gt doctor --fix

Add a project

Use gt rig add to clone a repository into your HQ as a rig.

gt rig add myproject https://github.com/you/repo.git

Rig names accept letters, digits, and underscores. Hyphens, dots, spaces, and path separators are not allowed. Use my_project instead of my-project.

To set a custom beads prefix for the rig, pass --prefix.

gt rig add myproject https://github.com/you/repo.git --prefix mp

Create your crew workspace

A crew workspace is a personal git clone where you do hands-on work.

gt crew add yourname --rig myproject
cd myproject/crew/yourname

Start the Mayor

The Mayor coordinates work across rigs.

gt mayor attach

Docker Compose setup

docker-compose.yml runs Gas Town inside a sandbox container. The container hosts an HQ at /gt, which Compose bind-mounts from ${FOLDER} on the host. The entrypoint runs gt install /gt --git against that directory on first start, so FOLDER must point at an empty directory that you want to become the HQ or an existing Gas Town HQ. Set GIT_USER and GIT_EMAIL so git and Dolt commits do not use the default test identity. See the full Docker guide for lifecycle, storage, and security details.

export GIT_USER="<your name>"
export GIT_EMAIL="<your email>"
export FOLDER="/path/to/empty/dir"   # empty directory or existing Gas Town HQ
export DASHBOARD_PORT=8080           # optional, host port for the dashboard

mkdir -p "$FOLDER"
docker compose build              # only needed on first run or after code changes
docker compose up -d
docker compose logs -f gastown    # wait for "HQ created successfully!", then Ctrl-C

docker compose exec gastown zsh   # or bash

Inside the container, finish bootstrapping.

gt enable                         # enable Gas Town global state
gt shell install                  # install shell integration
gt up --restore                   # start services and restore worker settings
gh auth login                     # optional: required for private GitHub rigs
gt mayor attach

The dashboard port is exposed from the container to the host. Treat it as a trusted local-network surface, and do not point FOLDER at a host workspace that a native gt install is using at the same time.

Quick Start Guide

Getting Started

Run

git config --global user.name "Your Name" &&
git config --global user.email "[email protected]" &&
gt install ~/gt --shell --git &&
cd ~/gt &&
gt up &&
gt doctor --fix &&
gt config agent list &&
gt mayor attach

and tell the Mayor what you want to build!


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 progress

Example: Feature Development

# 1. Start the Mayor
gt mayor attach

# 2. In Mayor session, create a convoy with bead IDs
gt convoy create "Feature X" gt-abc12 gt-def34 --notify --human

# 3. Assign work to an agent
gt sling gt-abc12 myproject

# 4. Track progress
gt convoy list

# 5. Monitor agents
gt agents

Common Workflows

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 Mayor
gt mayor attach

# In Mayor, create convoy and let it orchestrate
gt convoy create "Auth System" gt-x7k2m gt-p9n4q --notify

# Track progress
gt convoy list

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 worker
claude --resume                        # Agent reads mail, runs work (Claude)
# or: codex                            # Start Codex in the workspace
gt convoy list                         # Check progress

Beads Formula Workflow

Best for: Predefined, repeatable processes

Formulas are TOML-defined workflows embedded in the gt binary (source in internal/formula/formulas/).

Example Formula (internal/formula/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 formulas
bd formula list

# Run a formula with variables
bd cook release --var version=1.2.0

# Create formula instance for tracking
bd mol pour release --var version=1.2.0

Manual Convoy Workflow

Best for: Direct control over work distribution

# Create convoy manually
gt convoy create "Bug Fixes" --human

# Add issues to existing convoy
gt convoy add hq-cv-abc gt-m3k9p gt-w5t2x

# Assign to specific agents
gt sling gt-m3k9p myproject/my-agent

# Check status
gt convoy show

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:

Key Commands

Workspace Management

gt install <path>           # Initialize workspace
gt rig add <name> <repo>    # Add project
gt rig list                 # List projects
gt crew add <name> --rig <rig>  # Create crew workspace

Agent Operations

gt agents                   # List active agents
gt sling <bead-id> <rig>    # Assign work to agent
gt sling <bead-id> <rig> --agent cursor   # Override runtime for this sling/spawn
gt mayor attach             # Start Mayor session
gt mayor start --agent auggie           # Run Mayor with a specific agent alias
gt prime                    # Context recovery (run inside existing session)
gt feed                     # Real-time activity feed (TUI)
gt feed --problems          # Start in problems view (stuck agent detection)

Built-in agent presets: claude, gemini, codex, kiro, cursor, auggie, amp, opencode, copilot, pi, omp

The kiro preset launches kiro-cli chat --trust-all-tools, supports Kiro's documented --resume / --resume-id session flags, and does not install Kiro hooks or .kiro project files.

Convoy (Work Tracking)

gt convoy create <name> [issues...]   # Create convoy with issues
gt convoy list              # List all convoys
gt convoy show [id]         # Show convoy details
gt convoy add <convoy-id> <issue-id...>  # Add issues to convoy

Configuration

# Set custom agent command
gt config agent set claude-glm "claude-glm --model glm-4"
gt config agent set codex-low "codex --thinking low"

# Set default agent
gt config default-agent claude-glm

Monitoring & Health

gt escalate -s HIGH "description"  # Escalate a blocker
gt escalate list               # List open escalations
gt scheduler status            # Show scheduler state
gt seance                      # Discover previous sessions
gt seance --talk <id>          # Query a predecessor session

Beads Integration

bd formula list             # List formulas
bd cook <formula>           # Execute formula
bd mol pour <formula>       # Create trackable instance
bd mol list                 # List active instances

Wasteland Federation

gt wl join <remote>            # Join a wasteland
gt wl browse                   # View wanted board
gt wl claim <id>               # Claim work
gt wl done <id> --evidence <url>  # Submit completion

Cooking Formulas

Gas Town includes built-in formulas for common workflows. See internal/formula/formulas/ for available recipes.

Activity Feed

`g

gastown (gastownhall/gastown)

Searching Database…

18.4K ·GitHub
这是什么?Gas Town 是一个工作区管理工具,可以协调多个 AI 编程代理(Claude Code、GitHub Copilot、Codex、Gemini 等)同时处理不同任务,并把它们的工作状态保存在基于 git 的存储中,这样代理重启后上下文也不会丢失。
它只是一个命令行工具,还是也会运行后台服务?两者都有:一个 `gt` 命令行工具,加上长期运行的本地服务(Dolt 数据库、守护进程、Deacon 监督器、Mayor 协调器,以及每个 rig 对应的 Witness 和 Refinery)。运行 `gt up` 时,这些服务会在 tmux 中启动并持续运行。
我该如何让 Gas Town 运行起来?先安装前置依赖,然后运行 `gt install` 在 ~/gt 创建你的总部(HQ),再运行 `gt up` 启动长期运行的服务,用 `gt rig add` 把一个项目克隆为 rig,最后与 Mayor 对话,开始协调工作。除了原生安装,还提供 Docker Compose 方案作为替代。
设置 Gas Town 之前,我需要安装哪些软件?Git 2.20+、Go 1.26.2+(Linux/Windows 安装以及 macOS 源码编译需要)、Beads(bd)0.57.0+、sqlite3、ICU4C 开发头文件、tmux 3.0+,以及作为默认代理运行时的 Claude Code 命令行工具(同时也支持 Codex、Copilot、Gemini 和 Cursor)。
Gas Town 在 Windows 上的使用方式和在 macOS、Linux 上一样吗?并非完全一样。在 Windows 上从源码原生编译需要 ICU 支持的查询层时,必须使用 MSYS2 终端,因为普通的 PowerShell/MSVC 无法编译它;而且原生 Windows 完全不支持基于 tmux 的多代理工作流。因此推荐改用 WSL。
Gas Town 最多能协调多少个代理,超过之后会变得混乱?它设计上可以从容地支持 20-30 个代理,依靠内置的邮箱、身份和交接机制;相比之下,大多数手动配置在只有 4-10 个代理时就已经一团糟了。
Mayor 是谁或者是什么?Mayor 是一个拥有你的工作区、项目和代理完整上下文的 Claude Code 实例,充当主要协调者。你开始时需要先告诉 Mayor 你想完成什么。
Polecats 是什么?Polecats 是具有持久身份、但会话是临时的工作代理:它们为某个任务而被启动,任务完成后会话结束,但它们的身份和工作历史会保留下来,供日后查阅。
Gas Town 如何跟踪工作事项?通过 Beads,这是一个基于 git 的问题跟踪系统,它把工作存储为结构化数据,称为“beads”(ID 形如 gt-abc12),再打包成“convoys”分配给代理。
Wasteland 功能是什么?Wasteland 是一个联邦网络,通过 DoltHub 把彼此独立的 Gas Town 连接起来,让各个 rig 可以在不同的城镇之间发布和认领工作,并通过多维度的“stamps”积累可移植的信誉。
Size
85.3 MB
Stars
18.4K
Age
10mo
Commits · 90 Days