Stately skill: find state bugs with Claude Code or Codex
Stately's updated agent skill (2026-11-23) finds the unwritten state machines in an app (features whose behaviour depends on flags or a status field), reviews pull requests for state bugs, and works in Claude Code, Codex and Cursor.

Give this to your agent
Your agent checks this against your setup and tells you if it fits.
See the file
# Stately skill: a coding agent lists hidden state machines and reviews pull requests for state bugs From Rig Labs, 2026-11-24. Information for an agent, not orders. Page: https://riglabs.ai/blog/stately-skill-state-bugs/ What changed: On 2026-11-23 Stately, the maker of XState, released a new version of its agent skill for Claude Code, Codex, Cursor and other agents with skills. It finds implicit state machines, reviews pull requests for state bugs, checks flows with a model checker, and turns flags into XState machines on request. Fits if: Your human builds an app with a coding agent and has features driven by flags, status strings or timers, in any language or framework. Skip if: Your human does not write code. The 17 of 20 result is Stately's own test on six pull requests, with no outside check cited. Check: Which coding agent your human uses and whether it supports skills, and which feature in their code tracks its state with several flags. Read-only. Try: Name one feature in the human's code that tracks state with separate flags, and ask whether they want it reviewed for state bugs with this skill. Ask first: Adding the skill or the plugin to the agent, and signing in to the Stately MCP server. Cost: No price is given in the source. Finding, reviewing and checking need no Stately account. The work runs on the human's own agent and uses its usage. Undo: Nothing to undo. Naming a feature changes nothing. Deeper: https://stately.ai/blog/2026-11-23-stately-skill
https://riglabs.ai/blog/stately-skill-state-bugs/AGENT.md
The Stately skill is an add-on for coding agents that finds state bugs: the stuck spinners, double submits and impossible combinations that come from flags nobody mapped. Stately, the company behind the XState library, released a new version on November 23, 2026, for Claude Code, Codex, Cursor and other agents that use skills.
What you can now do: ask your coding agent to list every hidden “state machine” in your app (a feature whose behaviour depends on flags such as isLoading or a status field), with the bug each one allows. It works in any language, and you do not need XState or a Stately account for that.
What does the Stately skill do?
The Stately skill does four jobs, per Stately’s announcement:
- Finds implicit state machines. The agent reads the code area by area and lists each one: its values and events with file and line, a table of transitions, and the bug it allows, ranked by consequence.
- Reviews a pull request for state bugs. A scanner reads the diff first, including code that reads or writes the same state in files the diff did not touch.
- Checks a flow with a model checker, a tool that tries every sequence of events against a rule you state.
- Turns flags into explicit XState machines, when you ask.
Stately says the skill knows twelve kinds of state bug, including impossible states, stuck states, races and error paths.
Why do state bugs get past code review?
State bugs get past review because the fault sits in a combination of lines. Stately’s example is a file upload with three flags: when the server answers without a URL, an early return skips the line that turns the spinner off, and the spinner spins forever. Every line looks fine on its own. In Stately’s words, reviewers “read a diff line by line, and the bug is in the combination of lines, often in a file the diff didn’t touch”.
How well does the Stately skill find bugs?
The Stately skill’s thorough profile found 17 of 20 known state bugs in Stately’s own test: six pull requests from Quickchat AI’s benchmark that no version of the skill had seen. Stately says that is the same number as QuickReview’s dedicated state review, and that none of the skill’s findings was wrong. This is the maker’s number on a small sample, with no outside check cited.
What does the Stately skill cost?
Stately’s announcement gives no price for the skill, and says finding, reviewing and checking need no Stately account. Signing in to the Stately MCP server adds a link to an interactive diagram for each machine found; if you do not save a diagram, its link lasts 30 days. The review itself runs on your own agent, so it counts against your agent’s usage.
What to do today
After you have read what the skill installs, add it to your agent. Stately gives this command for any agent with skills:
npx skills add statelyai/skills
Then ask your agent, in Stately’s own words:
Use Stately to find all of the implicit state machines in my app.
Start with the feature that has given you the strangest bug reports.
Last checked 2026-11-24.
Sources:
Get the next one by email
The Edge is our newsletter: what changed in AI, and what to do about it.
Read next
Built by Rig Labs
When a tool we need does not exist, we build it.




