REFERENCE
JSON output and exit codes
What uno -p --output json prints, and what each exit code means.
{
"result": "Fixed parse_date and added a test. 14 tests pass.",
"exit": "done",
"turns": 6,
"usage": { "input_tokens": 3912, "output_tokens": 1104,
"cache_read_tokens": 41280, "cache_write_tokens": 2210 },
"cost_usd": "0.0187",
"model": "claude-sonnet-5",
"effort": "high",
"session_id": "a1f3…",
"refused": 0,
"sources": [],
"refusal_category": null
}
The summary is printed however the run ends, even when it fails before it reaches the model (no key, a bad @ path), so cost_usd, turns and usage are always there. A run that did not finish says why in exit, and adds error or signal. effort is the reasoning effort the run asked for: --effort, the effort setting, or high. model, effort and session_id are null when the run failed before they were worked out.
turns counts every model call the run made: the main agent's, its helpers' (the task tool) and conversation summaries'. usage is their tokens and cost_usd their price. A call cut off before it finished (at --deadline, by a signal, or by a dropped connection) never reports its tokens, so it is left out of turns and usage and priced in cost_usd at the most it could have cost. --max-turns limits the main agent's calls only.
| Exit code | exit | Means |
|---|---|---|
| 0 | done | Finished, nothing refused |
| 2 | done, blocked | Finished, but refused calls needed a say-so; or a UserPromptSubmit hook blocked the prompt (blocked, with error saying why), and nothing was sent |
| 3 | max_tokens, turn_limit, too_long, deadline | Stopped early: four replies in a row cut off at the output limit (after each of the first three the model is asked to carry on in smaller pieces), --max-turns reached, the conversation outgrew the window, or --deadline came |
| 1 | refusal, error | The model declined (refusal_category says why, when the provider does), or something failed (error says what, such as the cost limit) |
| 128 + signal | interrupted | Stopped by a signal, such as a job's time limit (143) or Ctrl-C (130); signal is its number |
sources lists the pages a web-search answer cited. Values are illustrative.
On Claude 5 models (except Haiku 5.5), Uno asks Anthropic to run a request its safety classifier declines again on the model Anthropic recommends for that kind of decline, so a false positive does not end the run. The switch shows as > fallback declined by …, answered by …; a refusal exit means every model declined.