A Claude Code plugin that runs config-driven development workflows as a state machine. You declare stages, transitions, and inputs in a single workflow.json; the plugin's hooks and scripts drive the loop.
FAQ
stagent is a Claude Code plugin with 3 hand-picked skills for automation work, indexed on Flowy. Install it with the command on its page. It includes create-workflow, stagent-setup, stagent. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add jie-worldstatelabs/stagent> /plugin install stagent@stagent
Repo: jie-worldstatelabs/stagent
English | ็ฎไฝไธญๆ | ๆฅๆฌ่ช | ํ๊ตญ์ด | Franรงais | Deutsch | Espaรฑol
A Claude Code plugin that runs config-driven development workflows as a state machine. You declare stages, transitions, and inputs in a single workflow.json; the plugin's hooks and scripts drive the loop.
Two modes:
<project>/.stagent/, no network.Run this command
claude plugin marketplace add jie-worldstatelabs/stagent && claude plugin install stagent@stagent
Already installed? Update with:
claude plugin marketplace update stagent && claude plugin update stagent@stagent
Requires: Claude Code, jq, curl, git (cloud mode also relies on standard POSIX tools like sha256sum / shasum).
Optional but recommended: sign in first to claim session ownership and better manage your past sessions.
/stagent:login
Start the default development workflow โ it builds what you describe:
/stagent:start --flow=cloud://demo "Build a journaling app with MBTI insights inferred from journal entries"
The skill prints a live UI URL. Without sign-in, this is an anonymous, publicly viewable session โ anyone with the link can watch the state machine run in real time (stage timeline, rendered artifacts, git diff baseline..HEAD updating via SSE), and there is no owner.
For a fully offline run, switch to local mode:
/stagent:start --mode=local "Build a journaling app with MBTI insights inferred from journal entries"
Define your own workflow from a natural-language prompt โ stagent scaffolds the stages:
/stagent:create "plan, implement, critique & score UX"
This defaults to cloud mode: the new template is published to your hub account after the planning + writing stages finish. Sign in first if you haven't already:
/stagent:login
For a fully offline run (template stays on disk under ~/.config/stagent/workflows/<name>/, nothing pushed to the hub), switch to local mode:
/stagent:create --mode=local "plan, implement, critique & score UX"
Need inspiration? Browse the cookbook for twelve battle-tested workflow templates you can fork or remix.
With no --flow flag:
cloud://demo from the hub โ a hosted template that may evolve independently of this READMEskills/stagent/workflow/ (offline fallback) โ the canonical source for the cycle described belowThe bundled workflow runs a plan โ execute โ review โ QA โ deploy cycle:
baseline git SHA captured at workflow start. PASS โ QA; FAIL โ loop back to Execute.vercel whoami, vercel link on first run, sync production env vars, vercel --prod, smoke-check the URL. Interruptible because first-run setup may need vercel login in another terminal or env-var values from you. Done โ terminal complete.The execute โ review โ QA loop runs autonomously after you approve the plan. A Stop hook guarantees the loop runs to completion (until QA passes; deploy then runs as the final, interruptible stage). The loop stops on one of: deploy completes (terminal complete), max_epoch is hit (default 20, configured in workflow.json โ .max_epoch; breaks runaway iteration by forcing terminal escalated), or you intervene with /stagent:interrupt (pauses) or /stagent:cancel (terminal cancelled). All three โ complete, escalated, cancelled โ are declared in workflow.json โ .terminal_stages.
The plugin is generic โ any stage shape works as long as it follows the schema. Running /stagent:create (see Quick Start) dispatches an internal stagent that interviews you, writes workflow.json + per-stage instruction files under ~/.config/stagent/workflows/<name>/, validates them in a retry loop, and publishes the bundle to the hub (cloud mode only). Reuse it with:
/stagent:start --flow=cloud://<you>/<name> <task>
See ARCHITECTURE.md for the workflow.json schema.
Need ideas for what to turn into a workflow? See the cookbook โ twelve ready-to-run workflows for common Claude Code failure modes (goal pursuit, research-first, end-to-end v1, scope lock-down, invariant guardrails, root-cause forced, real bug hunt, strict TDD, real-journey suite, visual QA gate, perf gate, compliance gate), each launchable with /stagent:start --flow=cloud://....
| Command | Purpose |
|---|---|
/stagent:start [--mode=cloud|local] [--flow=<ref>] <task> | Start a new run |
/stagent:interrupt | Pause the active run without clearing state (can be called mid-stage; resume with /stagent:continue) |
/stagent:continue [--session <id>] | Resume an interrupted run (--session for cross-machine cloud takeover) |
/stagent:cancel [--hard] | Cancel the run. Default archives; --hard hard-deletes. Local-mode files are archived/removed accordingly; in cloud mode the local shadow is wiped either way and the difference is only on the server (archived vs hard-deleted) |
/stagent:create [--mode=cloud|local] [--flow=<ref>] <description> | Create a new workflow or edit an existing one |
/stagent:publish <dir> [--name <n>] [--description <d>] [--dry-run] | Publish a local workflow to the hub |
/stagent:login / :logout / :whoami | Manage your hub identity |
--flow=<ref> accepts:
cloud://demo from the hub; local mode uses the plugin-bundled workflowcloud://author/name โ fetched from the hub (cloud mode)/abs/path or ./rel/path โ local workflow directory<bare-name> โ resolved against the plugin-bundled workflows first, then cloud://<bare-name> on the hubEnv vars:
| Variable | Default | Effect |
|---|---|---|
STAGENT_DEFAULT_MODE | cloud | Set to local to flip the default for every run in the shell |
| Concern | Local | Cloud |
|---|---|---|
| Authoritative state | <project>/.stagent/<session>/state.md | Postgres sessions row; local shadow mirrors |
| Where the files live on your disk | Project worktree | ~/.cache/stagent/sessions/<session>/ โ wiped on terminal |
| Live viewer | None โ read the files | https://stagent.worldstatelabs.com/s/<session_id> |
| Cross-machine continue | Not supported | /stagent:continue --session <id> with project-fingerprint verification |
.gitignore entry needed | echo '/.stagent/' >> .gitignore | None |
/stagent:continue --session <id> mirrors the workflow's state (state.md, stage reports, plus the baseline run-file โ the git SHA captured at workflow start) to the new machine. It does not copy the project's source code. Code lives in your git repo, not in the plugin.
continue-workflow.sh verifies:
last_seen_head in state.md, updated on every stage transition and on /interrupt). A behind / diverged HEAD is a hard block unless --force-project-mismatch is passed โ the resumed stage would otherwise run against stale code and re-do or contradict finished work.If the original session committed its subagent work before interrupting, git fetch && git checkout <last_seen_head> (or merge that branch) on the new machine brings you in sync before /continue.
workflow.json. Adding a stage or changing a transition is a config edit, not a code change.workflow-subagent; the per-stage protocol lives in <workflow-dir>/<stage>.md, which the subagent reads at runtime. No per-stage subagent_type field.update-status.sh refuses to move into a stage if any required input artifact is missing. State-machine-level enforcement.state.md โ stale artifacts from previous iterations are ignored./exit, window close), stagent's SessionEnd hook flips the active workflow to interrupted so another Claude session can pick it up via /stagent:continue. Crashes / kill -9 don't trigger this; in cloud mode, server-side stale detection is the backstop.See ARCHITECTURE.md for:
workflow.json schema referenceMIT
.claude/
.claude-plugin/
marketplace.json
plugin.json
scheduled_tasks.lock
.gitignore
agents/
workflow-subagent.md
ARCHITECTURE.md
commands/
cancel.md
continue.md
create.md
interrupt.md
login.md
logout.md
publish.md
start.md
whoami.md
docs/
claude-code-cookbook.md
hooks/
activity-hook.sh
agent-guard.sh
agent-ledger-add.sh
agent-ledger-remove.sh
ask-user-question-hook.sh
hooks.json
notification-hook.sh
plugin-path-rewrite.sh
postwrite-hook.sh
session-end.sh
session-start.sh
stop-hook.sh
user-prompt-submit.sh
package.json
README.de.md
README.es.md
README.fr.md
README.ja.md
README.ko.md
README.md
README.zh-CN.md
scripts/
cancel-workflow.sh
check-workflow-ownership.sh
continue-workflow.sh
interrupt-workflow.sh
lib.sh
login-workflow.sh
logout-workflow.sh
loop-tick.sh
next-status.sh
parse-workflow-flags.sh
print-create-banner.sh
print-start-banner.sh
publish-workflow.sh
setup-workflow.sh
stage-context.sh
subagent-bootstrap.sh
update-status.sh
whoami-workflow.sh
skills/
create-workflow/
SKILL.md
workflow/
final_review.md
planning.md
publishing.md
readme.md
run_files_catalog.md
schema-cheatsheet.md
validating.md
workflow.json
writing.md
stagent/
stagent-setup/
SKILL.md
SKILL.md
workflow/
deploy.md
executing.md
planning.md
qa-ing.md
readme.md
reviewing.md
workflow.json
tests/
e2e/
fixtures/
cloud-interruptible-workflow/
analyze.md
workflow.json
smoke-workflow/
smoke.md
workflow.json
test_skill_cloud_workflow.sh
test_skill_create_workflow.sh
test_skill_stagent.sh
helpers.sh
run_tests.sh
test_agent_guard_run_files.sh
test_baseline_tree.sh
test_complex_workflow.sh
test_continue_workdir_health.sh
test_lib_run_files.sh
test_logout_workflow.sh
test_max_epoch.sh
test_modifies_worktree.sh
test_parse_workflow_flags.sh
test_session_arg_guard.sh
test_setup_run_files.sh
test_stage_context_run_files.sh
test_stage_files_no_hardcoded_paths.sh
test_update_status_run_files.sh
test_whoami_workflow.shยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic