Claude Code
Connect Statewright and run workflows in Claude's terminal or Desktop Code
Claude Code
Statewright 0.3.4 adds the Arbiter, workflow controls, compact results and
per-state model routing to Claude Code. Use ordinary claude or Claude
Desktop → Code → Local. No separate Statewright launcher is needed.
Use Code engine 2.1.295 or newer. Desktop bundles its own engine; check
/status inside a Code conversation. This integration does not run in ordinary
Desktop Chat or Cowork.
Install and connect
At the Claude Code prompt:
/plugin marketplace add statewright/statewright
/plugin install statewright@statewrightFor an existing install, run claude plugin update statewright@statewright in
a terminal. Use /reload-plugins in an open conversation.
Upgrading from manual hooks: if you previously ran Statewright's
setup.sh or added its hooks directly to Claude settings, stop before starting
a workflow. Close affected sessions and follow the
legacy-hook migration.
Plugin update does not remove those settings hooks; leaving both active would
run two integrations. Review the migration preview, retain its backup and
remove only the old Statewright entries before reopening Claude.
Select the Arbiter's connection status, then Connect in its sidebar. Complete Statewright sign-in and the native Claude permission prompt. Claude manages OAuth credentials and refresh; you do not need a key file. If you already connected, Claude can restore the login without a browser.
Connection and workflow-control consent are separate. Consent is scoped to the live conversation and clears on reload or close. It does not approve commands, file changes or Statewright review gates.
Run a workflow
Choose a workflow and select Start workflow, or ask:
Use the agentic-engineering workflow to investigate the failing test.
Selecting a name alone does not start it. Wait for the current state to appear. The Arbiter shows that state, available events and model/effort when known. Open Show workflow map for recent observed states and possible next steps.
Compact results summarize the call they belong to: state, outcome, allowed tools and disposition/reasoning. Details shows its original input and output. An error or pending approval is not a completed transition.
Use /statewright to reopen the sidebar. Turn Statewright Off deactivates
the workflow and restores the host-selected model; closing the sidebar does neither.
Appearance and model routing
/statewright configure opens saved preferences, including the gateway and
Powerline separators. Powerline is opt-in. Use /statewright powerline on,
off, or default to override only the current terminal session.
Desktop uses clickable pills rather than terminal glyphs.
Native main-conversation requests use the workflow's Claude model equivalents. The requested model/effort is distinct from the model observed on the response. A recognized Fable usage-credit gate can fall back to Opus at the same effort. Other errors and partial responses are not silently replayed.
Permissions and limits
Statewright checks native tool calls before permission settlement. It does not replace Claude's permissions. A host-side argument rewrite after that check can execute without another pre-check; post-call comparison detects it but does not prevent it. Shell classification may also reject legitimate commands. Preserve the refusal and use an allowed workflow path, or ask the user how to proceed.
Do not install blanket permission rules to repair a connection. If the sidebar says Check Claude permissions, review the native prompt or relevant rule; another OAuth login does not fix a permission denial.
Next steps
- Claude Desktop guide — pills, sidebar, review and recovery.
- OAuth login — SSH and browserless sign-in.
- Migration from manual hooks — remove only the old Statewright hooks.
- Create your own workflow.
The legacy shared-executor transport is separate from this native integration; its restart-routing tests do not validate the native mod.