Skip to main content
Slinging work to agents creates sessions — live agent processes you haven’t seen yet. This tutorial shows you how to watch and talk to them. A session comes in two flavors: A pack might give these flavors its own role names, but those are pack configuration, not Gas City concepts. The underlying primitive is the session. This tutorial continues from the city the last two left off with: pack.toml and city.toml at the root, plus the reviewer Tutorial 02 added under agents/reviewer/.
The city’s machine-local identity and the rig’s path binding now live in .gc/site.toml instead:
The reviewer’s prompt lives at agents/reviewer/prompt.template.md. This is the standard city shape: root config files plus per-agent directories under agents/.

Looking in on an on-demand session

Every provider — Claude, Codex, Gemini — manages conversations its own way. Gas City normalizes all of that behind the session: a live process with its own terminal, state, and conversation history. Slinging a bead to an agent that isn’t running creates a session. To inspect a live one, look up its ID with gc session list, then pass that to gc session peek. (If the reviewer already finished Tutorial 02’s review and its session was cleaned up, sling the same review work again for a fresh live session to watch.)
The peek shows the reviewer’s prompt — the output of gc prime — landing as the first input to the codex CLI. That’s how GC tells Codex how to act. Codex then claims a ready bead, executes it, and produces review.md. When the work runs out, the agent goes idle and the GC supervisor shuts its session down. That’s the on-demand default: an agent with no always-on declaration executes beads, goes idle, and is cleaned up. You could chat with one while it’s alive, but it won’t stick around for you. For an agent that’s always there to talk to, you want an always-on session, declared by the local pack.

Chatting over an always-on session

gc session list shows both flavors side by side — the reviewer mid-work, and the mayor up for ten hours:
The reviewer will go idle and be shut down once its work is done. The mayor has been up since the city started, yet nobody has chatted with it — is it burning tokens? Peek says no:
Idle but not shut down. The mayor survives because the local pack — your pack.toml, the root pack that imports the others — declares an always-on named session for it:
That mode="always" keeps the session running so the mayor is always around to chat, plan, or receive work. Any agent the local pack (or a pack it imports) declares this way gets the same treatment; everything else runs on demand. To talk to the mayor — or any agent in a running session — attach to it:
And as soon as you do, you’ll be dropped into a tmux session: mayor session screenshot You’re in a live conversation. The agent responds just like any chat-based coding assistant, but with the full context of its prompt template. To detach without killing the session, press Ctrl-b d (the standard tmux detach). The session keeps running in the background. You can reattach anytime. You can also reach a running session without attaching. Besides peeking, you can nudge it — type a new message into its terminal:
mayor nudge screenshot Confirm the session remains available after the nudge:

Session logs

Peek shows the last few lines of terminal output. Logs show the full conversation history:
--tail N prints the last N transcript entries (same convention as tail -n), so --tail 2 shows the most recent prompt and reply. Use --tail 0 for the whole conversation. Follow live output with -f:
Now nudge the mayor from another terminal:
The follow stream prints the exchange as it arrives — handy for watching a background agent without attaching and risking an interruption.
A compact-boundary divider counts as an entry if one lands inside the final window. As of 1.0, --tail counts displayed transcript entries; before 1.0 it counted compaction segments. The HTTP API’s tail query parameter still counts compaction segments.

What’s next

You’ve created sessions on demand, kept the mayor alive with an always-on [[named_session]], and used peek, attach, nudge, and logs to watch and talk to agents. From here:
  • The six primitives — the canonical model the session and these mechanisms build on
  • Agent-to-Agent Communication — how agents coordinate through mail, slung work, and hooks
  • Formulas — how multi-step work should be done: steps, dependencies, and variables
  • Beads — the work tracking system underneath it all
Last modified on September 2, 2026