> ## Documentation Index
> Fetch the complete documentation index at: https://roe.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Exit codes

> How to use roe in scripts and CI.

`roe check` (a bare `roe`), `roe dead-code`, `roe dupes`, and `roe health` all
use the same exit codes:

| Code | Meaning                                               |
| ---- | ----------------------------------------------------- |
| `0`  | Clean — no findings.                                  |
| `1`  | Findings were reported.                               |
| `2`  | Error — a message is printed to stderr as `error: …`. |

For the combined run, `1` means **any** of the three analyses had findings, and
`0` means all three were clean. There's no way to tell from the exit code alone
which analysis reported — use the individual commands, or
[`--format json`](/reference/json-output), when you need to distinguish them.

Warnings (for example, about ambiguous config files) go to stderr as
`warning: …` and don't affect the exit code. The combined run prints each
distinct warning once, not once per analysis.

<Note>
  [Hotspots](/commands/health#hotspots) are the one exception: they're
  informational and never affect the exit code. Every codebase has a riskiest
  file, so failing a build over the existence of a ranking would make the
  check useless as a gate.
</Note>

A run under a [baseline](/commands/health#baselines) exits `0` when every
finding it made was already recorded — that's what the baseline is for — and
`1` as soon as one isn't. `--write-baseline` always exits `0`: it records the
codebase rather than judging it. A missing, malformed, or unsupported
baseline file is an error and exits `2`, since silently continuing without
one would report the whole backlog as new.

## In CI

Because findings exit with `1`, roe fails a CI step out of the box:

```yaml theme={null}
- name: Check the codebase
  run: roe . --format json > roe-report.json
```

Or gate on one analysis at a time when you want separate steps:

```yaml theme={null}
- name: Check for dead code
  run: roe dead-code . --format json > dead-code-report.json
```

Combine with [`--format json`](/reference/json-output) to post-process the
report, or with a [config file](/configuration) checked into the repository
to keep suppressions and ignore globs consistent between local runs and CI.
