Quickstart — Run durable software Work
Sagewai's primary path is a Work control plane for safely coordinating Codex and Claude. A software goal becomes a project-scoped WorkItem and versioned WorkContract. Codex performs write stages, Claude performs independent analysis and review, and deterministic verification runs before completion. Events, evidence, assumptions, gates, and stage results are persisted outside either model's session.
This quickstart uses local execution. No deployment platform is involved: an uncontracted successful run ends at a verified repository outcome.
Prerequisites
- Python 3.10 or later (
uvis recommended). - A Git repository with a deterministic
just smokerecipe. Sagewai loadsAGENTS.mdwhen the repository provides it. - Docker available for isolated verification.
- The native
codexandclaudeCLIs installed and authenticated on this machine. Sagewai reuses their local authentication; it does not ask you to submit those credentials to the control plane. - An immutable, digest-pinned verification image containing
just,uv, and the repository's locked test dependencies. Verification has no host fallback and runs with no network or inherited credentials.
1. Install Sagewai
Install into an isolated environment:
uv venv && uv pip install sagewai
# Or from a platform checkout:
# just bootstrap
sagewai --version
codex --version
claude --version
Select the verification image maintained for the repository:
export SAGEWAI_WORK_VERIFICATION_IMAGE='registry.example/verifier@sha256:<digest>'
The default software verification command is just smoke. The image must
already contain everything that command needs because verification is
networkless. See the repository's DEVELOPMENT.md for the complete isolation
contract.
2. Start local Work
Run from the Git repository Sagewai should change. Every command requires an
exact project slug; use global only when the Work is intentionally
organization-global.
cd /path/to/repository
sagewai work --project my-project start \
"Add the bounded change, its tests, and no unrelated refactor"
start runs the software profile through analysis, contract acceptance,
implementation, verification, independent review, and bounded repair when
needed. It prints the durable Work ID and current status. The accepted contract,
Evidence Board references, operator receipts, and repository evidence remain
queryable after either model exits.
The initial description is a goal, not permission to edit everything. The analysis stage must produce a surgical scope and acceptance criteria before a write stage can proceed.
3. Inspect and resume canonical state
Replace WORK_ID with the value printed by start:
sagewai work --project my-project status WORK_ID
sagewai work --project my-project pending
sagewai work --project my-project resume WORK_ID
statusreads the canonical persisted Work record.pendinglists only attention for the named project, including blocked questions, approval gates, and degraded-control conditions.resumecontinues only unfinished stages. It does not depend on a Codex or Claude chat session and does not rerun a completed implementation merely because a later remote operation failed.
Use the same --project value for the complete lifecycle. Project omission is
an error, not an implicit global query.
4. Optional GitHub issue intake and approval
GitHub is an integration surface, not a second lifecycle store. For issue-based Work, provide a token authorized for the target repository and pass the issue URL:
export GITHUB_TOKEN=ghp_...
sagewai work --project my-project start \
https://github.com/OWNER/REPOSITORY/issues/123
The lifecycle records the issue, creates a pull request after verified implementation, and surfaces the exact merge gate through both GitHub and the canonical pending query:
sagewai work --project my-project pending
sagewai work --project my-project approve WORK_ID GATE_ID
sagewai work --project my-project resume WORK_ID
approve is a real authorization decision and may merge the named pull request.
Run it only when you intend to authorize that exact gate. With no delivery
extension in the WorkContract, a verified merged repository outcome completes
the Work; it does not deploy anything.
For minimal labeled intake, use one explicit label:
sagewai work --project my-project intake --label sagewai
The command starts at most one unseen issue from the oldest 100 open issues with that label. It is an invoked intake command, not a background poller or webhook.
5. Optional Fleet workers
Local execution is the default. Fleet is useful when Codex, Claude, or HarnessRuntime should run on separate machines. Each worker must be approved, scoped to the same project, started from a trusted checkout, and advertise only the runtime it can execute:
sagewai fleet run --name codex-worker --project my-project \
--capabilities runtime.codex,filesystem.write \
--work-repository /path/to/repository
sagewai fleet run --name claude-worker --project my-project \
--capabilities runtime.claude,filesystem.read \
--work-repository /path/to/repository
sagewai fleet run --name harness-worker --project my-project \
--capabilities runtime.harness,filesystem.write \
--work-repository /path/to/repository \
--harness-tier complex=localai:mlx-community/Mistral-7B-Instruct-v0.3 \
--harness-backend localai=http://127.0.0.1:8080/v1
Workers keep polling through gateway outages and exit only when the gateway
returns a terminal authentication error. A Task with no compatible online worker
waits with external attention and continues when one comes online.
Start or resume Work with Fleet selected explicitly:
sagewai work --project my-project \
--execution fleet --fleet-org ORG_ID \
start "Add the bounded change and tests"
The control plane persists Work state and dispatches credential-free stage payloads to compatible workers. Codex and Claude authentication and HarnessRuntime backend configuration stay on each worker. If a worker disappears, lease recovery can reassign the unfinished stage without erasing Work state or rerunning completed stages.
6. Work API, Tasks, and the Control Console
sagewai admin serve --port 8000 exposes the authenticated Work API. To run the
backend together with the responsive Work Control Console from a source
checkout, use just stack-up and open http://localhost:3008.
A fresh stack always begins at /setup. Complete the organization and admin
account wizard before using authenticated routes. There are no default
credentials, and the setup boundary is never skipped.
The CLI, API, and console read the same project-scoped canonical Work store and pending-attention query. The console adds active Work, timeline, evidence, operator activity, gates, degraded control, and Fleet status without becoming a second lifecycle owner.
The same stack serves the coordinator. http://localhost:3008/board is the Task board —
composer, five columns, and the Focus/Today/All views; /tasks/{id} is one Task's
thread, plan, actions, activity, telemetry and settings; /decisions is everything waiting on
you, Task attention and Work attention merged, decided and answered in place. The CLI
equivalents are sagewai task board, sagewai task thread, and sagewai task decisions, all
under a required --project — there is no organization-global Task scope.
What to read next
- Persistence — local SQLite and PostgreSQL-backed durable state.
- Fleet Architecture — worker enrollment, project isolation, heartbeats, and recovery.
- Admin Panel — first-time setup and authenticated administration.
- Architecture — runtime and security boundaries.
- The retained Minimal Setup, Agents, and Workflows pages cover lower-level SDK capabilities; they are not the primary Work lifecycle.