statewright
Agents are suggestions, states are laws.
Your workflows, in the harness you choose. Statewright defines tools, checks, and transitions for each phase of agent work. Use it with Claude Code, Codex, Cursor, OpenCode, Pi, or OMX, or connect a custom MCP host. Tool enforcement and model routing depend on the integration. Full docs →
Plugin releases: Claude 0.4.1 and Codex 0.4.0. See the Claude notes and Codex notes. Changes on a development branch are not necessarily included in those packages.

The problem
An agent with the same tools throughout a task can edit during review or deploy before checks finish. A workflow needs a way to make those boundaries explicit and, where the host supports it, enforce them before a tool runs.
The approach
Define the tools and checks each phase needs. Planning can allow reading, implementation can enable edits, and testing can permit designated commands. On intercepted tool paths, the integration rejects calls outside the current phase and explains which tools and transitions are available. Managed shell checks also screen writes and destructive operations when edits are disallowed.
State machines support retries, loops, and approval gates. You can keep your selected model throughout a workflow or configure phase-specific routes on supported clients. The research results below report a small local-model experiment, not a general model-size requirement.
Quickstart
Claude Code
/plugin marketplace add statewright/statewright
/plugin install statewright@statewright
Codex
codex plugin marketplace add statewright/statewright
codex plugin add statewright@statewright
OpenCode
Use the OpenCode setup guide
to load the native plugin through the shared executor.
Cursor
Choose Cursor Agent through the executor or standalone IDE mode.
The IDE's MCP/rules mode is advisory; the Agent integration adds native tool hooks.
Also available: Pi, OMX, and custom MCP connections. The install guide covers every adapter and its connection requirements.
In Claude Code 2.1.295 or newer, run the plugin commands at Claude's prompt,
then open the Arbiter's connection status and choose Connect. Claude manages
its native OAuth login. In Codex, restart after installation and ask for
statewright_connect; approve the matching device code in your browser.
Neither flow requires pasting a key into the conversation. Other hosts have
their own connection instructions.
Existing Claude manual-hook installs must complete the
migration before
starting a workflow; updating the plugin does not remove old settings hooks.
Desktop guides: Claude Code → Local
uses the ordinary Claude app; ChatGPT with Codex
uses the macOS ChatGPT + Statewright launcher. Ordinary cloud chats are a
separate integration and cannot enforce model routing.
For ChatGPT web and other remote MCP hosts, see the
web workflow guide. Web guidance and visible
transition receipts do not provide the native plugins' hooks or model routing.
Start with agentic-engineering (alias engineering) for a fix, small
feature, refactor or investigation. This illustrative sequence shows the normal
change path; actual states, events and tools come from the selected workflow:
❯ Use the engineering workflow to fix the failing tests in calc.py
◆ statewright — statewright_load_workflow (name: agentic-engineering)
◆ [statewright] Workflow activated: agentic-engineering
◆ statewright — statewright_get_state (MCP)
◆ diagnose → baseline: understand the failure and record a focused plan
Read the relevant code; reproduce the failing test
◆ implement: make the smallest coherent change
Edit calc.py and add regression coverage
◆ validate → review: check the result and look for missed cases
Run the focused checks; record results and limitations