Skip to main content
Every Shrike command returns one of six process exit codes. 0 and 1 are normal outcomes; 2 through 5 are failures. JSON on stdout does not change the exit code.

The six codes

A rejection (3) means Shrike ran and made a decision. A 4 means Shrike could not make a trustworthy decision. Do not treat them as interchangeable in automation.

Per command

Partial results still follow the table: if a report has one removable file and one diagnostic, the exit code is 1, not 4. A diagnostic does not by itself change the exit code.

Configuration and usage errors

Exit 2 covers conditions that are the caller’s responsibility:
  • Unknown flags, missing flag values, or conflicting flags such as --all with --base, or --verbose with --quiet.
  • A config that does not export an object, throws during evaluation, or times out. The message names the config path.
  • A dirty working tree for clean/prune in worktree mode, or for verify without --allow-dirty.
  • ci install refusing to overwrite an existing workflow that is not Shrike-managed; rerun with --force after reviewing it.
  • --no-checks, which is rejected because a verified deletion needs at least one project check.
An engine response with a config_error or invalid_* code is also a usage error, not an internal failure.

Fail-closed conditions

Exit 4 is deliberate. Examples:
  • shrike-engine was not found, an unsupported platform, or a checksum mismatch in the installed engine.
  • An engine timeout (SHRIKE_ENGINE_TIMEOUT_MS) or a protocol mismatch.
  • A base ref that cannot be resolved by git merge-base or git rev-parse.
  • No verification checks were found, and --no-checks is not supported.
  • A batch could not be bisected conclusively.
  • A requested build-evidence export is missing or unusable with --require-build-evidence.
  • An installer action failed, including a path that would escape the repository through a symlink.
  • A verify plan is stale because HEAD, the merge base, or the tree changed.
Fix the cause and re-run. Do not rewrite the command to ignore the failure.

Verification and revert failures

Exit 3 means at least one batch regressed and Shrike reverted it. Passing batches may still have been committed. Read the receipts to see which check failed and which symbols were rejected, then fix the project or the check and re-plan. Exit 5 means the revert itself failed. Stop. The normal worktree and branch cleanup must not continue until the tree is restored:
Use the snapshot path printed by the failing command. recover restores only the files listed in the snapshot and rejects absolute or traversal paths. Do not hand-edit the worktree.

CI interpretation

The Shrike Action maps these codes into its step result. fail-on: never is advisory: it reports the delta without failing on findings. fail-on: newly-dead fails when anything is newly dead. max-items fails when the count exceeds the cap. In shell scripts, do not rely on set -e alone if 1 is an expected finding:

Next