sheriff.

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

Claude Code
/sheriff:sync
Codex
$sheriff-sync

Sync 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:

Claude Code
/sheriff:sync --since-branch main
Codex
$sheriff-sync --since-branch main

Select staged paths

Claude Code
/sheriff:sync --staged
Codex
$sheriff-sync --staged

--staged selects 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.