# 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.

- Published: 2026-11-24
- Publisher: Rig Labs (https://riglabs.ai/)
- Canonical: https://riglabs.ai/blog/stately-skill-state-bugs/
- Answers: Stately skill
- Agent file (a short card for your agent): 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](https://stately.ai/blog/2026-11-23-stately-skill):

1. **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.
2. **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.
3. **Checks a flow with a model checker**, a tool that tries every sequence of events against a rule you state.
4. **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:
- [Stately: Find the state machines hiding in your code, 2026-11-23](https://stately.ai/blog/2026-11-23-stately-skill)
