Gas Town is a multi-agent orchestration system built on OpenClaw primitives. Inspired by industrial metaphors, Gas Town organizes AI agents into specialized worker roles that collaborate to execute complex workflows autonomously.
Gas Town leverages OpenClaw's session-based architecture to coordinate multiple agents, using persistent hooks and heartbeat-driven patrol loops to ensure work continues reliably across sessions, restarts, and interruptions.
- Quick Start
- Architecture Overview
- Worker Roles
- Key Concepts
- Commands
- Formulas and Workflows
- Configuration
- Documentation
- OpenClaw installed and configured
jqfor JSON processing- Bash shell
- An LLM API proxy (or direct API access)
Option 1: Automated Install (Recommended)
# Clone the repo
git clone https://github.com/codejeet/gastown.git
cd gastown
# Run the installer
./install.sh
# With custom LLM proxy settings
./install.sh \
--proxy-url "http://127.0.0.1:3456/v1" \
--model-id "claude-opus-4" \
--api-key-env "LOCAL_LLM_KEY"
# Dry run to see what would happen
./install.sh --dry-runThe installer will:
- Copy Gas Town scripts to
~/.openclaw/workspace/gastown/ - Register all agents (mayor, polecat-1, refinery, witness, deacon, dog-1, crew-1)
- Set up model configs pointing to your LLM proxy
- Display heartbeat cron schedules to configure
Option 2: Manual Install
-
Copy the
gastowndirectory to your OpenClaw workspace:cp -r gastown $HOME/.openclaw/workspace/ -
Copy agent configs to OpenClaw agents directory:
cp -r agents/* $HOME/.openclaw/agents/
-
Edit each agent's
models.jsonto point to your LLM:# Template is at agents/models.template.json # Replace {{PROXY_URL}}, {{MODEL_ID}}, etc.
-
Restart OpenClaw gateway:
openclaw gateway restart
-
Set up heartbeat crons (in OpenClaw):
deacon: */2 * * * * (every 2 min) witness: */5 * * * * (every 5 min) mayor: */5 * * * * (every 5 min) refinery: */10 * * * * (every 10 min) crew-1: */15 * * * * (every 15 min) -
Initialize Gas Town:
cd ~/.openclaw/workspace/gastown ./scripts/gt init
-
Start the town:
./scripts/gt-openclaw start
-
Sling your first task:
./scripts/gt sling "Fix the login bug" --to polecat -
Monitor progress:
./scripts/gt status ./scripts/gt-openclaw dashboard
┌─────────────────────────────────────────┐
│ OVERSEER (You) │
└─────────────────┬───────────────────────┘
│ requests
▼
┌─────────────────────────────────────────┐
│ MAYOR │
│ (Concierge & Coordinator) │
└───┬─────────────┬───────────────────┬───┘
│ │ │
┌───────────┘ │ └───────────┐
▼ ▼ ▼
┌───────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ POLECATS │ │ CREW │ │ REFINERY │
│ (Workers) │ │ (Persistent) │ │ (Merge Queue) │
└───────┬───────┘ └─────────────────┘ └────────┬────────┘
│ │
│ work │ merges
▼ ▼
┌───────────────┐ ┌─────────────────┐
│ WITNESS │◄────────── observes ─────────────────│ MAIN │
│ (Observer) │ │ BRANCH │
└───────────────┘ └─────────────────┘
│
│ reports to
▼
┌───────────────┐ ┌─────────────────┐
│ DEACON │──────►│ DOGS │
│ (Heartbeat) │ │ (Helpers) │
└───────────────┘ └─────────────────┘
- MEOW Stack: Molecular Expression of Work (Beads -> Molecules -> Formulas)
- GUPP: Gas Town Universal Propulsion Principle - "If there is work on your hook, YOU MUST RUN IT"
- Convoys: Work-order tracking and delivery units
- Hooks: Persistent work assignments that survive restarts
| Role | ID Pattern | Description |
|---|---|---|
| Mayor | mayor |
Concierge and chief-of-staff. Receives requests, delegates work, monitors progress. Primary interface for the human overseer. |
| Polecat | polecat-* |
Ephemeral swarm workers. Spawn, execute one task, submit work, terminate. Cattle, not pets. |
| Refinery | refinery |
Merge queue manager. Processes MRs one at a time, handles conflicts, enforces quality gates. |
| Witness | witness |
Observer role. Watches polecats and refinery, identifies stuck workers, triggers nudges or escalations. |
| Deacon | deacon |
Daemon beacon. Runs the heartbeat system, propagates wake signals, maintains town health. |
| Dog | dog-* |
Deacon helpers. Handle long-running maintenance tasks that would block the Deacon's patrol. |
| Crew | crew-* |
Persistent workers for design, research, and interactive work requiring continuity. |
Each worker operates in a dedicated OpenClaw session:
agent:mayor:mainagent:polecat-{n}:mainagent:refinery:mainagent:witness:mainagent:deacon:mainagent:dog-{n}:mainagent:crew-{name}:main
Every worker has a hook - a persistent work assignment stored in Git. The GUPP rule ensures reliability:
"If there is work on your hook, YOU MUST RUN IT."
Hooks survive session crashes, context compactions, and restarts. Workers check their hooks on every heartbeat and execute immediately without waiting for user input.
Beads - Atomic units of work (like issues):
{"id":"bd-a1b2c3","title":"Fix login","status":"ready","assignee":"polecat-1"}Molecules - Chained workflows with dependencies:
{"id":"mol-x1y2","steps":["bd-a1b2c3","bd-d4e5f6"],"current":0}Formulas - Reusable workflow templates in TOML:
[formula]
name = "feature"
steps = ["design", "implement", "test", "review"]Every work unit is wrapped in a Convoy for tracking:
- Start time and duration
- Workers involved
- Status progression
- Activity feed as work progresses
- Completion notification
# Initialize Gas Town
gt init
# Spawn a worker
gt spawn <role> [name]
# Sling work to a worker
gt sling "<task>" --to <worker>
# Nudge a worker (send heartbeat)
gt nudge <worker>
# Check a worker's hook
gt hook [worker]
# Get bead details
gt bead <id>
# Mark work complete
gt complete <bead-id> [worker]
# View town status
gt status
# View recent activity
gt activity [n]
# Manage rigs (projects)
gt rig add <path> [name]
gt rig list
# List convoys
gt convoy list# Start Gas Town (spawn all workers, set up heartbeats)
gto start
# Stop Gas Town (remove crons)
gto stop
# Spawn a specific worker
gto spawn <role> [name]
# Spawn ephemeral polecat for a task
gto polecat "<task>"
# Spawn multiple polecats
gto swarm <count> "<task1>" "<task2>" ...
# Cook a formula into a molecule
gto cook <formula> var1=value1 var2=value2
# List available formulas
gto formulas
# Show dashboard
gto dashboardGas Town includes pre-built formulas for common workflows:
Steps: design -> implement -> test -> review -> merge
Steps: investigate -> fix -> verify -> merge
Steps: prepare -> bump-version -> changelog -> build -> test-release -> tag -> gate-ci -> publish -> announce
Create a .toml file in formulas/:
[formula]
name = "my-workflow"
description = "Custom workflow"
version = "1.0"
[variables]
title = { required = true, description = "Task title" }
[[steps]]
id = "step1"
title = "First step: {{title}}"
role = "polecat"
instructions = "Do the first thing"
status = "ready"
[[steps]]
id = "step2"
title = "Second step: {{title}}"
role = "polecat"
depends_on = ["step1"]
status = "blocked"gastown/
├── install.sh # Automated installer
├── README.md # This file
├── agents/ # Agent templates
│ ├── models.template.json
│ ├── mayor/SOUL.md
│ ├── polecat/SOUL.md
│ ├── refinery/SOUL.md
│ ├── witness/SOUL.md
│ ├── deacon/SOUL.md
│ ├── dog/SOUL.md
│ └── crew/SOUL.md
├── config/
│ ├── town.json # Town configuration
│ └── roles.json # Role definitions and souls
├── beads/
│ ├── beads.jsonl # Bead database (Git-tracked)
│ └── hooks.jsonl # Worker hooks (GUPP)
├── molecules/
│ └── *.jsonl # Active workflow instances
├── formulas/
│ └── *.toml # Workflow templates
├── patrols/
│ └── *.md # Patrol definitions
└── scripts/
├── gt # Basic CLI
└── gt-openclaw # OpenClaw integration CLI
After installation, you'll have these agents in ~/.openclaw/agents/:
| Agent | Heartbeat | Purpose |
|---|---|---|
mayor |
*/5 * * * * | Coordinator, delegates work |
polecat-1 |
— | Ephemeral worker template |
refinery |
*/10 * * * * | Merge queue manager |
witness |
*/5 * * * * | Worker observer |
deacon |
*/2 * * * * | Heartbeat daemon |
dog-1 |
— | Deacon helper template |
crew-1 |
*/15 * * * * | Persistent worker |
Configure town-level settings:
workspace: Path to OpenClaw workspacebeadsPath,hooksPath,moleculesPath: Data storage pathssettings.polecatPoolSize: Maximum concurrent polecatssettings.mergeQueueBranch: Target branch for merges
Define worker roles including:
soul: System prompt for the agentheartbeat: Cron schedule for patrol loopstools: Available OpenClaw tools
- OpenClaw GitHub - Main repository
- OpenClaw Documentation - Official wiki
- OpenClaw Architecture Guide - Deep dive into architecture
- Sessions:
sessions_spawn,sessions_send,sessions_listfor multi-agent coordination - Cron: Heartbeat scheduling via
openclaw cron - Agents: Workspace-based agent isolation via
openclaw agents - Tools: Standard tool access (exec, read, write, edit, browser)
Gas Town brings industrial-scale orchestration to OpenClaw, enabling autonomous agent swarms that self-organize, self-heal, and deliver work reliably through the GUPP principle.