# Coming from Gas Town Source: https://docs.gascity.com/getting-started/coming-from-gastown Map Gas Town's roles, mechanisms, layout, commands, and workflows onto Gas City's primitives. If you have run Gas Town, you already know its roles, its `~/gt/...` layout, and its `gt` commands. This page carries that knowledge across to Gas City. Gas City is the platform that machinery was extracted into. Two things changed. First, the orchestrator hardcodes **zero roles** — every role you knew is now configuration, and you express Gas Town (or any orchestration) on top of a few primitives. Second, and bigger: the orchestrator can now run a formula as a **graph across many agents, out of your session** — decomposing a job into beads, fanning the ready ones out in parallel, gating each step on its dependencies, and retrying failures to completion. Your single-agent, in-session formulas still run (v1); this fleet orchestration (v2) is what's new. Because it is a platform, a feature added to Gas City lifts *every* orchestrator built on it — Gas Town included. For the system-level mental model first, read [How Gas City Works](/getting-started/how-gas-city-works). ## Mapping tables The five tables map Gas Town onto Gas City one domain at a time. Every entry on the right is **configuration** — a user-configured agent plus a prompt template — not a built-in platform type. ### Roles | Gas Town role | What it did | Gas City equivalent | | - | - | - | | **Mayor** | Planner/coordinator; the human's point of contact | Configured agent + coordinating prompt (e.g. the Gastown pack's `mayor`). Reach it with `gc session attach mayor`. | | **Deacon** | Watchdog: stall detection, restart, SLA enforcement | Orchestrator health patrol + config thresholds; optionally a configured agent. You tune thresholds, not run a role. | | **Witness** | Lifecycle observer; publishes health/transition events | Events + waits, formulas, session scale config. Modeling a "witness" on top is optional pack behavior. | | **Refinery** | Post-processor; reshapes raw agent output | Configured agent + a formula or order post-processing step. A workflow step, not a standing role. | | **Polecat** | Ephemeral on-demand worker, often in a worktree | Scalable/transient agent config (a pool — `min`/`max_active_sessions`). An operating *style*. | | **Crew** | Persistent worker pool claiming from a queue | Persistent named agent config. An operating *style*. | | **Dog** | Integration / external-messaging relay | Core-pack exec orders (most relay work needs no LLM); the Gastown pack's `dog` pool covers work that does need an agent. | ### Mechanisms and behaviors *What those roles and features actually **do**, and where that logic now lives.* | Gas Town behavior | Gas City equivalent | Notes | | - | - | - | | Deacon watchdog logic | Orchestrator health patrol + reconciliation | Stall detection, restart-with-backoff, reconcile-to-desired-state are orchestrator concerns, not a role agent. | | Witness lifecycle tracking | Waits, formulas, session scale config, orchestrator wake/sleep, events | Mechanisms are first-class; modeling a "witness" on them is optional. | | Plugin (scheduled/event/conditional automation) | Order — exec order or formula order | **Exec order** for shell or orchestrator-side logic; **formula order** to instantiate agent-driven work. | | Convoy as orchestration runtime | Convoy beads + `gc sling` + formulas | Convoys stay bead-backed grouping and lineage; no special convoy runtime to use. | | Formula runner inside Town workflows | In-process formula compiler + orchestrator execution | Gas City compiles and runs formulas over the convoy's beads itself. For v2 formulas (host-enabled by default), the orchestrator executes control beads; agents execute work beads. See [Choosing a Compiler Contract](/guides/understanding-formulas#choosing-a-compiler-contract). | | Path-derived identity | Explicit agent identity, rig scope, env, bead metadata | Do not port code or prompts that assume directory path implies who the agent is. | ### Filesystem and state *Gas Town encodes architecture into directories; Gas City treats directories as an implementation detail.* | Gas Town location | Gas City equivalent | Notes | | - | - | - | | `~/gt/...` directory tree | City directory + `.gc/` runtime state | A city is a directory holding `city.toml` and `.gc/`. Rigs are registered in `city.toml`; each `[[rigs]]` has a `path` defaulting under `rigs/` but allowed anywhere (absolute or city-relative). Live state is queried, not read from a fixed home tree. | | Town config | `pack.toml` (reusable behavior) + `city.toml` (this city's deployment) | One town config splits along a definition/deployment seam. | | Rig config | `city.toml` `[[rigs]]` entries + `.gc/` (machine-local path bindings) | *Which* rigs and their scale is deployment; *where* a rig lives on this machine is a local binding. | | Role homes | `agents//` (`agent.toml` + `prompt.template.md`) in the root city pack or an imported pack | Only the agent *definition* lives here. No on-disk role "home"; identity is not path-derived. | | Role home dirs (e.g. `~/gt/mayor/`) | `dir` (identity scope) + `work_dir` (session working dir, only when needed) | Set both in `agent.toml` (or patch per-rig in `city.toml`): `dir` carries scope/identity; `work_dir` only when a role truly needs filesystem isolation. | | Role-specific startup files | Prompt templates, overlays, provider hooks, `pre_start`, `session_setup`, `gc prime` | Startup shaping is explicit and provider-aware, not inferred from disk location. | ### Workflows *The operator verbs — the things you actually type. (Formulas are a mechanism, above; these are day-to-day moves.)* The transcripts below show them end to end. | Gas Town workflow | Gas City command | Deeper | | - | - | - | | Spin up a worker | `gc start` + a persistent agent config (`agents//`) | [Tutorial 02 — Agents](/tutorials/02-agents), [Shareable Packs](/guides/shareable-packs) | | Send a task to the mayor | `gc sling mayor ""` (or `bd create` + a bead hook) | [`gc sling`](/reference/cli#gc-sling), [Tutorial 06 — Beads](/tutorials/06-beads) | | Inspect what's stuck | `gc session list`, then `gc session peek ` | [`gc session list`](/reference/cli#gc-session-list) | | Restart a stalled agent | `gc session reset ` (or let health patrol auto-restart) | [`gc session reset`](/reference/cli#gc-session-reset) | | Share config across teams | A shareable pack (`pack.toml` + `agents//`), imported by each city | [Shareable Packs](/guides/shareable-packs) | | Run a one-shot job | A formula or exec order, dispatched on demand | [Tutorial 07 — Orders](/tutorials/07-orders), [Tutorial 05 — Formulas](/tutorials/05-formulas) | | Watch live agent output | `gc session attach ` (interactive) or `gc session peek ` (snapshot) | [`gc session attach`](/reference/cli#gc-session-attach) | A first work cycle — create the city, hand the mayor a task, watch it land: ```bash theme={"dark"} gc init ~/my-city --template gascity --default-provider claude # creates and starts the city cd ~/my-city gc sling mayor "add a /health endpoint" # creates a task bead from text, routes it to mayor gc session list # see what's running (mayor, pools, …) gc session attach mayor # interactive live view of the mayor working ``` Triage a stuck agent without attaching: ```bash theme={"dark"} gc session list # find the suspect by name/state gc session peek mayor --lines 80 # snapshot of recent output (default 50 lines) gc session reset mayor # fresh restart; bead, alias, mail, and queued work survive gc events --follow # system-wide live feed (or let health patrol act on its own) ``` > [!NOTE] > > `gc session peek` takes `--lines` for a point-in-time snapshot — there is no `--follow`. For a continuously updating view, `gc session attach`. For the system-wide live feed, `gc events --follow`. ### Commands The full `gt` → `gc`/`bd` mapping lives in the **[Gas Town → Gas City Command Map](/reference/gastown-command-map)**. ## What usually maps cleanly **Roles become pack agents.** Adding a role follows an escalation ladder — stop at the first rung that solves your problem: ```text theme={"dark"} edit local city.toml → include a pack that already solves most of it → override the stamped agent (local-only change) → edit the pack (change the shared default for everyone) → add formulas/orders for workflow automation ``` **Start with the root city pack plus `city.toml`, not an imported pack.** Edit a pack only when the change should become the reusable default for every consumer. ```toml theme={"dark"} # pack.toml — imports reusable packs, defines city-specific behavior # agents// — city-owned named agents # city.toml — deployment: rigs, substrates, scale # .gc/ — site bindings such as local rig paths ``` **Plugins become orders** — the most important practical translation. "Run something automatically on a schedule, on an event, or when a condition holds" is an order: **exec order** for shell/orchestrator-side logic, **formula order** for agent-driven work. Exec orders matter most — they run non-agent commands with no prompt, no session, no extra role agent. **Convoys stay bead-shaped.** Keep the convoy mental model for tracking work; the implementation boundary moved. Convoys are bead-backed grouping and lineage, `gc sling` creates convoy structure while routing, and formulas/orders/waits compose around that bead graph. The orchestration that runs over it is the orchestrator's control dispatcher — it executes the control beads (check, retry, fan-out, tally, drain) that drive a convoy's work to completion across many agents. **Crew and polecats are operating modes, not types.** *Crew* = persistent named agents; *polecats* = scalable or transient agents, often with worktrees. The platform does not force the distinction — a pack can adopt, relax, or replace it. ## Where Gas City deliberately differs **The orchestrator owns infrastructure behavior.** It is the canonical owner of reconciling desired→running sessions, session scaling, order evaluation, health patrol, and garbage-collecting ephemeral run beads (the v1 *wisp* container). If something is fundamentally platform infrastructure, put it on the orchestrator path rather than inventing another deacon-like role. **Filesystem layout is not the architecture.** Use `dir` (in `agent.toml`, or patched per-rig in `city.toml`) for scope and identity; `work_dir` only when the session must run elsewhere; bead metadata for durable handoff state. | Use a separate `work_dir` when… | Not when… | | - | - | | the role mutates a repo and needs an isolated worktree | "Gas Town has a separate folder for this role" | | provider scratch files would collide with another role | | | the role needs a durable sandbox independent from the rig root | | **Roles are examples, not platform law.** The Gastown pack ships familiar roles as an example operating model, not a type system. Adding a behavior means editing a pack, formula, order, or prompt — not adding a hardcoded role. A **local city change** edits `city.toml` (rig overrides, patches, a city-specific agent); a **shared product change** edits the pack for a better default everywhere. Most onboarding work is local. ## Common translation patterns | Old Town instinct | Ask first | Default answer | | - | - | - | | "I need a new dog" | Can this be an exec order? | Prefer the order — trigger logic, history, orchestrator ownership, no agent slot. Reach for a scalable agent only if it needs a long-lived session, rich interactive context, or repeated agent judgment. | | "I need a witness-like lifecycle manager" | Which parts are orchestrator infra vs. bead transitions vs. formula logic vs. prompt guidance? | Only orchestrator infrastructure belongs in platform code; the rest lives in the pack. | | "I need another special directory tree" | Do I really? | Canonical repo root from the rig; isolated `work_dir` only for roles that mutate repos or need provider-file isolation; explicit env and metadata, never path inference. | | "I need to run something without an agent" | Could an exec order do it? | Use an exec order before inventing a plugin, helper role, or hidden session. | ### "How do I get to my mayor?" ```bash theme={"dark"} gc session attach mayor ``` The Mayor session is the familiar Gas Town entry point — an interactive session with full city context that you coordinate from. It is one window onto the city; the orchestrator is still running the fleet and driving formula graphs to completion behind it. The CLI is plumbing for reaching that session. City-scoped Gastown agents (`mayor`, `deacon`, `boot`) attach the same way; `gc session list` shows what is running. This replaces `gt session at mayor/` or `tmux attach -t gt-mayor`. ## What not to port literally These Town habits create unnecessary complexity in Gas City: * exact `~/gt/...` directory trees * path-derived identity * new hardcoded role names in platform code * plugin systems when an order is enough * special helper agents for work that is really a shell command * duplicating durable state outside beads when labels or metadata suffice The most common mistake is importing Town's surface area instead of re-expressing the intent in Gas City's primitives. ## Editing Gastown config The common edits — registering rigs, scaling pools, swapping providers, patching agents, tweaking prompts — live in [Gastown on Gas City: Config Recipes](/guides/gastown-config-recipes). ## Fast ramp checklist The shortest path to effective: 1. Read [How Gas City Works](/getting-started/how-gas-city-works) for the six primitives in user terms. 2. Skim the [CLI reference](/reference/cli) alongside the [Command Map](/reference/gastown-command-map) so `gt` → `gc` muscle memory transfers. 3. Read [Tutorial 07 — Orders](/tutorials/07-orders) and remap "plugins" → "orders". 4. Read [Tutorial 05 — Formulas](/tutorials/05-formulas): Gas City compiles and instantiates formulas itself; for v2 formulas the orchestrator drives control beads while agents execute work beads. 5. Work through [Tutorial 02 — Agents](/tutorials/02-agents) and [Shareable Packs](/guides/shareable-packs) for the `agents//` layout end to end. 6. Read [A Complete Gastown Example](/guides/gastown-config-recipes#a-complete-gastown-example) — city, root pack, and nested pack assembled into one runnable topology. # Web dashboard Source: https://docs.gascity.com/getting-started/dashboard The supervisor hosts a built-in web dashboard for all your cities. The Gas City supervisor hosts a built-in web dashboard. It is a single-page app compiled into the `gc` binary and served by the supervisor on its own listener, so there is nothing extra to install or run. ## Open it The dashboard is live as soon as `gc init` (or `gc start`) has started a city. `gc dashboard` opens it in your browser and prints the URL: ```bash theme={"dark"} gc dashboard # Opened the dashboard in your browser: http://127.0.0.1:8372 ``` Pass `--no-open` to print the URL without launching a browser (useful over SSH or in scripts): ```bash theme={"dark"} gc dashboard --no-open # The dashboard is served by the gc supervisor at http://127.0.0.1:8372 ``` `gc dashboard` does not start a server — it points your browser at the running supervisor. The supervisor is the host, and one supervisor serves every registered city. Pick the city you want from the switcher in the dashboard header. If the supervisor is not running, `gc dashboard` prints how to start it instead of opening a (dead) URL. ## What it shows The dashboard reads the supervisor's typed API directly (same origin), so it reflects live state: agents and their sessions, beads, mail, formula runs, and a health view (system, local tools, per-rig store health, and the dolt store trend). ## Security posture The dashboard is served on the supervisor's bind address, which defaults to loopback (`127.0.0.1`). It is intended for local, single-operator use: * It is same-origin with the API; browser mutations carry the supervisor's `X-GC-Request` CSRF header. * When the supervisor binds a non-localhost address without `allow_mutations`, it runs read-only and the dashboard disables its mutating controls. ## Turn it off Set `GC_SUPERVISOR_DASHBOARD=0` before starting the supervisor to run a typed-API-only supervisor with no embedded dashboard. # FAQ Source: https://docs.gascity.com/getting-started/faq Quick answers to the questions newcomers ask most — what Gas City adds over a single coding agent, what it runs on, and where to start. ## Why do I need Gas City when I already have a coding agent? A coding agent gives you one session: a faster pair of hands, steered live, and gone when it crashes. Gas City turns a fleet of them into a **software factory**. You write down how a job gets done once — a [formula](/guides/understanding-formulas) — and an orchestrator runs it across many agents *outside your session*: it decomposes the job, runs the independent pieces in parallel, reviews and gap-checks the result, and retries what fails until the work is done. You describe a feature once and come back to a finished branch. [How Gas City Works](/getting-started/how-gas-city-works) is the full mental model. ## Couldn't I get the same thing from a bash loop or CI? A loop can respawn an agent, but it has no model of the work: every iteration starts blind, and a crash loses whatever the last iteration knew. The orchestrator runs a formula as a *graph* — it holds each step until its dependencies close, fans the ready steps out to many agents at once, retries failures, and keeps every unit of work in a durable store, so progress survives any crash on either side. CI is complementary rather than competitive: CI verifies a change after you make it; a formula is what produces the change. See [Understanding Formulas](/guides/understanding-formulas) for what the orchestrator does that a script cannot. ## How does Gas City relate to Gas Town? Gas City is the platform Gas Town's machinery was extracted into. The platform hardcodes zero roles — every role Gas Town wired into code (mayor, crew, and the rest) is now configuration expressed as a [pack](/guides/understanding-packs), so the same engine runs Gas Town, Ralph, or whatever you configure. If you know Gas Town, [Coming from Gas Town](/getting-started/coming-from-gastown) maps its roles, commands, and layout onto Gas City one table at a time. ## Which coding agents does it work with? Sixteen built-in harnesses, including Claude Code, Codex CLI, Gemini CLI, Cursor Agent, GitHub Copilot, Sourcegraph AMP, OpenCode, Grok, Kimi Code, and Pi — [Harness Recipes](/guides/harness-recipes) has the copy-paste setup for each. Agents run under the logins or API keys you already have, and each agent picks its own harness, so a mixed fleet is just configuration. ## Do I have to write Go, or any code at all? No. Everything user-facing is configuration: TOML files (`city.toml`, `pack.toml`) declare your agents, formulas, and orders, and markdown prompt templates define what each role does. A "reviewer" or "planner" is a prompt you wrote, not a plugin you compiled. Start with [Configuring an Agent](/guides/configuring-an-agent). ## Do I need tmux? What else does it depend on? Yes — agent sessions run in tmux. The full runtime set is tmux, jq, git, dolt, bd (the beads CLI), and flock; `brew install gascity` installs all of them for you. For the lightest possible start, `GC_BEADS=file` skips the dolt + bd pair. [Installation](/getting-started/installation) has the exact versions and the non-Homebrew paths. ## What happens when an agent crashes mid-job? Nothing is lost. Every unit of work is a **bead** in a durable store that outlives any session: if an agent dies, its beads stay open and a fresh agent picks up the same work; if the orchestrator restarts, it adopts the live sessions it finds and resumes from the store. Sessions are disposable — the work they did is not. The [Bead section of How Gas City Works](/getting-started/how-gas-city-works#bead) explains why the system converges. ## Can I use it with my existing repos? Yes. Register any project as a **rig** with `gc rig add ` — its directory can live anywhere on disk, and each rig gets its own bead namespace and agent scope, so work in one project stays isolated from the others. [Tutorial 01](/tutorials/01-cities-and-rigs) walks through it. ## Is it open source? What does it cost? Gas City is MIT-licensed and free — [github.com/gastownhall/gascity](https://github.com/gastownhall/gascity). The only spend is the model usage of the agents you run, billed through the harness credentials you already use. ## Where do I start? [Installation](/getting-started/installation), then the [Quickstart](/getting-started/quickstart) — it boots your first city in a few minutes. When you want the guided path, the [Tutorials](/tutorials/index) build a complete city up, command by command. # How Gas City Works Source: https://docs.gascity.com/getting-started/how-gas-city-works The orientation for Gas City — how it orchestrates fleets of agents, and the six primitives that compose into that orchestration. Gas City **orchestrates fleets of coding agents** through real engineering work. You write a **formula** — a method for how a job gets done — and the **orchestrator** runs it as a graph: it decomposes the job into beads, fans the ready ones out to as many agents as the work allows, holds each step back until its dependencies close, retries what fails, drains convoys in parallel, and drives the whole graph to completion *outside your session*. [Orders](/tutorials/07-orders) trigger formulas on a schedule or an event; health patrol keeps the fleet alive. **This orchestration is the point.** What makes it a *platform* and not one fixed orchestrator: the orchestrator hardcodes **zero roles** — no built-in "manager" or "reviewer." Every role is configuration supplied through a **Pack**, and the whole orchestration is composed from six primitives, so the same engine becomes Gas Town, Ralph, or whatever you configure. ## The machinery underneath Three pieces of role-agnostic plumbing run the primitives, and you configure no role around any of them. | Machinery | What it does | | - | - | | **Orchestrator** | runs formulas, drives each bead graph forward, and reconciles live agents against what your config declares | | **Bead store** | durable work — every unit of work is a bead that survives an agent crash, so the orchestrator always has ground truth to resume from | | **Event bus** | fires activity outward so humans and agents can watch what's happening | None of this machinery knows what your agents do. It's the substrate the six primitives sit on. Notice the shape of the loop: the orchestrator acts on sessions — spawning, stopping, restarting them — but reads their progress from the bead store and event bus rather than being called back directly. The loop closes through shared state, which is why work survives a crash on either side. ## The six primitives | Primitive | Role | Is | Key idea | | - | - | - | - | | **Agent** | WHO | a configured worker — name, provider, prompt template, scope | pure configuration, so define as many as you like; the platform assumes none exists | | **Bead** | WHAT | one unit of work — ID, title, status, type | the universal substrate: tasks, mail, sessions, convoys are all beads differing only by `type` | | **Formula** | HOW | a reusable, written-down method applied over work | applying it *produces* work: a formula materializes as beads that outlive the file and any session | | **Rig** | WHERE | an external project (usually a git repo) registered with the city | each rig gets its own bead namespace and agent scope | | **Pack** | CONFIGURES | the unit of configuration — declares agents, formulas, orders | the City *is* a pack: the one rooted at this deployment | | **Event** | OBSERVE | an outbound notification fired by activity | *fired, not polled*; humans and agents both watch the stream | ![The six primitives and how they relate: Packs declare agents, formulas, and orders; a Formula operates over a convoy of Beads, fanning work out to Agents that execute in a Rig; Events are fired so humans and agents can observe.](https://mintcdn.com/gascityinc-5c0069dd/-7xr7u3wfBmX5XrM/diagrams/excalidraw-rendered/primitives.svg?fit=max\&auto=format\&n=-7xr7u3wfBmX5XrM\&q=85\&s=a3dc96e436ae14b00c05aa9fa1d897e2) **Packs** declare the agents, formulas, and orders; the local pack is your **City**, which can pull in shared packs through imports. A **Formula** operates over a convoy of **Beads**, fanning work out to **Agents** that execute in a **Rig**; an **Order** automates *when* a formula runs; and **Events** fire so humans and agents can observe the whole thing. ### Agent An **agent** is *who* does the work — a worker a pack defines as a prompt plus a scope and a provider. The prompt template is its entire behavioral spec; because the platform has no hardcoded roles, a "reviewer" or a "planner" is nothing more than the prompt you wrote for it. When an agent is *running* it is a **session** — a live process the platform can start, stop, prompt, and observe. The engine backing that session is its **provider**; when the orchestrator restarts, it *adopts* the live sessions it finds — creating a session bead for each — rather than respawning them. A single agent can be scaled into a **pool** of identical workers sharing one queue: each tick the orchestrator runs the agent's `scale_check` query to measure demand and sizes the pool to it — up to `max_active_sessions`, never below a `min_active_sessions` floor — retiring sessions that fall idle. Sessions are disposable; the work they did survives them, because work lives in beads. ### Bead A **bead** is *what* the work is — one unit with an ID, title, status, and type, moving `open` → `in_progress` → `closed`. Beads are also the universal store: tasks, inter-agent mail, running sessions, and convoys are all beads that differ only by `type`. A new city keeps them in two stores: the **work ledger** holds the work people and agents reason about (tasks, bugs, convoys), and a local infrastructure store under `.gc/store` holds what the city runs on (sessions, mail, workflow steps, order runs, queued nudges). `gc` commands read both; raw `bd` reads the work ledger. A city created before this split, or kept single-store, holds everything in its work ledger; `gc storage status` shows which kind a city is. A **convoy** is a container bead that groups related work so you track a batch as a unit. **Dependencies** are blocking `needs` edges: a bead with an open blocker is invisible to agents until that blocker closes — which is how ordering happens with no central scheduler. Because work persists in beads, the system converges: if an agent dies, its beads stay open and a fresh agent picks up the same work. ### Formula A **formula** is *how* a job gets done — a reusable, written-down method, a TOML file of steps and their dependencies. Applying it compiles the steps into a graph and materializes them as beads; from that moment a **run** is independent of the file and of any session. The orchestrator drives the run outside your session, fanning ready steps out to many agents at once and gating each on its dependencies. **Sling** (`gc sling`) is the dispatch op that creates *and* routes in one motion. An **Order** automates *when* a formula runs, pairing a trigger (cooldown, cron, condition, event, or manual) with the formula to fire — no human runs a verb. **Health patrol** is one kind of order: each tick the orchestrator evaluates due triggers and fires them. ### Rig A **rig** is *where* the work happens — an external project, usually a git repo, registered with the city with `gc rig add `. A rig carries a repo, its own **bead namespace**, and an **agent scope**. Its directory can live anywhere on disk, inside or outside the city. Isolation is by bead-ID prefix, not a separate database: the city and all its rigs share one underlying store, and reads and writes are filtered to the current scope's prefix. Work slung in one rig stays logically isolated from the others, and rig-scoped agents are instantiated once per rig. ### Pack A **pack** is what *configures* the system — a directory with a `pack.toml` that declares agents, formulas, and orders, plus the support files they need. The local (root) pack is your **City**: the pack rooted at the city directory, where the city keeps its own definitions alongside its deployment settings. **Imports** are named dependencies on shared packs; an imported pack's agents, formulas, and orders read exactly like locally declared ones, so a city reuses behavior defined elsewhere without copying files. The same engine becomes a different orchestrator purely by swapping which packs it loads. ### Event An **event** is how you *observe* what's happening — an immutable, append-only record fired by city activity, not something the other primitives consume. Every event carries a monotonically increasing sequence number, so a watcher can replay the stream from any point. Beads fire `bead.created` / `bead.closed`, sessions fire `session.woke` / `session.crashed`, convoys fire `convoy.created` / `convoy.closed`, and orders fire `order.fired` / `order.completed`. Humans watch the stream with `bd show --watch`, the `gc events --follow` CLI, or the dashboard; agents and bd hooks observe and emit too. Events also close the automation loop: an event-triggered order *reads* the stream to decide when its formula runs — so the same notifications humans watch can drive the fleet, with no specific agent role required. ## Where to go next * [Tutorials](/tutorials/index) — the guided, end-to-end path through every primitive above. * [Understanding Formulas](/guides/understanding-formulas) — the full guide to formulas, runs, sling, and orders. * [Understanding Packs](/guides/understanding-packs) — how packs, cities, and imports compose. * [Reference](/reference/index) — command, config, formula, and provider lookup. # Installation Source: https://docs.gascity.com/getting-started/installation Install Gas City from Homebrew, a release tarball, or source. ## Which method should I use? | Method | Best for | Installs deps? | Auto-upgrades? | | - | - | - | - | | [Homebrew](#homebrew-recommended) | macOS / Linux daily use | Yes (runtime deps) | `brew upgrade` | | [Direct download](#direct-download) | CI, containers, air-gapped hosts | No | Manual | | [Source build](#build-from-source) | Contributors, bleeding-edge | No | Manual | **Most users should use Homebrew.** It installs all runtime dependencies automatically and keeps `gc` on your PATH. Choose direct download when you cannot use Homebrew (CI images, Docker layers, machines without package managers). Choose source when you need unreleased changes or plan to contribute. ## Prerequisites Gas City requires a small set of runtime tools. Homebrew installs all of them for you; the other methods require manual installation. | Tool | Required | Min version | macOS | Linux | Notes | | - | - | - | - | - | - | | tmux | Yes | — | `brew install tmux` | `apt install tmux` | Session management | | jq | Yes | — | `brew install jq` | `apt install jq` | JSON processing | | git | Yes | — | (built-in) | (built-in) | Version control | | dolt | Yes | 2.6.0 or newer | `brew install dolt` | [releases](https://github.com/dolthub/dolt/releases) | Beads data plane | | bd (Beads CLI) | Yes | 1.3.0 or newer | `brew install beads` | [releases](https://github.com/gastownhall/beads/releases) | Issue tracking | | flock | Yes | — | `brew install flock` | (built-in via util-linux) | File locking | | gh | Optional | — | `brew install gh` | [cli.github.com](https://cli.github.com/) | GitHub gate checks | | Go 1.27.4+ | Source only | 1.27.4 | `brew install go` | [golang.org](https://go.dev/dl/) | Compiler | | make | Source only | — | (built-in) | `apt install make` (or `build-essential`) | Drives `make install` | Use a final Dolt 2.6.0 or newer. Gas City's managed Dolt checks reject older and pre-release builds because they are below the managed bd/Dolt compatibility floor: 2.6.0 is the first Dolt built with a Go toolchain that distrusts the compromised eMudhra CA intermediates. `brew install gascity` installs a current `bd` along with `gc`. With another install method, install the latest [Beads release](https://github.com/gastownhall/beads/releases). A new city's `gc bd` runs only a bd whose command tree gc pins: bd 1.3.2, 1.3.3 or 1.3.4, or the pinned Enterprise 1.3.0 build. Put the real `bd` binary on `PATH`, not a mise or asdf shim or a wrapper script. With bd 1.3.0 or 1.3.1, or a bd gc cannot check, `gc init` creates the city single-store and prints how to split it after you upgrade bd. `gc init --from` does the same with an example that carries the split in its `city.toml`, and refuses one that declares part of it in an include fragment, as `examples/storage` does; see [`gc init` Created a Single-Store City](/getting-started/troubleshooting#gc-init-created-a-single-store-city). An upgrade that moves an existing shared database to a newer Beads schema needs every client of that database upgraded together and a one-time `bd migrate schema`; see [Upgrading an existing city](/getting-started/upgrading). Fresh workspaces start at the current schema. ## Homebrew (recommended) ```bash theme={"dark"} brew install gascity ``` This installs the latest `gc` release and its runtime dependencies (beads, dolt, tmux, jq, and flock). Gas City is in homebrew-core, so no tap is needed. Verify the installation: ```bash theme={"dark"} gc version ``` > [!WARNING] > > If you use Oh My Zsh with the `git` plugin, `gc` may already be an alias for > `git commit --verbose`. Run `command gc version` once to bypass the alias. For > a persistent fix, add `unalias gc 2>/dev/null` or > `zstyle ':omz:plugins:git' aliases no 'gc'` after Oh My Zsh loads in > `~/.zshrc`, or put that line in a file such as > `~/.oh-my-zsh/custom/gascity.zsh`. ### Upgrading via Homebrew ```bash theme={"dark"} brew update brew upgrade gascity ``` The `gascity` formula depends on `beads`, so this upgrades `bd` too. After upgrading, run `gc start` for each city. When the supervisor is still running the old binary, `gc start` restarts it on the new one, and it regenerates the supervisor's service file on each invocation, so a `brew upgrade` followed by `gc start` always picks up template changes. An upgrade that changes the Beads version can also need a backup and a one-time database migration. Before upgrading a city you rely on, follow [Upgrading an existing city](/getting-started/upgrading). ### Uninstalling via Homebrew ```bash theme={"dark"} gc stop # stop running city first gc supervisor uninstall # remove the background supervisor service brew uninstall gascity ``` ## Direct download Release tarballs are published for every tagged version. Supported platforms: | OS | Architecture | Archive name | | - | - | - | | macOS (darwin) | Apple Silicon (arm64) | `gascity_VERSION_darwin_arm64.tar.gz` | | macOS (darwin) | Intel (amd64) | `gascity_VERSION_darwin_amd64.tar.gz` | | Linux | x86\_64 (amd64) | `gascity_VERSION_linux_amd64.tar.gz` | | Linux | ARM (arm64) | `gascity_VERSION_linux_arm64.tar.gz` | ### Download and install ```bash theme={"dark"} # The latest release (or set a version from https://github.com/gastownhall/gascity/releases) VERSION=$(curl -fsSL https://api.github.com/repos/gastownhall/gascity/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') # Detect platform OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case "$ARCH" in x86_64) ARCH=amd64 ;; aarch64|arm64) ARCH=arm64 ;; esac # Download and extract curl -fsSLO "https://github.com/gastownhall/gascity/releases/download/v${VERSION}/gascity_${VERSION}_${OS}_${ARCH}.tar.gz" tar -xzf "gascity_${VERSION}_${OS}_${ARCH}.tar.gz" # Move to a directory on your PATH sudo install -m 755 gc /usr/local/bin/gc # Verify gc version ``` ### Verify release artifacts Homebrew verifies release checksums from the formula automatically. For direct downloads, verify the archive before installing it: ```bash theme={"dark"} ARCHIVE="gascity_${VERSION}_${OS}_${ARCH}.tar.gz" CHECKSUMS="gascity_${VERSION}_checksums.txt" curl -fsSLO "https://github.com/gastownhall/gascity/releases/download/v${VERSION}/${CHECKSUMS}" grep " ${ARCHIVE}$" "${CHECKSUMS}" > "${ARCHIVE}.sha256" if command -v sha256sum >/dev/null 2>&1; then sha256sum -c "${ARCHIVE}.sha256" else shasum -a 256 -c "${ARCHIVE}.sha256" fi ``` Release archives are also published with GitHub artifact attestations. If you have the GitHub CLI installed, verify the downloaded archive against the `gastownhall/gascity` repository: ```bash theme={"dark"} gh attestation verify "${ARCHIVE}" --repo gastownhall/gascity ``` Each release also includes an SPDX SBOM asset: ```bash theme={"dark"} curl -fsSLO "https://github.com/gastownhall/gascity/releases/download/v${VERSION}/gascity-v${VERSION}.spdx.json" ``` ### Upgrading a direct-download install Repeat the download steps above with the new version number. The `gc` binary is a single static file — overwriting it is safe. Install the matching `bd` as well, and see [Upgrading an existing city](/getting-started/upgrading) for the backup and Beads migration steps. > [!TIP] > > You still need to install the [prerequisites](#prerequisites) separately when > using direct download. Homebrew handles this automatically. ## Build from source Requires `make` and Go 1.27.4+ (pinned in `go.mod` as 1.27.4). ```bash theme={"dark"} git clone https://github.com/gastownhall/gascity.git cd gascity make install # builds and installs to $(GOPATH)/bin/gc gc version ``` To build without installing globally: ```bash theme={"dark"} make build # outputs bin/gc in the repo root ./bin/gc version ``` On macOS, `make build` signs the binary with a stable local codesigning identity when one is available, which helps macOS remember local permission grants across rebuilds. Without a stable identity, the build leaves Go's linker-produced signature unchanged. Set `GC_SIGN_IDENTITY=` to choose a specific certificate, `GC_SIGN_IDENTIFIER=` to use a separate local TCC identity, or `GC_ADHOC_SIGN=1` to opt into ad-hoc signing for a local experiment. Successful local signing also removes stale `com.apple.provenance` metadata when present. ### Contributor setup To change Gas City itself (tests, lint, docs preview), follow [CONTRIBUTING.md](https://github.com/gastownhall/gascity/blob/main/CONTRIBUTING.md). ## Verify your installation Regardless of install method, confirm everything is working: ```bash theme={"dark"} gc version # prints the installed version ``` If that runs `git commit` instead of Gas City, your shell has a `gc` alias. Use `command gc version` for this check and see [Troubleshooting](/getting-started/troubleshooting#oh-my-zsh-git-plugin-hides-gc) for the permanent fix. Next, follow the [Quickstart](/getting-started/quickstart) to create your first city and send work through a formula. Gas City ships a JSONL archive that snapshots every bead database for disaster recovery. By default it runs in local-only mode and keeps commits on this host. To enable off-box backup, see [JSONL archive push failures](/getting-started/troubleshooting#jsonl-archive-push-failures). # Quickstart Source: https://docs.gascity.com/getting-started/quickstart Create a city, add a rig, and send work through a formula in a few minutes. > [!NOTE] > > This guide assumes you have already installed Gas City and its > prerequisites. If you haven't, start with the > [Installation](/getting-started/installation) page. You need `gc` (`brew install gascity` brings `bd`, `dolt`, `tmux`, `jq`, and `flock` with it) and a coding agent CLI that is already logged in. The examples use Claude Code. > [!TIP] > > Oh My Zsh's `git` plugin defines a `gc` alias for `git commit --verbose`. If > `gc version` or `gc init` opens git commit instead of Gas City, use > `command gc ...` temporarily and remove the alias after Oh My Zsh loads. > See [Troubleshooting](/getting-started/troubleshooting#oh-my-zsh-git-plugin-hides-gc). ## 1. Give Dolt your identity Gas City stores work as beads in Dolt, and Dolt needs an author. `gc init` stops with "startup is blocked by Dolt author identity" without one. Git needs an identity first: the commands below copy it, and step 3 commits with it. If `git config --global user.name` or `git config --global user.email` prints nothing, set it with `git config --global user.name "Your Name"` or `git config --global user.email "you@example.com"`, using your own name and email. Then copy your git identity into Dolt wherever Dolt's name or email is missing or empty: ```bash theme={"dark"} [ -n "$(dolt config --global --get user.name)" ] || dolt config --global --add user.name "$(git config --global user.name)" [ -n "$(dolt config --global --get user.email)" ] || dolt config --global --add user.email "$(git config --global user.email)" ``` ## 2. Create a City ```bash theme={"dark"} gc init ~/my-city --template gascity --default-provider claude ``` `gc init` bootstraps the city directory, registers it with the supervisor, and starts the orchestrator in the background. The defaults are the recommended setup; use `--default-provider codex` (or `gemini`) for a different agent CLI. The dashboard is at `http://127.0.0.1:8372/`. A new city takes a few minutes to finish setting up. Until it does, these signals are normal and need no action: * `gc init`'s output can end at `Adopting sessions...`. * `gc status` can list agents as `unknown (partial status)` and print `bead cache unavailable` or `session snapshot timed out`. * `gc doctor` can report the store as not running. * A dashboard run page can say "run projection is warming"; refresh it after a minute. ## 3. Add a Rig ```bash theme={"dark"} mkdir -p ~/hello-world && cd ~/hello-world git init && git commit --allow-empty -m "initial commit" cd ~/my-city gc rig add ~/hello-world ``` A rig is a project directory registered with the city. It gets its own beads database, hook installation, and routing context. ## 4. Send Work Through a Formula ```bash theme={"dark"} gc sling hello-world/claude "Create hello.sh that prints hello world and commit it" --on mol-do-work ``` The target is the rig, then the provider: if you chose `codex` or `gemini` in step 2, sling to `hello-world/codex` or `hello-world/gemini`. `gc sling` creates a bead for the task and runs the `mol-do-work` formula on it: one agent reads the task, does it, and closes it. It prints a `Dashboard:` link to the run: ```text theme={"dark"} Dashboard: http://127.0.0.1:8372/city/my-city/runs/gcg-1025 ``` That line is the result of getting Gas City running. An agent doing this setup for you should end its final message with it exactly as printed. `gc sling` leaves the line out when it cannot reach the dashboard, but the run still started: its `Attached workflow ` line names the run, and the link is `http://127.0.0.1:8372/city/my-city/runs/`. ## 5. Watch It Finish Open the link, or pass the run ID (the last part of the link) to `gc bd show`. Its `status:` line reads `closed` when the run is done, usually within a minute or two, and `hello.sh` is committed in `~/hello-world`: ```bash theme={"dark"} gc bd show gcg-1025 ``` This is the smallest formula: one bead, one agent. Gas City's real power is orchestration -- a **formula** (the method for getting a job done) that the **orchestrator** runs as a graph: decomposing the work into beads, fanning the ready ones out to many agents at once, gating each step on its dependencies, retrying failures, and driving the whole thing to completion outside your session. See [Formulas](/tutorials/05-formulas) and [Orders](/tutorials/07-orders), which trigger formulas on a schedule or event. For a fuller walkthrough of cities and rigs, continue to [Tutorial 01](/tutorials/01-cities-and-rigs). # Troubleshooting Source: https://docs.gascity.com/getting-started/troubleshooting Common installation and setup issues and how to fix them. > [!NOTE] > > If `gc init` or `gc start` fails after install, use the > [`gc start` failure walkthrough](/troubleshooting/gc-start-walkthrough) to > match the final `FATAL:` line to the likely cause and resolution. ## Startup is blocked by Dolt author identity `gc init` and `gc start` stop with "startup is blocked by Dolt author identity" when Dolt's author name or email is missing or empty. The fix copies your git identity, so git needs one first: if `git config --global user.name` or `git config --global user.email` prints nothing, set it with `git config --global user.name "Your Name"` or `git config --global user.email "you@example.com"`, using your own name and email. Then copy your git identity into Dolt wherever Dolt's name or email is missing or empty, and run `gc start` in the city: ```bash theme={"dark"} [ -n "$(dolt config --global --get user.name)" ] || dolt config --global --add user.name "$(git config --global user.name)" [ -n "$(dolt config --global --get user.email)" ] || dolt config --global --add user.email "$(git config --global user.email)" gc start ``` ## A new city is still setting up A new city takes a few minutes to finish setting up after `gc init`. Until it does, these signals are normal and need no action: * `gc init`'s output can end at `Adopting sessions...`. * `gc status` can list agents as `unknown (partial status)` and print `bead cache unavailable` or `session snapshot timed out`. * `gc doctor` can report the store as not running. * A dashboard run page can say "run projection is warming"; refresh it after a minute. If any of these persist after ten minutes, run `gc doctor`. ## Run the Built-in Doctor `gc doctor` checks your city for structural, config, dependency, and runtime issues. It is always the best first step: ```bash theme={"dark"} gc doctor gc doctor --verbose # extra detail gc doctor --fix # attempt automatic repairs ``` ## Add City-Local Doctor Checks Use `[[doctor.check]]` in `city.toml` for a workspace-specific health check that does not need to be packaged as a reusable pack doctor. Provide the bare check name; `gc doctor` adds the `local:` prefix in output. ```toml theme={"dark"} [doctor] [[doctor.check]] name = "gopath-symlink" description = "Verify the GOPATH symlink used by local build scripts" script = "scripts/check-gopath.sh" fix = "scripts/fix-gopath.sh" ``` The `script` and optional `fix` paths are relative to the city root. Absolute paths and paths that escape the city directory are rejected and reported as named `StatusError` check results. Local checks reuse the same script protocol as pack doctor checks: | Exit code | Result | | - | - | | 0 | OK | | 1 | Warning | | 2 or higher | Error | The first stdout line becomes the check message. Additional stdout lines are shown by `gc doctor --verbose`. ## "does not import required builtin pack(s)" Warning Builtin packs compose only through explicit pinned `[imports]` in `pack.toml` — nothing splices them into config composition implicitly. `gc init` writes the imports (plus a matching `packs.lock`) for new cities: ```toml theme={"dark"} [imports.core] source = "https://github.com/gastownhall/gascity.git//internal/bootstrap/packs/core" version = "sha:" [imports.bd] source = "https://github.com/gastownhall/gascity.git//examples/bd" version = "sha:" ``` (The `bd` entry is written only for bd-provider cities, the default; non-bd providers get only `core`.) If a required import is missing — typically in a city created before the imports became explicit — config load still self-heals the user-global pack cache and prints a once-per-city warning: ``` warning: this city does not import required builtin pack(s) core; run "gc doctor --fix" to add the missing import(s) ``` Run the suggested fix: ```bash theme={"dark"} gc doctor --fix ``` The `builtin-pack-imports` doctor check migrates the city to the imports model: it strips legacy `workspace.includes` entries pointing at the retired per-city `.gc/system/packs` tree, adds the missing pinned import(s) to `pack.toml`, and refreshes `packs.lock` and the cache. Leftover `.gc/system/packs` directories on disk are pruned automatically. ## `gascity-pack-binding` Doctor Warning Cities created by older releases import the public Gas City pack under the key `gascity`: ```toml theme={"dark"} [imports.gascity] source = "https://github.com/gastownhall/gascity-packs/tree/main/gascity" ``` The import key namespaces the pack's commands and skills, and the pack ecosystem is written against `gc`: the pack documents skill `gc.mayor`, and role prompts in current Gas City pack releases run `gc gc claim`. Under `[imports.gascity]` that command is `gc gascity claim`, so role workers fail their first claim once the pack is updated. Current `gc init` writes `[imports.gc]`. `gc doctor` reports this as a warning; the city keeps working at the pinned 0.1.6 pack. Run: ```bash theme={"dark"} gc doctor --fix ``` The `gascity-pack-binding` check renames the key to `[imports.gc]` in `pack.toml` (or in a city.toml root `[imports]` override), keeping the source, version, and every other field. `packs.lock` is keyed by source, so no reinstall is needed. The check identifies the pack by its source (any https, http, or SSH spelling of `gastownhall/gascity-packs` with the `gascity` pack directory), not by the key name, so a fork or a different pack bound as `gascity` is left alone, and it never touches rig imports or `[defaults.rig.imports]`. The fix changes nothing and explains why when: * `[imports.gc]` already imports a different pack. Rename one of the imports by hand. * `[imports.gc]` already imports the Gas City pack with a different version or settings. Remove one of the two imports by hand. An exact duplicate (same source and version) is removed automatically. * A string value in `pack.toml` or `city.toml` is shaped like a `gascity.`-qualified name, for example a patch targeting `gascity.`. The message names the file and key. Update the value to `gc.` and rerun, or rename the import by hand if the value is unrelated. Comments are ignored. ## "command not found" After Install If `gc` is installed but your shell cannot find it, the binary is not on your `PATH`. **Homebrew** puts binaries in a directory that is usually already on your PATH. Run `brew --prefix` to confirm, then check that `$(brew --prefix)/bin` appears in your `PATH`. **Direct download** requires you to move or symlink the binary into a directory on your PATH: ```bash theme={"dark"} install -m 755 gc ~/.local/bin/gc # or /usr/local/bin/gc ``` Then verify: ```bash theme={"dark"} which gc gc version ``` If you use a non-standard shell (fish, nushell), check that shell's PATH configuration rather than `~/.bashrc` or `~/.zshrc`. ## Oh My Zsh Git Plugin Hides `gc` Oh My Zsh's `git` plugin defines `gc` as an alias for `git commit --verbose`. When that alias is active, commands like `gc version`, `gc init`, or `gc start` run git instead of the Gas City binary. Temporary workaround: ```bash theme={"dark"} command gc version command gc init ~/my-city ``` `command` bypasses shell aliases for that invocation. Persistent fix in `~/.zshrc`: ```bash theme={"dark"} source "$ZSH/oh-my-zsh.sh" unalias gc 2>/dev/null ``` The `unalias` line must come **after** Oh My Zsh loads. If it appears before `source "$ZSH/oh-my-zsh.sh"`, the `git` plugin recreates the alias later. Oh My Zsh also loads files in `$ZSH_CUSTOM` after built-in plugins, so this is a good alternative: ```bash theme={"dark"} mkdir -p ~/.oh-my-zsh/custom printf '%s\n' 'unalias gc 2>/dev/null' > ~/.oh-my-zsh/custom/gascity.zsh ``` If you do not use Oh My Zsh git aliases, you can also remove `git` from the `plugins=(...)` list. ## Missing Prerequisites `gc init` and `gc start` check for required tools and report any that are missing. You can also run `gc doctor` inside an existing city for a fuller check. ### Always required | Tool | macOS | Debian / Ubuntu | | - | - | - | | tmux | `brew install tmux` | `apt install tmux` | | git | `brew install git` | `apt install git` | | jq | `brew install jq` | `apt install jq` | | pgrep | included | `apt install procps` | | lsof | included | `apt install lsof` | ### Required for the default beads provider (`bd`) | Tool | Min version | macOS | Linux | | - | - | - | - | | dolt | 2.6.0 or newer | `brew install dolt` | [releases](https://github.com/dolthub/dolt/releases) | | bd | 1.3.0 | [releases](https://github.com/gastownhall/beads/releases) | [releases](https://github.com/gastownhall/beads/releases) | | flock | -- | `brew install flock` | `apt install util-linux` | ### Optional for GitHub gates | Tool | macOS | Linux | | - | - | - | | gh | `brew install gh` | [cli.github.com](https://cli.github.com/) | Gas City can run without `gh`. The core pack's maintenance orders skip GitHub gate checks when the GitHub CLI is not installed. If you do not want to install dolt, bd, and flock, switch to the file-based store: ```bash theme={"dark"} export GC_BEADS=file ``` Or add this to your `city.toml`: ```toml theme={"dark"} [beads] provider = "file" ``` The file provider is fine for trying Gas City locally. The `bd` provider adds durable versioned storage and is recommended for real work. ## Dolt Version Too Old Gas City requires a final Dolt 2.6.0 or newer. Older and pre-release builds are below the managed bd/Dolt compatibility floor: 2.6.0 is the first Dolt built with a Go toolchain that distrusts the compromised eMudhra CA intermediates. Check your version: ```bash theme={"dark"} dolt version ``` Upgrade via Homebrew (`brew upgrade dolt`) or download a newer release from [dolthub/dolt/releases](https://github.com/dolthub/dolt/releases). ## `bd` Version Too Old Gas City requires `bd` 1.3.0 or newer. `gc init` and `gc start` refuse an older `bd` with `bd (found vX, need v1.3.0+)`, and `gc doctor`'s `check-bd` check reports `bd X is too old (need >= 1.3.0)`. 1.3.0 is the first tested release with the `bd update --if-assignee --if-status` conditional release, which Gas City uses to release a stale work assignment without clobbering a concurrent re-claim. A `bd` without those flags gets a typed "conditional assignment release unsupported" error, and Gas City releases no stale assignment through it: work orphaned by a dead session stays assigned to that session until you upgrade `bd`. A 1.2.x version number is not enough: bd 1.2.0 and 1.2.1 were accidental, untested releases, and bd 1.2.2 re-released the 1.1.2 code without the flags. Check your version: ```bash theme={"dark"} bd version ``` Upgrade via Homebrew (`brew upgrade beads`) or download a newer release from [gastownhall/beads/releases](https://github.com/gastownhall/beads/releases). ## `gc init` Created a Single-Store City A new city is born split unless something keeps it single-store, and `gc init` prints the reason on stderr. The HTTP city create follows the same rules. | Notice names | Why | To get the split | | - | - | - | | bd older than v1.3.2, or a bd tree that matches no pinned inventory | A split city's `gc bd` runs only a bd whose command tree gc pins | Upgrade bd, put the real binary (not a shim or wrapper script) on `PATH`, then split with `gc storage migrate` | | a session runtime that runs sessions on remote hosts | A split city's remote sessions refuse mail, nudges, sessions, orders and workflows until worker-site transport exists | Keep the city single-store for now | | a bead prefix, derived from the city name, in the reserved namespace (`gas-city-ops` derives `gco`) | A split city's infrastructure store mints its ids under `gcg`, `gcm`, `gcs`, `gco`, `gcn` and `gcnq`, so the city's own beads cannot use one | Init the city under another name, or with a non-reserved prefix: `gc init --prefix gops ~/gas-city-ops` | `gc init --from` applies the bd and session-runtime rules to a source that carries the split, as the shipped examples do: the copy leaves the source's `[storage]` out and prints the same notice. A copy can leave out only the `[storage]` of the source's `city.toml`, so where those rules apply to a source that declares part of it in an include fragment, as `examples/storage` does, `gc init --from` refuses the copy instead and copies nothing. Run it where a split city is served, or copy the source, remove `[storage]` and every `[storage.*]` table from its `city.toml` and include fragments, and run `gc init --from` on that copy. A reserved name is not judged here: `gc init --from` refuses a copy that keeps the split under such a name (next section). `gc init --storage=single` creates a single-store city on purpose and prints nothing. `--storage` is refused with `gc init --from`. To keep a copied city single-store on purpose, make the copy without starting it, take the whole `[storage]` section out of its `city.toml` and of any include fragment that declares part of it (`[storage]` and every `[storage.*]` table under it), then start it: ```bash theme={"dark"} gc init --from examples/gastown --no-start ~/my-city # delete [storage] and every [storage.*] table from ~/my-city/city.toml cd ~/my-city && gc start ``` Without `--no-start`, `gc init --from` starts the city split. Once it has served its infrastructure classes from `.gc/store`, a city with the section taken out refuses to start until you remove `.gc/storage-served-binding.json`, which abandons everything that store holds; read [Rolling back](/runbooks/split-storage-classes#rolling-back) first. To split a single-store city later, see [Move a City's Infrastructure Classes onto Their Own Store](/runbooks/split-storage-classes). ## `gc init` or `gc rig add` Refuses a Reserved Bead Prefix A split city reserves the bead prefixes `gcg`, `gcm`, `gcs`, `gco`, `gcn` and `gcnq` for its infrastructure store, so a split city whose work beads would use one is refused before anything is written. A prefix derives from a name's initials: the city name `gas-city-ops` derives `gco`, and a rig directory named `graphql-code-generator` derives `gcg`. A plain `gc init` whose city name derives a reserved prefix starts the city single-store instead (previous section). These are refused: | Command | Fix | | - | - | | `gc init --prefix gcm ~/bright-lights`, a reserved prefix you pass | Pass a non-reserved prefix: `gc init --prefix bl ~/bright-lights` | | `gc init --storage=split ~/gas-city-ops` | Pass a non-reserved prefix: `gc init --storage=split --prefix gops ~/gas-city-ops` | | `gc init --file` of a split config, or `gc init --from` of a split source whose copy keeps the split, into a name that derives a reserved prefix | `--prefix` is refused with both; give the city another name: `gc init --from examples/gastown --name city-ops ~/gas-city-ops` | | `gc rig add` on a split city, for a rig whose prefix is reserved | Give the rig a prefix of its own: `gc rig add --prefix gqlgen ~/src/graphql-code-generator`, or the `prefix` field of an HTTP rig create | ## `gc bd` Refuses a Command on a Split City On a split city, `gc bd` forwards only the commands and flags it has vetted, and only to a bd whose command tree matches a pinned inventory. A refusal names the command and the `gc` alternative; nothing is written. `gc bd ready` is refused on purpose: use `gc ready`, which also reads the infrastructure store. `gc doctor`'s `bd-command-inventory` check shows why a bd binary does not match. The full list is in [gc bd on split cities](/runbooks/split-storage-classes#gc-bd-on-split-cities). ## Native Store Falls Back Because Hooks Are Installed Native `bd` store selection intentionally falls back to the subprocess-backed store when executable `.beads/hooks/on_create`, `.beads/hooks/on_update`, or `.beads/hooks/on_close` scripts are present. Those hooks historically emitted bead events for external `bd` writes; the native in-process store does not run shell hooks. For orchestrator-managed Gas City deployments, confirm that the orchestrator is wrapping stores with `CachingStore` and emitting `bead.created`, `bead.updated`, `bead.closed`, and `bead.deleted` events to the event bus. After that migration is verified, remove the executable hook scripts from the city or rig `.beads/hooks/` directory to allow native store adoption. While a city still depends on those hook scripts directly, keep its stores on the subprocess-backed store by turning native transport off in `city.toml`: ```toml theme={"dark"} [beads] native_transport = "off" ``` Restart a running city after the change: the stores it holds open keep the value it read at boot. `gc` commands, and the stores the city opens for a single tick, read the current `city.toml` every time. This setting replaces the `GC_BEADS_FORCE_FALLBACK=1` environment variable, which still works but is deprecated and applies to every city the process serves. With either one, `gc start` refuses a `[storage]` binding served by `beads-workspace`, because that provider opens the native store. Turn native transport off only in cities that have no such binding, or remove the binding first. ## Native Store Falls Back Because Dolt Is in Embedded Mode **Symptom:** `gc status` or `gc session list` is slower than expected, or `gc doctor` reports `native_store_unavailable gate=dolt_mode_safe`. Gas City's native in-process beads store requires that `bd context` reports `dolt_mode=server`. When `bd` is configured with an embedded Dolt instance (the default for a freshly installed `bd`), the `dolt_mode_safe` gate fails and Gas City falls back to invoking the `bd` CLI as a subprocess for every store operation. Each subprocess call adds tens to hundreds of milliseconds of overhead, which accumulates noticeably during `gc status` and `gc session list`. **Remedy:** Run `bd` against a Dolt SQL server so that `bd context` reports `dolt_mode=server`: ```bash theme={"dark"} # Start a local Dolt SQL server (one-time setup) dolt sql-server --port 28231 # Confirm bd resolves server mode bd context --json | grep dolt_mode # expected: "dolt_mode": "server" ``` Once `bd context` reports `dolt_mode=server`, `gc doctor` will clear the `dolt_mode_safe` gate and Gas City will use the native store automatically on the next start. > [!NOTE] > > The `gascity_native_beads` build tag visible in some source files is a > test-only mechanism — it requires `GC_NATIVE_DOLTLITE_BEADS=true` and is > not a supported operator path. Use Dolt server mode instead. ## `dolt_mode_safe` Preflight Gate Fails The native in-process store is unavailable after `gc start`, and the supervisor log shows: ``` native_store_unavailable gate=dolt_mode_safe reason="dolt_mode=embedded; native store requires Dolt server mode (bd context must report dolt_mode=server) — falling back to per-call bd. See troubleshooting." ``` `gc status --json | jq .beads` reports `"preflight_gate":"dolt_mode_safe"` with `"native_store_eligible":false`. The `dolt_mode_safe` gate keys off the `dolt_mode` value that `bd context` reports; a value of `embedded` fails the gate. The gate reads this from `bd context`, not from `.beads/config.yaml`, so hand-editing the config file is not the supported repair. Confirm what `bd` currently reports: ```bash theme={"dark"} bd context --json | jq .dolt_mode # should print "server" ``` **Remedy:** This is the same native-store fallback covered under [Native Store Falls Back Because Dolt Is in Embedded Mode](#native-store-falls-back-because-dolt-is-in-embedded-mode). Follow that section to run `bd` against a Dolt SQL server so `bd context` reports `dolt_mode=server`, then apply and re-check: ```bash theme={"dark"} gc restart ``` Do not bypass or disable the `dolt_mode_safe` check — it guards the store-mode contract that keeps `bd` and gc in agreement. ## Listings Miss Durable Beads After Changing `types.infra` **Symptom:** after a type is added to a store's `types.infra` setting, a running city's listings of that type return only its ephemeral beads. The native store asks the server to filter a listing by type only for types the server keeps durable, and it reads which types those are from the store's stored `types.infra` setting when it opens. A running city keeps what it read for the stores it holds open. `gc` commands, and the stores the city opens for a single tick, read the current setting every time. **Remedy:** change the stored setting, then restart the city: ```bash theme={"dark"} gc bd config set types.infra "" # add --rig for a rig's store gc restart ``` Gas City reads only the stored setting. If the server of a remote beads workspace names `types.infra` in its own `.beads/config.yaml`, put the same types in the stored setting too. ## flock Not Found (macOS) macOS does not ship `flock`. Install it via Homebrew: ```bash theme={"dark"} brew install flock ``` Alternatively, switch to the file-based beads provider (see above) to skip the flock requirement entirely. ## Cursor MCP Tools Still Prompt or Appear Unavailable The built-in `cursor` provider starts `cursor-agent` with `-f --trust` so an unattended worker does not stop at Cursor's workspace-trust dialog. Use it only for workspaces whose contents you trust. The flag does not approve MCP servers; Cursor's MCP approval prompt remains enabled by default. For unattended Cursor pool workers, opt in only after confirming that every workspace and user/global MCP server visible to Cursor is trusted. The `--approve-mcps` flag approves every visible server, including servers projected from Gas City's catalog into `.cursor/mcp.json` and servers from `~/.cursor/mcp.json`. ```toml theme={"dark"} [providers.cursor.option_defaults] mcp_approval = "approve" ``` If you override Cursor `args` directly, the override replaces the built-in args. Include `-f --trust` yourself and add `--approve-mcps` only for the same explicit MCP trust decision. Agent-level `args` overrides behave the same way. Existing Cursor sessions keep the command fingerprint they were created with. The supervisor reconciler restarts sessions automatically after the fingerprint changes. Drain the pool first when you need a controlled handoff rather than waiting for the next automatic restart. ## Gas City Leaves a Project's Own MCP Config Alone gc writes the MCP servers from your city's catalog into each provider's project config: `.mcp.json`, `.codex/config.toml`, `.gemini/settings.json`, `.cursor/mcp.json`, `opencode.json`, or `mimocode.json`, at the city root, each rig root, and agent work dirs. When one of those files already holds MCP servers the catalog does not define, or defines a server differently, such as a team's `.mcp.json` committed to a rig's repository, gc does not take it over, since that would replace the team's servers. It leaves the file as it is and warns: ```text theme={"dark"} gc: warning: agent "frontend/coder" starts without gc's MCP server "notes": not adopting /src/frontend/.mcp.json: gc does not manage it yet, and adopting it would drop MCP server "team-db"; to let gc manage it, define the servers you still need in gc's MCP catalog (an mcp/ directory) and remove those entries from the file ``` The agents that read that file keep the team's servers and start without gc's. To see where this applies: * `gc doctor` lists every such file under `mcp-adoption`. * `gc start --dry-run` shows a file at the city root or a rig root as `leave ... as it is`, and warns about a file in an agent's own work dir. * `gc mcp list --agent `, or `--session ` for a pool or worktree session, says "Not delivered" for an agent that reads one. * The supervisor log shows the warning when the city starts, and when gc next resolves an agent whose own work dir holds such a file, such as a session's checkout of a repository that commits its own `.mcp.json`. It shows it once per agent, and again if the file's content changes or the file comes back after gc saw it gone. gc also leaves alone a file it cannot read or parse, a symlinked one, and one that is not a regular file (a named pipe, a device) or is larger than 4 MiB, which it does not read at all. To give those agents gc's servers too, define the file's servers you still need in an `mcp/` catalog that reaches every agent reading the file, one `.toml` per server, and remove the file's own entries: * A file at the city root or a rig root is shared by every agent of that provider there, including the one gc adds for each declared provider. Use the city's `mcp/`, or for a rig root, a pack the rig imports. * A file in one agent's own work dir can also take the agent's own `agents//mcp/`. gc adopts the file the next time it projects there: at the next city start for the city and rig roots, and at the agent's next session start for its own work dir. Editing the file does not restart anything. On adoption, gc saves the original under `.gc/mcp-adopted/` and writes every server from the catalog. If the repository tracks the file, think twice before letting gc adopt it. gc's version can hold secrets expanded from `env` or `headers`, and it shows up as a change to the tracked file; `.gitignore` does not hide changes to tracked files. gc does not ask before it adopts a tracked file that holds no servers of its own, such as a committed `opencode.json` or `.gemini/settings.json` with only settings. It notes the adoption on stderr, adds gc's servers to the file, keeps its other settings, and rewrites its formatting (comments in a `.codex/config.toml` are lost). gc starts Claude with project MCP servers pre-approved, so the servers in a `.mcp.json` gc leaves alone run in its Claude agents without a trust prompt, as they do in a city with no MCP catalog. Review a repository's MCP config before you add it as a rig. `gc doctor` also reports files an earlier gc took over while they held servers the catalog does not define. Their definitions are in the snapshot it names under `.gc/mcp-adopted/`. To hand such a file back, stop the city (`gc stop`), restore the file from the snapshot, and delete the marker gc keeps for it, `.gc/mcp-managed/.json` at the same root; gc then leaves it alone. Deleting the snapshots clears the report. ## An Agent Starts Without an MCP Server The supervisor log (`gc supervisor logs`) shows a warning like this one when the city starts or reloads its config; `gc start --dry-run` prints it too. `gc start` and `gc reload` print it as well, but they work it out on your shell's `PATH`, which can differ from the supervisor's. If they disagree, for example about a provider that is not installed, the supervisor log is right: ```text theme={"dark"} gc: warning: city "my-city": agents "cursor" (the implicit agent for provider "cursor"), "editor" start without MCP server "search" (http, from import "search"): gc projects only stdio MCP servers for the "cursor" harness ``` An implicit agent is one gc adds for every provider the city declares, so work can be slung to that provider without defining an agent; the warning names its provider because you never wrote it. MCP servers from the city's `mcp/` directory, a rig pack, or an import apply to every agent in that scope. When an agent's provider cannot receive one of them, Gas City leaves that server out of the agent's MCP config and starts the agent without it. Every other agent starts as usual. | Provider family | Receives | | - | - | | `claude`, `codex`, `gemini`, `opencode`, `mimocode` | stdio and HTTP servers | | `cursor` | stdio servers only | | any other provider, such as `copilot` | no MCP servers | Agents whose sessions use ACP receive every server through the protocol itself, whatever their provider family. `gc mcp list --agent ` lists the skipped servers under **Not projected**. `gc doctor`, `gc config show --validate`, and `gc import add` report the same warning, so you can see it before the city starts. If the agent does not need the server, nothing needs to change. If it does, switch the agent to a provider that can receive it. A server in an agent's own `agents//mcp/` directory is meant for that agent alone. If the agent's provider cannot receive it, that agent does not start, and the warning says `cannot start`; the rest of the city still starts. ## Provider Credentials Dropped When the Supervisor Starts Symptom: agents authenticate fine when you launch a city from your normal interactive shell, but fail to authenticate (or silently fall back to a different provider) when the city is started by the supervisor at login or after a reboot. Cause: the supervisor service file (launchd plist / systemd unit) captures provider credentials by snapshotting the environment of the shell that ran `gc start` (or `gc supervisor install`). A credential that is only present in an interactive shell — for example sourced from an rc file that the login service manager never reads — is not in that snapshot, so it never reaches the supervised process. Fix: put the durable credentials in a machine-local secrets file at `${GC_HOME}/secrets.env` (defaults to `~/.gc/secrets.env`). On every service file regeneration, `gc` merges this file into the supervisor environment, so the value survives a reboot regardless of which shell ran `gc start`. ```bash theme={"dark"} # ~/.gc/secrets.env (chmod 600) ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... ``` The file uses dotenv syntax: `KEY=VALUE` per line, `#` comments, blank lines, an optional `export ` prefix, and optional surrounding quotes. Only keys that are already eligible for the supervisor environment are merged — provider credentials (recognized by their standard prefixes such as `ANTHROPIC_`, `OPENAI_`, `GEMINI_`), a short built-in list of settings (among them the Dolt credential and logging settings `GC_DOLT_USER`, `GC_DOLT_PASSWORD`, and `GC_DOLT_LOGLEVEL`, and the beads pool deadlines below), plus any keys you opt in via `GC_SUPERVISOR_ENV`; any other key in the file is ignored. A value exported in the calling shell still takes precedence over the file, and `GC_SUPERVISOR_OMIT_PROVIDER_CREDS=1` suppresses provider credentials from both sources. The same file is the durable home for the beads connection-pool deadlines. `gc` reads `BEADS_DOLT_POOL_READ_TIMEOUT` and `BEADS_DOLT_POOL_WRITE_TIMEOUT` for its own store connections only from its process environment; the `dolt.pool-*-timeout` keys in `.beads/config.yaml` and entries in `.beads/.env` reach the `bd` CLI, not `gc`. If the 10-second default is too tight for a loaded shared Dolt server (store operations fail with `i/o timeout` or `invalid connection`), raise both here: ```bash theme={"dark"} # ~/.gc/secrets.env BEADS_DOLT_POOL_READ_TIMEOUT=90s BEADS_DOLT_POOL_WRITE_TIMEOUT=90s ``` These values also reach the `bd` commands and agent sessions that inherit the supervisor's environment, where they take precedence over the per-workspace `.beads/` settings. Apply the change by regenerating the service file: ```bash theme={"dark"} gc supervisor install # rewrites the service file; restarts on change ``` ## A Custom Environment Variable Doesn't Reach Agent Sessions Symptom: a non-`GC_`-prefixed variable you've exported and confirmed is set (e.g. in your shell, `~/.bash_env`, or a systemd/launchd unit) never shows up inside a spawned agent session's environment, even though `gc supervisor run` itself can see it. Cause: `passthroughEnv` only forwards a variable into a session if it is either `GC_`-prefixed, part of the small fixed provider/locale/XDG set, or named in `GC_SUPERVISOR_ENV` — the same opt-in `gc supervisor install` uses to widen the persisted service-file env (see above). Everything else is dropped silently, by design: an unbounded sweep of the calling environment would leak whatever secrets happen to be sitting in the supervisor's process, into every agent session. Fix: name the variable in `GC_SUPERVISOR_ENV` in the environment the supervisor daemon itself runs with, then restart it so the daemon process picks up both the opt-in list and the variable's value: ```bash theme={"dark"} export GC_SUPERVISOR_ENV=GC_SUPERVISOR_ENV,MY_CUSTOM_VAR # the list names itself so it survives restarts; comma or space separated export MY_CUSTOM_VAR=/path/to/thing gc supervisor install # regenerates the service file with both persisted gc supervisor stop && gc supervisor start # restart the supervisor so it inherits them ``` Sessions that are already running keep their old environment; restart them to receive a newly forwarded variable. `GC_SUPERVISOR_ENV` itself needs to be present in the supervisor daemon's own environment for this to survive a later restart — it is not automatically persisted into the generated service file the way `PATH`/`GC_HOME` are. If you rely on a managed service file, either list `GC_SUPERVISOR_ENV` among its own opted-in names (`GC_SUPERVISOR_ENV=GC_SUPERVISOR_ENV,MY_CUSTOM_VAR`) or set it directly in the unit's `Environment=` lines. For a value that's the same on every city, `[workspace.env]` in `city.toml` is usually simpler than an opt-in — it doesn't depend on the supervisor's own process environment at all: ```toml theme={"dark"} [workspace.env] MY_CUSTOM_VAR = "/path/to/thing" # or, to read it from whatever the supervisor's own environment holds: MY_CUSTOM_VAR = "$MY_CUSTOM_VAR" ``` ## Supervisor Log Written Twice (journald + supervisor.log) `gc supervisor run` tees its output into `${GC_HOME}/supervisor.log` (defaults to `~/.gc/supervisor.log`) so `gc supervisor logs` works no matter how the supervisor was started. Under a hand-managed systemd unit with `StandardOutput=journal`, that tee becomes a second copy of every line: journald keeps one, and `supervisor.log` grows without rotation. Set `GC_SUPERVISOR_LOG_TEE=0` in the supervisor's environment to disable the tee so the service manager's log is the single sink. Only the literal value `0` disables it; any other value (or unset) keeps the default tee. ```ini theme={"dark"} # hand-managed ~/.config/systemd/user/gascity-supervisor.service [Service] StandardOutput=journal StandardError=journal Environment=GC_SUPERVISOR_LOG_TEE=0 ``` Scope and caveats: * **The variable matters in two places.** The supervisor process's environment controls the tee. The shell running `gc supervisor logs` controls only what that command reports: when the variable is set there and `supervisor.log` exists, the file is tailed with a staleness warning; when the file is absent, the command points at the service manager's log (`journalctl --user -u gascity-supervisor.service` on Linux) instead. A unit's `Environment=` lines are invisible to your interactive shell, so export the variable in both for coherent behavior. * **Service files generated by `gc supervisor install` or `gc start` do not need — and do not honor — the opt-out.** Generated units redirect supervisor output straight into `supervisor.log` (systemd `StandardOutput=append:`, launchd `StandardOutPath`), and the tee already suppresses itself when its output is that same file, so `supervisor.log` is the single sink in those shapes. The variable is not captured into generated service files automatically; it exists for units you manage by hand. * **To persist the variable into a generated service file anyway** — for example as a starting point you then hand-edit to `StandardOutput=journal` — opt it in explicitly and regenerate: ```bash theme={"dark"} export GC_SUPERVISOR_LOG_TEE=0 GC_SUPERVISOR_ENV=GC_SUPERVISOR_LOG_TEE gc supervisor install ``` Note that `gc start` regenerates the service file with the file-redirect defaults, so a hand-edited unit at gc's service path stays journal-only only on hosts where gc never manages the unit. ## Delegating the Supervisor Lifecycle to an Operator-Managed systemd Unit By default `gc` owns the supervisor lifecycle: `gc start` installs and starts a per-user service (`gascity-supervisor`), and binary-drift detection restarts that service directly. Hosts that run the supervisor under an operator-managed systemd unit instead — for example a hardened system service with its own restart policy — can delegate the lifecycle: ```bash theme={"dark"} GC_SUPERVISOR_SYSTEMD_UNIT=gascity-prod.service # unit that owns the supervisor GC_SUPERVISOR_SYSTEMD_SCOPE=system # "system" (default) or "user" ``` With the unit configured: * `gc supervisor start` and the `gc start` ensure path run `systemctl [--user] start ` (bounded, so a wedged unit cannot hold the CLI indefinitely) and wait for the control socket to answer. When the socket stays unreachable — the usual situation for a system-scope unit running under a different user — start falls back to the same liveness evidence `gc supervisor status` trusts: an active unit, then the supervisor HTTP API. Only when all three are silent does start fail. gc never writes, loads, or daemon-reloads its own service files in delegated mode; `gc supervisor install` refuses to run, and `gc supervisor uninstall` only removes gc's own legacy service. * `gc supervisor stop` runs `systemctl [--user] stop ` synchronously, bounded by `--wait-timeout` (default 30s) whether or not `--wait` is set, then verifies a previously-running supervisor actually exited. A live supervisor the unit does not manage (common mid-migration) fails the stop with its PID instead of reporting a false "Supervisor stopped.", and stop with nothing running keeps the legacy exit-1 "supervisor is not running" contract. * The `gc start` drift auto-restart runs `systemctl try-restart ` (a unit the operator stopped stays stopped) and fails unless the restart verifiably resolved the drift: a supervisor that was not replaced, a replacement still serving the drifted build (the unit's `ExecStart` launches a stale binary), or an unverifiable post-restart probe each fail instead of declaring "ready" while a stale supervisor keeps serving. * `gc supervisor status` probes the delegated unit (`systemctl [--user] is-active `) when the control socket is unreachable — the usual situation for a system-scope unit running under a different user — and reports a broken delegation config (a warning in text mode, a `config_error` field in `--json`) instead of a bare "not running". An invalid `GC_SUPERVISOR_SYSTEMD_SCOPE` value is a hard error on every lifecycle path; gc never silently falls back to the default unit. Setting `GC_SUPERVISOR_SYSTEMD_UNIT` on a non-Linux platform is the same kind of hard error — delegation is a systemd contract. ## Supervisor Does Not Come Back After Logout (macOS launchd Agent Disabled) Symptom: on macOS the supervisor is running, but it does not come back after logout or reboot, and `gc supervisor status` prints a warning on stderr: ```text theme={"dark"} gc supervisor status: warning: launchd agent com.gascity.supervisor is disabled; it will not start after logout or reboot. Run 'gc supervisor stop --wait' then 'gc supervisor start' to put it back under launchd ``` Cause: `gc supervisor stop` disables the launchd agent so the stopped supervisor stays stopped, even across logins. That override is persistent: it survives logout and reboot, and only `launchctl enable` clears it. A supervisor started any other way afterwards, such as a foreground `gc supervisor run`, passes every liveness check while launchd would never restart it. An installed agent that is not loaded has the same effect, and status warns about it too (`... is not loaded; it will not restart if the supervisor exits`). To see the override yourself: ```bash theme={"dark"} launchctl print-disabled "gui/$(id -u)" | grep com.gascity.supervisor ``` The warning leaves the liveness report on stdout and the exit code unchanged. With `--json`, status adds `"supervised": false` and a `supervision_warning` string carrying the same message. Both keys are absent when launchd is supervising, and also when status cannot tell: no agent is installed, its plist cannot be read, or launchd does not answer. Fix: run the command the warning names. It depends on what status found: | Status found | Remedy | | - | - | | The agent runs this `gc`, and no supervisor is running | `gc supervisor start`, which enables, loads, and starts the agent | | The agent runs this `gc`, and a supervisor is running | `gc supervisor stop --wait`, then `gc supervisor start` | | The agent runs a different `gc` binary | ` supervisor install --force`, after `gc supervisor stop --wait` if a supervisor is running | Use `stop --wait`: a plain `gc supervisor stop` returns while the supervisor is still shutting down, and `gc supervisor start` refuses while a supervisor is running. A plain `gc supervisor install` is not a substitute either: when the service file is already current and a supervisor is running, it reports success without enabling the agent. ## JSONL Archive Push Failures The core pack runs `jsonl-export` every 15 minutes to export each bead store (the city and every rig) with `bd export` into a text-diffable JSONL snapshot inside a local git repository (the "JSONL archive"): one issue per line, with its labels, dependencies and comments. The archive serves as a disaster-recovery backup: a snapshot from any commit restores with `gc bd import `. On a split-store city, a snapshot that holds infrastructure rows (from before the split) is refused. Re-run it with `gc bd import --skip-infra` to import only the work rows, because the class binding already holds the live infrastructure state. `jsonl-export` (every 15 minutes) and `reaper` (every 30 minutes) ship in the core pack, so they are active in every city by default — including cities that previously ran them only via the opt-in gastown maintenance pack. Both reach every bead store through `gc bd`, so they work the same on bd-owned proxied, gc-managed and mixed cities. On cities whose beads provider is not bd (for example `[beads] provider = "file"`), both orders skip with a one-line message and an `order.skipped` event instead of running. To turn them off entirely, skip them by name in `city.toml`: ```toml theme={"dark"} [orders] skip = ["jsonl-export", "reaper"] ``` Cities that had skipped the old formula orders (`mol-dog-jsonl`, `mol-dog-reaper`) stay opted out; the renamed orders honor the legacy skip entries. On a bead store that holds op rows (beads of type `op`, which ops recording writes), `reaper` does not run its wisp purge or its session prune. Both delete closed no-history beads, and bd deletes an op row without a tombstone unless it keeps that type. The reaper runs both again once the store's bd honors `types.retained` (its `bd purge --help` and `bd prune --help` name the setting) and the store's database names `op` there. Every writer of the store must run such a bd first; then set it with `gc bd config set types.retained op` (add `--rig ` for a rig store). Until then each run records the skipped step in its `order.skipped` event, and `gc doctor`'s `ops-recording` check warns about the store. ### Local-only vs push mode The archive operates in one of two modes, detected from the state of its git remotes on every run: * **Local-only (default).** No `origin` remote is configured. Commits are created and retained on the host but never leave the machine. This mode is safe to run indefinitely; its only limitation is that the archive is not backed up off-box, so a disk failure on this host loses the archive alongside the live Dolt data. * **Push.** An `origin` remote is configured. Each run rebases onto `origin/main` and pushes new commits so the archive survives a host loss. On each run `jsonl-export` logs the active mode to stderr on transitions (e.g. after you add or remove `origin`) and re-logs it at least weekly so that an operator reading the log file can always find the current mode. ### Archive object maintenance Every snapshot commit creates loose Git objects, including in local-only mode. Each run exports and commits first, pushes in push mode, and only then checks the archive. When either of these defaults is reached it runs a foreground, low-priority `git repack --geometric=2`: * `GC_JSONL_GC_LOOSE_OBJECTS=2000` * `GC_JSONL_GC_LOOSE_KB=262144` (256 MiB) A geometric repack packs the loose backlog into a new pack and merges only the small packs beside it. A large existing pack is left alone until the smaller packs beside it grow large enough for the geometric progression to merge it; only `mode=geometric-keep-largest` (below) leaves it out outright. So a run usually writes only the new pack where a full `git gc` rewrote the whole archive. The same pass runs when a run has nothing new to export, so a backlog left by an earlier failure is packed on the next run. It needs Git 2.32 or newer; on an older Git the pass fails with a message that says so. Packing is deliberately single-threaded and uses `GC_JSONL_GC_WINDOW_MEMORY=256m` (a positive byte count, without leading zeros, with an optional `k`, `m`, or `g` suffix in either case) to avoid competing with the Dolt server and worker sessions for memory. These values can be lowered for small hosts. Each pass that packs prints one line to stderr: ```text theme={"dark"} jsonl-export: archive maintenance: mode=geometric wall=12s loose_before=2410 loose_after=0 packs_before=3 packs_after=2 pack_kb_after=41200 ``` A failed pass prints the fields it has plus `status=failed`. Watch `packs_after` and `pack_kb_after` over time: a pack count that keeps growing, or a pack size that keeps climbing, means the large pack has not been rewritten for a long while. Geometric packing postpones that full rewrite; it does not remove it, so the archive's total size still grows with every snapshot until you rewrite it by hand. Packing writes a new pack before it deletes the old objects. It starts only when the archive's filesystem can hold that pack and still keep `GC_JSONL_GC_MIN_FREE_KB=512000` (500 MiB) free: | Free space | What the run does | | - | - | | Room to rewrite everything | Packs normally (`mode=geometric`). | | Room only to rewrite everything except the largest pack | Prints a notice and keeps the largest pack as it is (`mode=geometric-keep-largest`). | | Room for neither | Refuses, after the export, and names the setting below. | The check counts loose objects at their full size, though snapshots usually pack to a small fraction of it: one archive's 9.01 GiB of loose objects packed to 67.40 MiB. So an archive with a large backlog can be refused even when packing it would fit. To recover, pack it once by hand with the command the failure message prints, free disk space, or set `GC_JSONL_GC_MIN_FREE_KB=0` to disable the check. If `df` cannot report the free space, packing goes ahead with a warning. An invalid setting fails the order before it exports anything. A refused free-space check or a failed repack still fails the order visibly (exit 1, no completion event), but only after the run has committed its snapshot and, in push mode, pushed it. A spike halt sends its alert, or saves it for retry, before it packs. A pass that cannot finish therefore never blocks the next export: the next run commits and pushes its snapshot, then tries to pack again. To inspect the archive without changing it: ```bash theme={"dark"} # The default location. GC_JSONL_ARCHIVE_REPO overrides it, and cities # migrated from the gastown maintenance pack keep their legacy path. ARCHIVE="$(gc status --json | jq -r '.city_path')/.gc/runtime/packs/core/jsonl-archive" git -C "$ARCHIVE" count-objects -vH git -C "$ARCHIVE" fsck --connectivity-only ``` To pack the backlog once by hand with less memory: ```bash theme={"dark"} git -C "$ARCHIVE" -c pack.windowMemory=64m -c pack.threads=1 repack -d -l -q --geometric=2 ``` To rewrite the whole archive into one pack (the full rewrite that geometric packing postpones), run `git gc`. It writes the archive's full size again, so check the free space first: ```bash theme={"dark"} git -C "$ARCHIVE" -c pack.windowMemory=64m -c pack.threads=1 gc ``` ### Enabling off-box backup Pick a repository that only this host will push to (the archive contains bead content and should not be shared across cities). Then: ```bash theme={"dark"} # Create a private repo on your git host (example: GitHub via gh) gh repo create my-city-jsonl-archive --private # Point the archive at it (run from anywhere inside your city) ARCHIVE="$(gc status --json | jq -r '.city_path')/.gc/runtime/packs/core/jsonl-archive" git -C "$ARCHIVE" remote add origin git@github.com:/my-city-jsonl-archive.git # Seed the remote with the existing local history git -C "$ARCHIVE" push -u origin main ``` On the next 15-minute tick, `jsonl-export` detects the new `origin`, logs `archive running in push mode`, and resumes pushing every run. On cities migrated from the gastown maintenance pack, the archive stays at its legacy location — `.gc/runtime/packs/maintenance/jsonl-archive` (or `.gc/jsonl-archive` for pre-pack cities) — and the `packs/core/jsonl-archive` path above does not exist. Point `ARCHIVE` at the legacy path instead; `gc doctor` reports the resolved archive path for the city. ### Switching back to local-only Remove the remote: ```bash theme={"dark"} git -C "$ARCHIVE" remote remove origin ``` Re-detection is automatic on the next run — no state-file edits are required. The next log line will read `archive running in local-only mode`. If push mode had accumulated failures before the remote was removed, local-only detection clears that stale failure counter while retaining `pending_archive_push` so deferred commits are still pushed if `origin` returns. ### Reading a `JSONL push failed [HIGH]` escalation When push mode is active and `git push` fails `GC_JSONL_MAX_PUSH_FAILURES` times in a row (default: 3), the default human escalation mailbox receives an `ESCALATION: JSONL push failed [HIGH]` message with a body shaped like: ``` Order: jsonl-export Archive: /path/to/archive Consecutive failures: 3 (threshold: 3) Last git push stderr: Remediation: - Check remote: git -C remote -v - Verify remote is reachable and credentials are valid - Temporarily suppress: export GC_JSONL_MAX_PUSH_FAILURES=99 - See docs/getting-started/troubleshooting.md#jsonl-archive-push-failures ``` Transient ref-update races are retried before the escalation counter is incremented. By default, each retry sleeps for a random delay from 1 to 5 seconds. Set `GC_JSONL_PUSH_RETRY_DELAY_MIN` to change the lower bound and `GC_JSONL_PUSH_RETRY_DELAY_SPAN` to change the random span added above that minimum. The exporter sends one HIGH escalation for a still-unresolved push failure. It continues recording `consecutive_push_failures` and `pending_archive_push` in state, but does not mail the same failure on every tick. A successful push or a switch back to local-only mode clears the escalation marker. ### Maintenance escalation and completion routing Core maintenance scripts route alerts through a generic escalation hook instead of mailing a hardcoded role. Orders inherit the orchestrator's environment, so set these at orchestrator start to customize routing: * `GC_ESCALATION_RECIPIENT` — mail recipient for escalations (default: `human`, the reserved human mailbox). An agent recipient is woken with `--notify`; the `human` default is a mailbox with no session behind it, so nothing is woken and the escalation waits until somebody reads that inbox. Point this at the agent that surfaces alerts (the manager, on a Slack-connected city) if you want maintenance advisories acted on rather than filed. * `GC_ESCALATE_SCRIPT` — absolute path to an escalation script to run instead of searching packs. * `GC_ESCALATE_SEARCH_PACKS` — space-separated pack names searched (in order) for an `assets/scripts/escalate.sh` override (default: `gastown maintenance bd core`). A pack earlier in the list wins. * `GC_ESCALATE_SEND_TIMEOUT_SECS` — wall-clock bound on one escalation send (default: 30). The wake can outlive the send it follows, and escalations run inline in maintenance orders, so the bound keeps a slow wake from stalling the run that raised the alarm. `gc mail send` prints `Sent message` once the mail is written, before the wake. A bound that trips after that line costs at most the wake, never the message, and the script still exits 0. A bound that trips before it means the mail may not exist, for any recipient: the script exits non-zero and the next run sends again. * `GC_ESCALATE_REMINDER_SECONDS` — how long an unchanged incident stays quiet before it is mailed again (default: 86400, one day). See [Why a maintenance alert did not repeat](#why-a-maintenance-alert-did-not-repeat). * `GC_ESCALATE_INCIDENT_DIR` — where incident state is kept (default: `/.gc/incidents`). * `GC_ESCALATE_NOW_EPOCH` — test-only: pins the script's clock. Leave it unset; a fixed clock never reaches the reminder interval, so an unchanged incident is never mailed again. * `GC_MAINTENANCE_DONE_TARGET` — session target to nudge with `MAINTENANCE_DONE:`/warn summaries when a maintenance run completes (default: unset, no completion nudge). Deployments that relied on the old hardcoded completion nudges to a health-patrol session should set this to restore that loop. Common root causes, in rough order of frequency: * **Credentials rotated or expired.** SSH key removed from the remote host, HTTPS token expired. The captured stderr usually reads `Permission denied (publickey)` or `remote: Invalid username or password`. * **Remote URL typo or deleted repo.** stderr reads `does not appear to be a git repository` or `repository not found`. * **Network partition.** stderr reads `Could not resolve host` or a connection-timeout message. If the host is also firewalled from the rest of the internet, this will recover once connectivity returns. * **Diverged history.** Very unusual — the archive rebases onto `origin/main` automatically — but if the remote was force-pushed from another host, rebase may fail with a conflict. Inspecting the archive and resolving manually is the only option. If the underlying problem cannot be fixed immediately (e.g., the remote host is down for scheduled maintenance), set `GC_JSONL_MAX_PUSH_FAILURES=99` in the orchestrator's environment and restart the city with `gc restart`. That bumps the escalation threshold from 3 to 99, which at the current 15-minute tick rate is \~24 hours of silence. ### Why a maintenance alert did not repeat A maintenance order that keeps finding the same problem would otherwise mail it on every run: 48 times a day for the 30-minute `reaper` order. So two orders raise their failures as **incidents**: an alert that is unchanged since it was last mailed stays quiet for `GC_ESCALATE_REMINDER_SECONDS` (default: one day). A change in what failed mails at once, and a clean run resolves the incident, so the next failure mails at once too. | Order | Incident key | Mails again sooner when | | - | - | - | | `mol-dog-backup` | `dolt-backup:required-sync` | the failing databases or their diagnostics change | | `reaper` | `reaper:anomalies` | the anomalies change; a stale backup that only grows older does not count | A quiet run says so in its output: ``` escalate: incident reaper:anomalies unchanged since 2026-10-08T09:00:00Z; next reminder after 2026-10-09T09:00:00Z ``` The backup order's missing-`flock` and offsite-publication alerts are not incidents and still mail on every run. Deduplication is best-effort. When the incident state cannot be read or written, the alert is mailed anyway, and a send that fails is not recorded, so the next run sends it again. To make the next run mail an incident at once, delete its state file. From the city directory: ```bash theme={"dark"} # Forget one incident... rm -f "$(grep -l '^key=reaper:anomalies$' .gc/incidents/*.state)" # ...or all of them. rm -f .gc/incidents/*.state ``` A pack that overrides `escalate.sh` receives `--incident-key KEY --fingerprint F` on an alert and `--resolve-incident KEY` on a clean run. The override must accept or ignore those flags and must send nothing for `--resolve-incident`. An override written before incident keys, which rejects the flags as a usage error (exit 2, or an error that names the flag), still alerts: the order sends the alert again without the flags, so it is mailed on every run instead of deduplicated. The order's output then names the override as one that predates incident keys; run the order by hand to see it, for example `gc order run reaper`. ## WSL (Windows Subsystem for Linux) Gas City works under WSL 2 with a standard Ubuntu or Debian distribution. Install prerequisites using the Linux column in the tables above. tmux requires a working terminal — use Windows Terminal or another WSL-aware terminal emulator. ## Build From Source Fails Building from source requires `make` and Go 1.27.4 or newer: ```bash theme={"dark"} make --version go version ``` If `make` is missing, install it (`apt install make` on Debian/Ubuntu, or `xcode-select --install` on macOS). If your Go version is too old, update it from [go.dev/dl](https://go.dev/dl/) or via your package manager. Then: ```bash theme={"dark"} make build ./bin/gc version ``` See [CONTRIBUTING.md](https://github.com/gastownhall/gascity/blob/main/CONTRIBUTING.md) for the full contributor setup. ## Slung Beads Not Reaching Agents (managed-city mode) If `gc sling` accepts work but agents don't process it — especially if your supervisor log shows `rigStores=0` or `assignedWorkBeads=0`, or your `bd dolt set port` edits keep reverting at the next `gc start` — you're likely looking at a rig whose Dolt view has drifted from the managed city Dolt. Do **not** edit `.beads/dolt-server.port` or `bd dolt set port` directly; both self-revert. See the [Managed-city Dolt endpoints runbook](/runbooks/managed-city-endpoints) for the mental model, the forbidden edits, the sanctioned escape hatches (`gc rig set-endpoint --inherit`/`--self --force`/`--external`), and an end-to-end recovery recipe. ## Still Stuck? If a symptom only makes sense once you know how the pieces fit together, see [The six primitives](/getting-started/how-gas-city-works) for the underlying model. Open an issue at [gastownhall/gascity/issues](https://github.com/gastownhall/gascity/issues) with the output of `gc doctor --verbose` and your OS/architecture. # Upgrading an Existing City Source: https://docs.gascity.com/getting-started/upgrading Back up a city, upgrade Gas City and Beads, and run the one-time Beads schema migration when your city needs it. A new `gc` binary is the easy part of an upgrade. The work ledger is the part that matters: every bead your city and its rigs have recorded lives in Dolt databases that the new `bd` may need to migrate. This page walks through an upgrade of a running city, using a city at `~/my-city` with one rig, `my-project`, at `~/my-project`. The Homebrew `gascity` formula depends on `beads`, so `brew upgrade gascity` upgrades both to the latest release. ## Check what you are upgrading from ```bash theme={"dark"} gc version bd version ``` What you need to do to the Beads databases depends on the `bd` your city has been running: | `bd` it ran | Beads schema step | | - | - | | 1.3.0 or newer | None. The current `bd` keeps the 1.3.0 schema. | | 1.2.2 or older | Run `migrate schema` once for the city and once for each rig (see [Migrate the Beads schema](#migrate-the-beads-schema)). | If you are not sure, run the migration step anyway. On a database that is already current it changes nothing and reports `Schema already at v66`. ## Stop the city and back it up Note each rig's path, then stop the city: ```bash theme={"dark"} gc rig list # rigs and their paths; their .beads go in the backup too gc stop ~/my-city pgrep -fl "my-city/.gc/runtime/packs/dolt" # prints nothing once Dolt is down ``` `gc stop` stops the agents and then the city's Dolt server. A copy of the Dolt data is only consistent once that server has exited, so wait for the `pgrep` check to come back empty. `gc stop` also unregisters the city from the supervisor, so name the city by its directory, not its name, until `gc start ~/my-city` registers it again. Back up the city directory and each rig's `.beads` directory: ```bash theme={"dark"} tar -czf ~/my-city-backup.tgz -C ~ my-city tar -czf ~/my-project-beads-backup.tgz -C ~/my-project .beads # repeat for each rig ``` | What | Why it matters | | - | - | | `~/my-city/.beads/dolt` | The Dolt data for the city **and every rig**. A city created by an older release runs one Dolt server whose data directory holds one database per scope. | | `~/my-city/.beads` | The city's Beads identity and connection settings. | | `~/my-city/.gc/site.toml` | Where each rig lives on this machine. | | `~/my-city/city.toml`, `pack.toml`, packs and lock files | Your city's configuration. | | `~/my-project/.beads` | Each rig's Beads identity and connection settings. | A rig that uses its own Dolt server or an external one keeps its data elsewhere; back that up too. A large `.beads/backup/` directory holds bd's own automatic backups and can be left out with `tar --exclude`. To roll back, stop the city, put these directories back, and reinstall the previous `gc` and `bd`. ## Upgrade Gas City and Beads ```bash theme={"dark"} brew update brew upgrade gascity # also upgrades beads gc version # the latest release bd version ``` With a direct download, install the latest `bd` from the [Beads releases](https://github.com/gastownhall/beads/releases) as well as the new `gc`. Upgrade every `bd` that reaches these databases, including copies elsewhere on your `PATH` (`which -a bd`). An older `bd` cannot open a migrated database. ## Migrate the Beads schema Skip this section if your city was already running `bd` 1.3.0 or newer. Beads 1.3 moves the database schema from v53 to v66. `bd` migrates a store it runs itself automatically, but a city's databases live on the Dolt server Gas City manages. `bd` treats that server as shared, because other clients may still be running an older `bd`, so it waits for you to ask by name. Until you do, `bd` refuses every write, and most reads fail too: `bd list`, `bd show` and `bd ready` stop with `table not found: leases`. Gas City does not run this migration for you. The city and each rig have their own database, so migrate each one. Start the city's Dolt server without its agents, migrate, then start the city: ```bash theme={"dark"} cd ~/my-city gc dolt restart # Dolt only; no agents yet gc dolt status # Dolt server: running (managed, …) gc bd --city ~/my-city migrate schema # the city's own database gc bd --rig my-project migrate schema # repeat for each rig ``` Use `gc dolt restart` here: `gc stop` removes the Dolt runtime state that `gc dolt start` needs, so `gc dolt start` fails on a stopped city. Each run prints a warning that it is applying the pending schema migrations to a shared server database and that older `bd` clients will refuse the database, then `✓ Schema already at v66`. The last line says "already" even on the run that migrates, because `bd` applies the migrations as it opens the database. Once every `bd` is upgraded, the warning needs no action. > [!NOTE] > > If `bd` refuses the migration because the database has a Dolt remote, the > remote's other clones must not migrate on their own. Run > `gc bd --rig my-project migrate schema --force` from one machine only, then > push the result with `gc bd --rig my-project dolt push` so the other clones > can pull it. > > If you start the city before migrating, `gc start` fails with > `city failed to start: … table not found: leases`, but it leaves Dolt running > and the city registered. Run the two `migrate schema` commands; the supervisor > retries and the city comes up on its own, with no second `gc start`. ## Start the city and check it ```bash theme={"dark"} gc start ~/my-city gc doctor ``` `gc start` registers the city with the supervisor again. If the supervisor is still running the old binary, `gc start` restarts it on the new one. `gc doctor` reports anything left to repair; `gc doctor --fix` applies the fixes it can make safely, such as renaming an `[imports.gascity]` pack import to `[imports.gc]`. A `✗ beads-store` or `✗ rig::beads` failure that mentions `leases` means that scope still needs `migrate schema`. Then repair blocked flags. A Beads 1.3 schema migration can mark beads as blocked when they are not, which hides them from `bd ready` and stops Gas City dispatching them ([beads#7037](https://github.com/gastownhall/beads/issues/7037)). Any database that has migrated to Beads 1.3, whether during this upgrade or when it first ran `bd` 1.3.0, can carry the bad flags. The repair recomputes them from the dependency graph and is safe to run on any database: ```bash theme={"dark"} gc bd --city ~/my-city recompute-blocked gc bd --rig my-project recompute-blocked # repeat for each rig ``` Each run reports how many rows it corrected, or `is_blocked already consistent — nothing to recompute.` ## Your city's storage stays as it was New cities are created split: `gc init` writes a `[storage]` section that keeps work in the work ledger and puts sessions, mail, workflow steps, order runs and queued nudges in a local store under `.gc/store`. An upgrade never adds that section to an existing city, so a city created before it keeps every bead in its work ledger and runs as it did. To move an existing city's infrastructure beads onto their own store, follow [Move a City's Infrastructure Classes onto Their Own Store](/runbooks/split-storage-classes): author the section, rehearse with `gc storage preflight`, stop the city, run `gc storage migrate --from-work --fleet-stopped`, then start it again. ## Optional: hand the city's Dolt process to Beads New cities run a Dolt store that `bd` owns. An upgraded city keeps its Gas City–managed Dolt server and keeps working on it. Moving it to the `bd`-owned topology is optional, is a separate step, and **cannot be reversed**, so take a fresh backup first and finish the schema migration above before you start. `gc beads city migrate-proxied` performs the move; the [migration runbook](https://github.com/gastownhall/gascity/blob/main/engdocs/runbooks/beads-migrate-proxied.md) covers the procedure, what it refuses, and how to verify it. # Coming from Coding Agents Source: https://docs.gascity.com/guides/capabilities-for-coding-agent-users How context, state, skills, history, messaging, roles, and identity work in Gas City — mapped to what you already know from coding agents. You know these capabilities from coding agents (Claude Code, Codex, Gemini CLI, Cursor, …) as features of a single agent. In Gas City they are infrastructure shared across many agents. Here is the quick map, ordered from the most basic to the most multi-agent. | Capability | Coding agents (Claude Code, Codex, …) | Gas City | | - | - | - | | Context | The window you fill: `CLAUDE.md`, open files, chat, … | An agent role, plus injected work items and mail (all beads) | | State | The context window; persist by hand to files | **Beads** — durable, queried live | | Skills | A `.claude/skills//` directory | The same directory, shared by scope (whole city, or one role) | | History | Recorded session transcripts (resumable) + manual hand-off notes | Bead history + per-session logs + a city-wide event log | | Messaging | None between distinct agent sessions; at most a communication mechanism between subagents in the same session | **Mail** (a bead) + **nudge** (wake a live session) | | Roles | A subagent file (`.claude/agents/.md`) | An agent folder (`agents//`) | | Identity | The one session you're in | A stable name per running agent (`hello-world/pack.worker_furiosa`, …) | The rest of this page is one delta per capability — what changes when the single-agent feature becomes shared infrastructure. ![Agents coordinate only through the store: mayor, reviewer, and worker each read and write the shared bead store (slinging work, claiming ready work, mailing a bead) — no arrow connects two agents directly. A nudge can wake a live session, but the work itself only ever moves through beads.](https://mintcdn.com/gascityinc-5c0069dd/-7xr7u3wfBmX5XrM/diagrams/excalidraw-rendered/coordination-through-store.svg?fit=max\&auto=format\&n=-7xr7u3wfBmX5XrM\&q=85\&s=712e9f260fac9cee4120eda9e48f2b1d) ## Context The window is seeded automatically, per agent, from durable sources — you never hand-assemble it. * It starts from the agent's **role**: a prompt template rendered with deployment data (city, rig, working directory, branch, custom variables). * Its current **work items** and **mail** — all [beads](/tutorials/06-beads) — flow in live as it works. ## State Durable state is first-class, not something you persist by hand. Everything is a [**bead**](/tutorials/06-beads): a stored work item with status, labels, relationships, and metadata, queried live (`bd`, `gc`) — never tracked in status or lock files that go stale on a crash. Sessions come and go; the beads remain. ## Skills You author a skill once at a scope, and Gas City materializes it to every eligible agent — no per-agent allow-lists, and the model decides when a skill applies. * Pick the scope: * `skills//` at **pack level** → shared with **every** agent in the city. * `agents//skills//` at **role level** → only agents of that role (and all its pooled instances). On a name collision, the role-local skill wins. * At startup Gas City **symlinks** the pack level and role level skill directories into each agent's provider-specific skill sink — `.claude/skills/`, `.agents/skills/` (codex), `.gemini/skills/`, `.opencode/skills/`. List with `gc skill list`. * It *places* the files into each provider's own convention; it doesn't translate them. Providers whose convention isn't confirmed (copilot, cursor, pi, omp) are skipped for now. * No framework *around* skills: no per-agent allow-lists. Within a scope every eligible agent gets every skill; the model decides when one applies. * MCP is list-only today (`gc mcp list` shows what's catalogued; you wire the servers yourself). ## History History is structured and queryable across every agent, not per-session files you manage yourself. | Layer | What it records | Read with | | - | - | - | | **Bead history** | Each work item's create → update → close trail, independent of any session — the durable memory of *what was done* | `bd`, `gc` | | **Session logs** | One agent's conversation: your prompts, the model's replies, its tool calls | `gc session logs ` (`-f` to follow) | | **Event log** | An append-only, city-wide feed of system activity (sessions waking, mail sent, work created) | `gc events` | ## Messaging Agents that share no session still communicate, over two channels. | Channel | Durable? | What it is | Send with | | - | - | - | - | | **Mail** | Yes — a [bead](/tutorials/06-beads) (type `message`) | Sender, recipient, subject, body; threads and waits in an inbox until read. Agents typically pull new mail into context each turn via a hook | `gc mail` | | **Nudge** | No | A direct poke into a live session — text typed straight into a running agent to wake or redirect it now | `gc session nudge "msg"` | ## Roles A role is a folder, not a single subagent file. `agents//` holds an `agent.toml` (provider, pool, timeouts) and a `prompt.template.md` defining what that *kind* of agent does. ## Identity A specific running instance has a stable name you can address — across restarts. * Each live agent has a deterministic session name (e.g. `hello-world/pack.worker_furiosa`), so you and other agents can message, wake, peek at, and resume exactly that one. * One role instantiates into many identities (a pool of `worker_furiosa`, `worker_nux`, …). See them with `gc session list`. * Role (the kind), identity (the running instance), and pool (the set) are all facets of the single **Agent** primitive — see [the six primitives](/getting-started/how-gas-city-works). ## See also * [The six primitives](/getting-started/how-gas-city-works) — the canonical model; start here. * [Coming from Gas Town](/getting-started/coming-from-gastown) * [Tutorial 04: Communication](/tutorials/04-communication) — mail and nudge. * [Config Reference](/reference/config) # Configuring an Agent Source: https://docs.gascity.com/guides/configuring-an-agent The five axes of an agent — harness, model, upstream, transport, runtime — and how to set each in city.toml / agent.toml. The [Agents tutorial](/tutorials/02-agents) shows the fast path: drop an `agent.toml` with a `provider` and a prompt, and sling work to it. This guide is the how-to reference for everything you can tune underneath that — the **five independent axes** of an agent — with a deep dive on the **upstream** axis (who serves the model), which is the newest knob. For the exact field list and types, see the generated [Config Reference](/reference/config). This guide explains *how the pieces fit*; the reference is the authoritative spec. ## The five axes An agent is the composition of five orthogonal choices. You set each one independently — change the model without touching the harness, switch who serves the model without changing the box, and so on. | Axis | Question | Where you set it | Example | | - | - | - | - | | **Harness** | which agent CLI? | agent `provider` | `provider = "claude"` | | **Model** | which model label? | agent `option_defaults.model` | `option_defaults = { model = "sonnet", effort = "low" }` | | **Upstream** | who serves the model? | agent `upstream` + `[upstreams.]` | `upstream = "bedrock"` | | **Transport** | how does gc drive it? | agent `session` | `session = "acp"` | | **Runtime** | where does it run? | city `[session] provider` / `GC_SESSION` | `provider = "k8s"` | > **A note on the word "provider."** It is overloaded by history. In an > `[[agent]]` / `agent.toml` block, `provider` selects the **harness** (the agent > CLI — `claude`, `codex`, …). In the city `[session]` block, `provider` selects > the **runtime backend** (where sessions run — `tmux`, `k8s`, …). They are > different axes; this guide always says "harness" or "runtime" to disambiguate. The first three axes (harness, model, upstream) are per-agent. Transport is per-agent. Runtime is city-/environment-wide (every session in a city runs on the same backend). ## Axis 1 — Harness (`provider`) The harness is the agent CLI gc launches and drives. Gas City ships built-in presets for the popular ones — `claude`, `codex`, `gemini`, `grok`, `kimi`, `cursor`, `copilot`, `amp`, `opencode`, and more — so the minimal agent is just: ```toml theme={"dark"} # agents/reviewer/agent.toml dir = "my-project" provider = "codex" ``` Each preset defines the command, default args, resume behavior, prompt delivery, and the model + upstream contracts (below). Customize one with a city-level `[providers.]` block: a same-named block merges over the built-in (you set only what you change), and a differently-named one can inherit from any provider via `base`: ```toml theme={"dark"} # city.toml — customize the built-in claude harness [providers.claude] args = ["--verbose"] # everything else inherits from builtin:claude # …or define a new harness that inherits from a built-in [providers.claude-fast] base = "builtin:claude" option_defaults = { model = "haiku" } ``` When `command` points to a launcher wrapper, also set `resume_command` to invoke that wrapper with the harness's resume arguments and `{{.SessionKey}}`. The inherited resume command is a separate setting; changing `command` alone can leave resumed sessions launching the original executable. If a wrapper redirects the harness to a private configuration directory, prepare required startup state in that directory too. Verify a fresh interactive launch as well as resume: a non-interactive prompt can skip first-run screens that would block an interactive agent. Keep wrapper diagnostics out of the interactive terminal so they cannot overwrite startup menu options. Match `process_names` to the executable actually running inside the wrapper, and verify that Gas City still reports the agent alive after startup and while it claims work. For copy-paste setup of each built-in harness — the env vars it reads and the direct / custom-endpoint / model permutations — see [Harness Recipes](/guides/harness-recipes). See [Understanding Packs](/guides/understanding-packs) for shipping a harness preset as a reusable pack. ## Axis 2 — Model (`option_defaults.model`) A harness exposes its configurable knobs through an **options schema**. The `model` option is the common one; selecting a value injects the right CLI flags for that harness — you pick an abstract label, the harness renders the flag. ```toml theme={"dark"} # agents/reviewer/agent.toml provider = "claude" option_defaults = { model = "sonnet", permission_mode = "plan" } ``` `option_defaults` is a map of option key → choice value. The provider's `options_schema` declares the allowed choices and the `flag_args` each one emits (see `ProviderOption` / `OptionChoice` in the [reference](/reference/config)). This is why you write `model = "sonnet"` and not a raw `--model` flag: the schema keeps the model selection portable and the flags server-side. `model` is not an agent field of its own: set it with `option_defaults` (a `--model` flag in `args` works too). A top-level `model = "sonnet"` in `agent.toml` is ignored without a warning. In a legacy city's `city.toml` `[[agent]]` block it is an unknown field: `gc config show` warns about it and `gc start --foreground` refuses to start. ### Reasoning effort (`option_defaults.effort`) `effort` is an options-schema key like `model`. Its tiers are `low · medium · high · xhigh · max`, and the harness renders the matching flag (for `claude`, `--effort `). The builtin `claude` harness defaults to `permission_mode = "unrestricted"` (`--dangerously-skip-permissions`) and `effort = "max"` (`--effort max`), so set `effort` explicitly when you want cheaper, faster turns. Three places set it: ```toml theme={"dark"} # city.toml — every agent on the claude harness [providers.claude] base = "builtin:claude" option_defaults = { effort = "high", model = "sonnet" } ``` ```toml theme={"dark"} # agents/reviewer/agent.toml — one agent provider = "claude" option_defaults = { effort = "low" } ``` ```toml theme={"dark"} # city.toml — one agent you don't own, such as one from an imported pack [[patches.agent]] name = "mypack.planner" # . option_defaults = { effort = "medium" } ``` Agent keys win over provider keys, so the reviewer above runs at `low` while other claude agents run at `high`, and a patch's keys merge into the agent's own. A patch needs `name` and targets that one agent (`rig = "*"` reaches it in every rig); there is no wildcard for all agents, so use `[providers.claude]` for a city-wide default. Set `effort = ""` to launch without an `--effort` flag at all, leaving the choice to Claude Code. An agent's `args` can select an option too: `args = ["--effort", "high"]` launches at `high`, ahead of any `option_defaults`. An agent's `args` replace the provider's `args`. `gc config explain --provider claude` shows the provider-level resolved value and which layer set it; it does not include agent-level `option_defaults`, so an agent's own `effort` is read from its `agent.toml`. A single step can override these for the session launched to run it: `opt_effort` or `opt_model` metadata on the step's bead applies when that session launches (see [per-dispatch provider options](/reference/specs/formula-spec-v2)). The options are launch flags, so they stay with the session rather than the step: a warm session that runs a later step, or a pool slot that claims a different ready bead than the one it launched for, keeps the flags it launched with. Give steps that need different options their own agent or pool, or set the same options on every step that shares a pool or a `gc.continuation_group`. ## Axis 3 — Upstream (who serves the model) **This is the newest axis.** The *model* is *what* you ask for; the *upstream* is *who serves and resolves it* — direct Anthropic, Bedrock, Vertex, a self-run proxy, an OpenAI-compatible gateway. Switching upstream changes the base URL and credentials the harness talks to, **without changing the model, the harness, or the box** — and (post-un-weld) without re-provisioning: it relaunches the agent in the warm box. ### Declare an upstream, select it Upstreams are named presets at the city level; an agent selects one by name. ```toml theme={"dark"} # city.toml [upstreams.bedrock] description = "Anthropic models via AWS Bedrock" base_url = "https://bedrock.example.com/anthropic" api_key = "$AWS_BEDROCK_KEY" # a $VAR ref — never inline a secret [agent_defaults] upstream = "bedrock" # city-wide default for every agent ``` ```toml theme={"dark"} # agents/reviewer/agent.toml — this agent overrides the default upstream = "anthropic-direct" ``` Resolution order for an agent's upstream: agent `upstream` → `agent_defaults.upstream` → unset (no upstream env injected; the harness uses whatever is ambient). ### Abstract vs. raw — and why abstract is portable An upstream can be written two ways, which compose: **Abstract (portable).** `base_url`, `api_key`, and `auth_token` are **harness-agnostic**. The resolver renders them onto *that harness's* env-var names, declared by the harness as its `upstream_env` binding. So one upstream works on any harness: ```toml theme={"dark"} [upstreams.bedrock] base_url = "https://bedrock.example.com/anthropic" api_key = "$AWS_BEDROCK_KEY" ``` * on a `claude` agent → `ANTHROPIC_BASE_URL` + `ANTHROPIC_API_KEY` * on a `codex` agent → `OPENAI_BASE_URL` + `OPENAI_API_KEY` The built-in harnesses ship their bindings out of the box (claude → `ANTHROPIC_*`, codex → `OPENAI_*`, gemini → `GOOGLE_GEMINI_BASE_URL`/`GEMINI_API_KEY`, and so on). A custom harness declares its own: ```toml theme={"dark"} [providers.myharness.upstream_env] base_url = "MYHARNESS_BASE_URL" api_key = "MYHARNESS_API_KEY" ``` > An abstract field with **no** matching harness binding (and no override, below) > is a **hard error**, never a silent no-op — you find out at resolution time, > not when the agent quietly talks to the wrong endpoint. **Raw (escape hatch).** When the abstract trio doesn't cover what a harness needs, set raw env keys with `env`. They merge **after** the abstract render, so they win: ```toml theme={"dark"} [upstreams.bedrock] base_url = "https://bedrock.example.com/anthropic" api_key = "$AWS_BEDROCK_KEY" [upstreams.bedrock.env] AWS_REGION = "us-east-1" CLAUDE_CODE_USE_BEDROCK = "1" ``` ### Gateway harnesses — the per-field override Some harnesses are **gateways**: one CLI (e.g. `opencode`) fronts many upstreams whose credential env var is *upstream-dependent* (`GROQ_API_KEY` for Groq, `CEREBRAS_API_KEY` for Cerebras, …). Such a harness has no single binding to declare. The upstream names its own target with the per-field `*_env` overrides: ```toml theme={"dark"} [upstreams.groq] api_key = "$GROQ_KEY" api_key_env = "GROQ_API_KEY" # this upstream renders api_key to GROQ_API_KEY ``` Per-field precedence is: **upstream `*_env` override → harness binding → hard error.** Native single-upstream harnesses stay fully abstract via their binding; gateways supply the name themselves. ### Secrets and fingerprints * **Secrets are never inlined.** Abstract and raw values may reference controller env vars with `$VAR` / `${VAR}`, expanded at resolution — so `api_key = "$ANTHROPIC_API_KEY"` keeps the secret out of `city.toml`. * **Switching the upstream name** relaunches the agent in the warm box (it is a launch-half fingerprint change). **Rotating the key** within the same upstream moves no fingerprint — the resolved serving env is excluded from the hash, so a credential rotation never churns live sessions. ## Axis 4 — Transport (`session`) The transport is *how* gc drives the harness. The default is **tmux** (gc sends keystrokes and captures the pane). Set `session = "acp"` to drive the harness over the [Agent Client Protocol](/reference/exec-session-provider) (JSON-RPC over stdio) instead — the harness's resolved provider must declare `supports_acp = true`. ```toml theme={"dark"} # agents/reviewer/agent.toml provider = "claude" session = "acp" # drive over ACP instead of tmux ``` ## Axis 5 — Runtime (where it runs) The runtime is *where* the session's box lives. It is selected city-wide via the `[session]` block (or the `GC_SESSION` environment variable), not per-agent: ```toml theme={"dark"} # city.toml [session] provider = "k8s" # run every session in a Kubernetes pod ``` Built-in runtime backends: `tmux` (local, default), `subprocess` (local, headless), `k8s` (pods), `ssh:user@host` (a remote box over SSH), and `exec: