EveryDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xantorres/repokernel/llms.txt
Use this file to discover all available pages before exploring further.
rk command exits with a numeric code that tells the calling shell or agent whether the run succeeded, whether the project has findings that need attention, or whether something went wrong at the tool or environment level. Understanding the distinction between these codes is essential for writing robust CI scripts and agent loops.
Exit code
64 follows the sysexits.h convention (EX_USAGE) from BSD and POSIX systems. This makes it immediately recognizable to shell authors and agent frameworks: when you see 64, the invocation itself was malformed — fix the CLI arguments, not the project state.Exit code table
| Code | Constant | Meaning |
|---|---|---|
0 | EXIT_OK | Clean: no findings at or above the configured severity threshold. |
1 | EXIT_FINDINGS / EXIT_BLOCKED | Findings at or above threshold, or an expected project-state error (lane already claimed, review pending, epic not found, etc.). |
2 | EXIT_RUNTIME | Tool or environment error not attributable to project state — IO failure, internal assertion, unhandled exception, or a missing config file. |
3 | EXIT_BUDGET_EXCEEDED | rk context payload exceeds the configured budget. Increase the budget or shrink the scope. |
4 | EXIT_BUDGET_TOO_SMALL | The budget is smaller than the essential capsule itself. Raise the budget floor. |
64 | EXIT_USAGE | Bad command-line invocation: unknown enum value, mutually exclusive flags, malformed numeric option. Follows sysexits.h. |
EXIT_FINDINGS and EXIT_BLOCKED share the value 1. The intent is the same: something about the current project state needs to be resolved before proceeding, whether that is a validation finding or an operational block such as a lane already being claimed.
Per-command notes
Different commands use exit codes with slightly different semantics based on what they do.rk validate
0— no findings at or abovepolicies.severityFailThreshold1— one or more findings at or above threshold2— config file missing, unreadable, or IO failure
rk next
0— a runnable or planned sprint was found1— no runnable sprint (blocked by findings, no queued sprint, or dependencies not met)2— runtime error
rk review-verdict
0— verdict written successfully1— review ID not found or already in a terminal state2— runtime error
rk epic close
0— epic closed successfully1— blocked (sprints not yet shipped, checks failed, or epic alreadydone/cancelled)2— runtime error
rk doctor
0— setup is complete1— setup is incomplete or config has problems
Agent shell disambiguation
Agent loops and CI scripts should branch on exit codes in the following order to correctly attribute failures.64 first (CLI argument mistakes), then 2 (crashes and environment problems), then 1 (project state that needs work), then 3/4 (context budget gates). This ordering prevents a runtime crash (2) from being misread as a resolvable findings situation (1), and prevents a bad CLI invocation (64) from being retried as if it were a transient error.
Scripting examples
Check for P0-only findings in CI without blocking on P1 hygiene issues:--json output to capture the exit code alongside structured data for downstream processing: