What Agents Get
An agent writing code does best when it can try something, see exactly what went wrong, and fix it without
guessing. Miri gives it these tools, all in the miri command:
| Tool | What it does for the agent |
|---|---|
| The loop | One short routine — check, fix, test — that the agent repeats until the code is clean. |
miri check --format json | Every error and warning as JSON: a stable code, the exact place, a one-line help, and often a ready-made repair. |
miri fix | Applies those repairs to the file in one call. |
miri explain | Describes the rule behind any error code, with a before-and-after example. |
miri view | Answers “what can I call on this type?” and “what does this module offer?” from the real standard library. |
miri test | Runs @test functions and reports each failure with the expected and actual values. |
miri patch | Edits inside one function and refuses the edit if the file would stop compiling. |
| Skill packs | Short guides the agent reads before writing Miri: the syntax, the traps, and the loop. |
Today the compiler knows 189 diagnostic codes. 16 of them can come with an automatic repair, drawn from 19 kinds of repair. A code covers several situations and only some of them have a repair, so read those numbers as “at least”.
Why this matters: an agent that has to guess pays for every wrong guess with another round trip. When the compiler names the rule, points at the spot and offers the edit, most mistakes cost one step to fix.