sheriff.

Basic Usage

Run your first Sheriff test workflow in Claude Code or Codex. Discover coverage gaps, review a test plan, and write and run tests for your project.

Once Sheriff is installed, open your AI tool in your project and start a run.

Start a workflow

Claude Code
/sheriff:run
Codex
$sheriff-run

Sheriff onboards to your project, confirms the test scope, and offers audit-plus-test or test-only mode. It then maps coverage gaps, plans phases, writes and runs tests, and reports the results.

Audit before testing

To audit source code before generating tests:

Claude Code
/sheriff:run --audit
Codex
$sheriff-run --audit

Choose audit mode when prompted, or pass --audit or --no-audit explicitly.

Review the results

Sheriff writes tests, but does not commit automatically. Commits require your authorization and a reviewed file scope.

The default onTestFailure: flag policy reports source defects without changing source. The fix and fix+notify policies allow scoped fixes within your authorization; you can also explicitly authorize an individual fix.

Audit mode alone does not grant permission to edit source.

Check progress

See the current test inventory, known gaps, and phase progress:

Claude Code
/sheriff:status
Codex
$sheriff-status

Resume pending work

Invoke /sheriff:run or $sheriff-run again to resume pending work. Saved handoffs take priority within dependency order.

Passing, failed, and review items are not automatically retried on an ordinary resume. See Resume and reset for retrying a phase or starting a new plan.

Keep tests in sync

After changing source code, run /sheriff:sync or $sheriff-sync to update affected tests. With no flags, this selects staged, unstaged, and untracked source changes.

Learn how to select a sync scope, or browse the command reference.