> For AI agents: the complete documentation index is available at https://docs.phax.run/llms.txt, the full documentation bundle is available at https://docs.phax.run/llms-full.txt.

# Exit codes and environment

## Exit codes \{#exit-codes}

| Code | Meaning                                                                      |
| ---- | ---------------------------------------------------------------------------- |
| 0    | Success                                                                      |
| 1    | Generic failure (refusal, no project config)                                 |
| 2    | Plan or config validation                                                    |
| 3    | Unsafe git state                                                             |
| 4    | Gate failure (fix attempts exhausted, or a step refused)                     |
| 5    | Agent invocation error (Claude, Vibe, or Codex)                              |
| 6    | Archive blocked by a dirty worktree                                          |
| 7    | Lock conflict                                                                |
| 8    | Rate or usage limit hit (resumable)                                          |
| 9    | Phase produced no changes (resumable)                                        |
| 10   | Registry corruption                                                          |
| 11   | Security or preflight refusal                                                |
| 12   | Artifact lifecycle refusal                                                   |
| 13   | Awaiting review at an interactive or held phase (resumable)                  |
| 14   | Provider unreachable: network failure (resumable)                            |
| 64   | Refused call: unknown command or option, or an argument that does not decode |
| 70   | Defect: an unexpected failure, a bug in phax                                 |
| 130  | Interrupted (SIGINT or SIGTERM): `phax run` or `phax resume` saved the run   |

`phax prune` uses a subset of these codes: 0 when every selected run was pruned, for a `--dry-run` preview, or when there is nothing to prune; 1 when nothing was deleted (a bad selection, no project config, or a declined or missing confirmation); 3 when at least one selected run was kept; 7 when a selected run is locked.

## Environment \{#environment}

phax reads no environment variable for its configuration values: everything is in `phax.json`, its layers and the [phax home](https://docs.phax.run/guide/phax-home.md), `~/.phax/` unless `PHAX_HOME` names another directory. It reads a few variables for their usual meaning: `GIT_COMMITTER_NAME` (who approves), `CLAUDE_CONFIG_DIR` and `CODEX_HOME` (where the providers keep their sessions), `SHELL` (`phax shell`) and `NO_COLOR`. Its own end-to-end tests run only with `PHAX_E2E_RUN=1`.
