docs / Miri for Agents / What Agents Get

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:

ToolWhat it does for the agent
The loopOne short routine — check, fix, test — that the agent repeats until the code is clean.
miri check --format jsonEvery error and warning as JSON: a stable code, the exact place, a one-line help, and often a ready-made repair.
miri fixApplies those repairs to the file in one call.
miri explainDescribes the rule behind any error code, with a before-and-after example.
miri viewAnswers “what can I call on this type?” and “what does this module offer?” from the real standard library.
miri testRuns @test functions and reports each failure with the expected and actual values.
miri patchEdits inside one function and refuses the edit if the file would stop compiling.
Skill packsShort 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.