Skip to main content
In-flow classification runs the results classification agent inside 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 in momentic.config.yaml:
momentic.config.yaml
The toggle is versioned with your tests and applies to local and CI runs. See the AI configuration reference for every field.

What happens on a failure

When a run fails after all retries, the CLI shows a Classifying 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 triage and momentic results check can 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.
Failure categories, their actions, and the optional custom prompt stay cloud-managed in Settings > Classification.

Let the verdict gate CI

By default the classifier only records a category: every failed test still fails CI. Set overrideExitCode: 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
To opt in for a single invocation instead, pass --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 run exits.
  • The exit-code override can only be applied while the run is still deciding its exit code, so overrideExitCode works only in-flow.
  • Verdicts are saved automatically; ai classify persists only with --save.
Reach for 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.