> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# loop

Print the [improvement loop](/docs/optimization/improvement-loop): the steps an AI assistant follows to improve your AI Agent. The loop lives in Ada. Ada renders it for the adacli release that you run and for the features of your Agent, so it shows only the steps that the Agent can run.

## Commands

| Command         | What it does                                 |
| --------------- | -------------------------------------------- |
| `loop`          | Prints the loop, with every way to start it. |
| `loop <method>` | Prints only one way to start the loop.       |

The methods are:

| Method          | Starts from                                                      |
| --------------- | ---------------------------------------------------------------- |
| `metric`        | A custom metric.                                                 |
| `description`   | A behavior that you describe.                                    |
| `conversations` | Conversations that you give.                                     |
| `signal`        | Unresolved conversations, a low CSAT score, or a handoff reason. |

## Examples

Print the loop:

```bash
adacli acme loop
```

Print only the way that starts from a custom metric:

```bash
adacli acme loop metric
```

Get the loop as JSON, and check if adacli must be upgraded first:

```bash
adacli acme loop --json | jq '.upgrade_required'
```

## Details

* With `--json`, the command returns these fields:

  | Field              | Description                                              |
  | ------------------ | -------------------------------------------------------- |
  | `version`          | The version of the loop.                                 |
  | `method`           | The method you asked for, or `null` for every method.    |
  | `markdown`         | The loop, in Markdown.                                   |
  | `rendered_for_cli` | The adacli version that Ada rendered the loop for.       |
  | `min_cli_version`  | The oldest adacli version that can run the loop.         |
  | `upgrade_required` | `true` when your adacli is older than `min_cli_version`. |

* If your adacli is older than `min_cli_version`, `markdown` holds an upgrade notice in place of the loop. Run [`adacli upgrade`](/adacli/commands/upgrade), then run `loop` again.

* An adacli release without the `loop` command exits with code `2`. Upgrade adacli.

* If you give an unknown method, the command fails, and the error lists the methods.

* `loop` reads from your Agent, so it needs a login. If you are not logged in, it exits with code `3`.

AI assistants run `loop` through the `ada-optimize` skill. The skill runs `adacli <instance> loop --json` and follows the `markdown`. To install the skill, see [`skills`](/adacli/commands/skills) and [AI assistants](/adacli/use-with-an-ai-assistant). The Ada MCP server serves the loop through its [`start_improvement_loop`](/mcp/tools/start-improvement-loop) tool.

For every option, run `adacli acme loop --help`.

## Related commands

* [`changesets`](/adacli/commands/changesets): review, promote, or revert the change sets that the loop creates.
* [`testing`](/adacli/commands/testing): manage the test cases that the loop runs.
* [`skills`](/adacli/commands/skills): install the `ada-optimize` skill.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).