2. Customize the Agent YAML
If an agent does not name a model, its runs use the default model of your organization. Pick a model when the job needs more speed, more depth, or a lower cost.
Step 1: Set the model
Add these fields to agent.yaml:
model:
name: claude-haiku-5-5
max_tokens: 4096
limits:
model_requests: 20
timeout: 5m
| Field | What it does |
|---|---|
model.name | The model's full name in the Autoheal model catalog. |
model.max_tokens | The longest answer that the model can write in one reply. |
model.thinking | How much the model thinks before it answers: minimal, low, medium, high or xhigh. More thinking makes runs slower and more expensive, and usually better on hard problems. |
limits.model_requests | The maximum number of model calls in one run. The default is 300. The maximum is 1000. |
timeout | The maximum time for one run. The default is 10 minutes. The maximum is 1 hour. |
Step 2: Compare two models
- Commit, and run the agent with the pull request URL from the Quick Start.
- Change
model.nametoclaude-sonnet-5, and addthinking: lowbelowmax_tokens. Commit, and run the agent again with the same URL. - Compare the two reviews. Look at what each model found, and at how long each run took.
Not every model accepts thinking. If a run fails with a message about thinking, remove the field for that model.
Model names
Write the model's full catalog name, for example claude-haiku-5-5, claude-sonnet-5, claude-opus-5-5 or gpt-5-5. Short names such as sonnet do not exist.
Your organization offers only some models from the catalog. If you write a name that your organization does not offer, Autoheal shows an error that lists the names that you can use. The agent cannot run until you change the name. If your company sends model calls through a gateway, such as Portkey or LiteLLM, ask your admin which names to use.
| Model family | Good for |
|---|---|
| Haiku | Short jobs with clear rules: formatting, summaries, a first review of a small diff |
| Sonnet | Most agents that call tools and reason about the results |
| Opus | Long jobs with no fixed path: root cause analysis, large code changes |
Write instructions that work
- Say what a good result is. "Write a verdict: merge, merge with changes, or do not merge" is better than "review the pull request well".
- Give the steps in order. Numbered steps are easier for a model to follow than a paragraph.
- Say what the agent must not do. For example: "Do not comment on the pull request and do not push."
- Keep long examples and team rules out of the instructions. Put them in a skill. The agent loads a skill only when it needs it. See the next chapter.
- Change one thing at a time. Run the agent on the same pull request after each change, and compare the results.
From the CLI
autoheal agents push agents/pr-review -m "Use claude-haiku-5-5"
autoheal run pr-review "https://github.com/autohealai/astronomy-shop-template/pull/1" --follow
See Timeout and limits in the reference.