momentic run, at the moment a run exhausts its retries. Every failed run
leaves the CLI already carrying a category, reasoning, and a triage action; no
separate classification pass, and nothing to re-run in a later CI step. Prefer
this over invoking
momentic ai classify
afterwards.
Enable it
Turn it on inmomentic.config.yaml:
momentic.config.yaml
What happens on a failure
When a run fails after all retries, the CLI shows aClassifying failure step
and the agent inspects the failed step, screenshots, error details, evidence
from past runs, and git context
when available. The verdict is written into the run’s results:
- The category, reasoning, confidence, and recoverability appear in the CLI output and in the run viewer’s failure details.
- The category’s configured action (heal, warn, or fail) is attached
to the run, so downstream steps such as
momentic ai triageandmomentic results checkcan act on it without re-classifying. - With failure recovery enabled, a failure the classifier judges one-time recoverable triggers an in-run recovery attempt guided by its reasoning.
Let the verdict gate CI
By default the classifier only records a category: every failed test still fails CI. SetoverrideExitCode: true so failures routed to heal or warn exit
0, keeping the job passing while the failure is repaired or reported. Failures
routed to fail (for example BUG) still exit 1.
momentic.config.yaml
--classify-override-exit-code to
momentic run. To skip classification for one invocation, pass --no-classify.
In-flow vs momentic ai classify
momentic ai classify runs the same agent as a separate command against
already-finished runs. Prefer the config-driven in-flow setup for CI:
- No extra CI step, API round trip, or run selector to wire up; the verdict is
part of the run result the moment
momentic runexits. - The exit-code override can only be applied while the run is still deciding its
exit code, so
overrideExitCodeworks only in-flow. - Verdicts are saved automatically;
ai classifypersists only with--save.
ai classify when you want to re-classify a past run, classify runs
from an older CLI version, batch-classify a run group or commit, or ask
follow-up questions with --interactive.