Diagnose and fix failing builds with your local AI agent

We have added a new flag to the CircleCI CLI: --failure-report. This flag prints condensed output for every failed step in a pipeline run, formatted specifically for AI agent consumption.

Run it from your project directory:

circleci run get --failure-report

By default, the CLI resolves the latest run from your current git remote and branch. If the latest run did not fail, the report returns nothing. To retrieve a specific run, pass the run ID directly:

circleci run get <run-id> --failure-report

Pipe the output directly to your local coding agent:

circleci run get --failure-report | claude

This gives your agent exactly the context it needs to diagnose the failure and suggest a fix, without the noise of a full build log.

Available options

  • --project gh/org/repo — target a specific project when you are not in a git repository.
  • --branch main — specify a branch. Defaults to your current branch.
  • --mine — filter to runs you triggered.
  • --no-interactive — skip the interactive picker and resolve the latest run directly.

Get started

Install or update the CircleCI CLI, then see the CLI reference for full flag details and usage.