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.
After changing your code, sync the affected tests. With no flags, Sheriff selects staged, unstaged, and untracked source changes. A clean worktree has nothing to sync.
Sync current changes
/sheriff:sync$sheriff-syncSync audits changes by default, then checks for missing assertions for changed behavior—even when existing tests pass. Source fixes follow your configured policy and authorization.
Compare against a branch
To include committed work, compare your current work against the merge base with main, or replace it with your base branch:
/sheriff:sync --since-branch main$sheriff-sync --since-branch mainSelect staged paths
/sheriff:sync --staged$sheriff-sync --staged
--stagedselects staged paths, but tests run against their current working-tree contents, including any unstaged edits.
Other selectors
Use --since-commit <ref> to compare a commit to the working tree, or --files src/a.ts,src/b.ts to select specific source files.
Choose only one selector: --files, --staged, --since-commit, or --since-branch. Add --no-audit to skip source review.
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.
Resume and reset
Resume interrupted Sheriff workflows, retry a phase, or reset a plan. Recover your testing progress in Claude Code and Codex without starting over.