Skip to content
Stagent
A plugin for Claude Code·stagent@1.0.7

Workflows that finish.

A state machine for your Claude Code sessions.

01 · Plan with the AI

Quick start

01
Install the pluginIn your terminal.
claude plugin marketplace add jie-worldstatelabs/stagent && claude plugin install stagent@stagent
optionalOr update if already installed.
claude plugin marketplace update stagent && claude plugin update stagent@stagent
02
Try your first workflowbuild an app from scratch with the default workflow
optionalOptional but recommended — claim session ownership and better manage your past sessions.
/stagent:login
/stagent:start --flow=cloud://demo "Build a journaling app with MBTI insights inferred from journal entries"
03
Or create your own templateNatural language → template. See the cookbook for examples.
/stagent:create "A goal-driven loop that runs continuously until evaluation passes."
why Stagent

Control, watch, and resume every Claude run.

hooks + state.md + SSE
protocol
You drive the loop.
Your workflow.json is the contract. Stages, gates, artifacts — all declared by you. Every phase writes a report with an epoch and a result, so Claude never skips ahead or silently stalls.
workflow.json
the contract Claude executes
viewer
Browser-side eyes.
A live session page streams stage changes, artifacts, and the working-tree diff over SSE — no polling, no refresh. Share the URL with a teammate, or open it on your phone during the run.
https://stagent…/s/<id>
paste & watch
portable
Pick up from any box.
Session state lives on the server, not your laptop. Run /stagent:continue --session <id> on a different machine and the plugin hydrates the shadow, verifies the repo root commit, and keeps going.
/stagent:continue --session X
same repo, different laptop
Your own template

Create and publish your own template in minutes.

Describe it in natural language — Claude scaffolds workflow.json and the per-stage prompts. Push it to the hub under author/name, and anyone can pull it into Claude Code with a single flag.

--flow=cloud://author/name
state machine

Every stage is declared.
Nothing is implicit.

workflow.json is the single source of truth. The stop hook blocks session exit until the current stage’s artifact exists with a matching epoch and a valid result. On failure, the reviewer or QA stage loops back to executing — same contract, next epoch.

workflow.jsonexcerpt
{
  "initial_stage": "planning",
  "terminal_stages": ["complete"],
  "stages": {
    "planning":  { "interruptible": true,
                  "transitions": { "approved": "executing" } },
    "executing": { "execution": { "type": "subagent", "model": "opus" },
                  "transitions": { "done": "reviewing" } },
    "reviewing": { "transitions": { "PASS": "qa-ing",
                                    "FAIL": "executing" } },
    "qa-ing":    { "transitions": { "PASS": "complete",
                                    "FAIL": "executing" } }
  }
}

Stop babysitting your agent.

Define the loop once. Run it in any Claude Code session. Watch it finish in the browser.