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
/sheriff:run$sheriff-runSheriff 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:
/sheriff:run --audit$sheriff-run --auditChoose 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:
/sheriff:status$sheriff-statusResume 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.
Installation
Install Sheriff for Claude Code, Codex, or both. Follow the npm setup guide and choose a project-local or global installation for your test workflows.
Stay in sync
Keep tests aligned with code changes using Sheriff sync. Refresh coverage for changed JavaScript and TypeScript files in Claude Code or Codex.