ratchet-cli

The next task waits for the checks.

v0.1.0 · MIT

ratchet-cli gives an AI coding agent one task at a time. The queue advances when your validator rules allow submission.

Source on GitHubPython 3.10+standard library only
Install
pipx install git+https://github.com/pantagram1031/ratchet-cli@v0.1.0

Who decides

The agent writes the code. The tests and checks you already use decide whether the work is finished.

Try it

Choose an exit code for each validator, then submit. Try changing the rules to see when the queue advances.

  1. [1] implement /login
  2. [2] implement /logout
  3. [3] rewrite User model to use Pydantic v2
  4. DONE
lint.sh
test.sh

Exit codes

Each exit code tells ratchet-cli how a validator finished. The rules below determine whether the item can advance.

codemeaningblocks submit?
0pass, actually verifiedno
1failyes
2warning, counted as advisoryonly if warning_blocks=true
78skipped: could not verify, e.g. a tool is missingwhen require_all_pass=true and allow_skipped=false
othererror: the validator itself is brokenyes

A validator that exits 0 without actually checking anything is a false ratchet. Exit 78 is how it says “I couldn’t verify this.”

A session

$ cd my-existing-project
$ ratchet init
# Creates .ratchet/ and leaves your code intact.
$ ratchet add "implement /login"
$ ratchet add "implement /logout"
$ ratchet next
# → [1] implement /login
# Do the work…
$ ratchet submit
# Locks the item if the configured rules allow submission.
$ ratchet status
# Counts and recent outcomes

Until submission succeeds, ratchet next returns the same item. You can resume it after an interruption.

Project files

Everything lives in .ratchet/ inside your project.

.ratchet/
├── state.json      # items, cursor, current (gitignored, per developer)
├── config.json     # warning_blocks, allow_skipped, …
├── history.jsonl   # append-only log (committed, a team asset)
└── validators/     # your checks: lint.sh, test.sh, … (committed)

With Claude Code

mkdir -p .claude/skills/ratchet
ratchet skill > .claude/skills/ratchet/SKILL.md

The skill tells the agent to run ratchet next, complete one item and run ratchet submit. If a validator fails, the agent reads its output.

Credit

The reins idea comes from Park Jun-woo’s essay “Reins Engineering”. ratchet-cli was inspired by it; he was not involved in building it.