Skip to content
stage

Agents that queue work

Agents running in T3 or OpenCode can plan follow-up work in Stage: add tasks, build trees, and record what they learned in journals. They use the stage CLI by default, or MCP. Stage never lets an agent complete its own task, and tells it to complete others only when you ask.

Set up each machine

Every Stage install puts stage on your PATH. On each machine where your agents run (the server's, or a worker's):

Run setup

stage setup

It finds Claude Code, Codex and OpenCode and installs, for each one:

  • The Stage skill, which teaches the CLI and the workflow. It loads only when a session works with Stage.
  • An instruction pointer, a two-line block in ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md naming the skill and stage guide.

Optional: register MCP

stage setup --mcp      # also register stdio MCP with Claude Code and Codex

The CLI costs no context until used, while a registered MCP server loads every tool schema into every session. For OpenCode, register Stage with its own command:

opencode mcp add stage -- stage mcp

Check

stage setup --check    # CLI on PATH, server, caller detection, per-agent skill and MCP

Every task Stage launches tells the agent how to reach Stage and use its journal. On shared Stage, local agents get the private agent socket and remote agents get their worker's private socket. Use a separate agent credential when an integration connects over the network.

From inside an agent session

These are the commands an agent runs. You ask in plain words ("queue a follow-up to write the docs after this"); the skill teaches the agent which command fits.

See where it is

stage context

Shows the calling session, its working directory and the Stage project it resolves to. The CLI detects the session from the harness on its own.

Add a task

stage projects ls --json
stage task add --title "Fix flaky test" --prompt "..." --connection 2 --workspace-id "$WORKSPACE_ID"

Set WORKSPACE_ID to the selector for the intended workspace on connection 2. The task lands in the backlog. Add --start to launch it right away.

Run it after this session

stage task add --title "Deploy" --prompt-file deploy.md --connection 2 --workspace-id "$WORKSPACE_ID" --after-me

--after-me tracks the calling session as a task and makes it the new task's first need, so the new task waits until you complete this session's task.

Build a tree

stage tree new --title "Auth" 41 43:41 42:43           # 43 needs 41, 42 needs 43
stage task add --title "Docs" --prompt "..." --connection 2 --workspace-id "$WORKSPACE_ID" --needs 42 --start-mode manual

ID:NEED,NEED lists what each task needs. --needs adds a new task to the tree of the tasks it needs.

Write journal notes

stage task notes 42 add --text "Chose cookie sessions" --category decision
stage tree notes 7 add --text "API shape agreed" --source-task 42

Progress goes on the task, shared conclusions on the tree. Categories are optional: finding, decision, blocker, outcome.

Wait for a task

stage task wait 42 --until done --timeout 30m   # exit 3 on timeout

Next steps