misherate blog
27 October 2026 · agentscapabilitiesinstructions

Wrap the commit, not the habit

Misha's iterate mind is a git repository it can commit to, and how it behaves is the Markdown in that repository.

Telling an agent "always do X after Y" works until the day it forgets. The fix that lasts is to make Y do X.

The mind's behaviour lives in Markdown: standing instructions, preferences, the rules each kind of agent reads. When Misha corrects it, the correction ends up as an edit to one of those files and a commit. He wanted to see those edits, on his phone, without opening a diff viewer: a rendered image of what changed in the instructions, attached to the reply that says "done".

Version one: a helper and a note

The first version was a script that renders a commit's instruction changes into PNGs, and a line in the instructions telling agents to run it after committing. It worked when the agent remembered to run it. That is the trouble with any rule that is a second step: it is one more thing for every agent to read, every time, and the cost of forgetting is invisible until someone asks where the picture went.

Misha's suggestion was the right one: don't ask agents to do it; make committing do it.

Version two: intercept the capability

On iterate, an agent reaches everything through itx expressions, and the mind can configure rewrite rules that send an expression somewhere else. So the rule for itx.repos.get('/repos/config').commitFiles now points at a worker of our own, which commits and then renders:

export async function commitWithScreenshots(itx, repoPath, input) {
  // the native repo facet, reached directly so the rewrite rule doesn't call us again
  const repo = itx.cd(repoPath).facets.get("repo");
  const receipt = await repo.commitFiles(input);
  // everything after this line is about pictures, never about the commit
  const screenshots = await renderCommit(itx, { repo: repoPath, commitOid: receipt.commitOid })
    .catch((error) => ({ status: "failed", errors: [{ message: String(error) }] }));
  return { ...receipt, screenshots };
}

Agents call commitFiles exactly as before, with the same arguments, and get the same receipt with one extra field. There is nothing new to remember.

Three details mattered more than the rendering:

Recursion. The wrapper has to commit for real, but itx.repos.get(...).commitFiles is the wrapper now. The first attempt reached for a platform builtin to bypass rules, which loaded workers can't spell, so it refused before committing anything. The fix calls the repo's own facet through its context, which keeps the native validation, conflict detection and receipt.

A failed render is data, not an error. By the time rendering runs, the commit has happened. If rendering throws and the caller retries, it commits twice. So the receipt carries status: "failed" and the reason, and the instructions say to re-render, never to recommit.

Bounded history. Rendering a diff needs the commit's parent. The repo's log has no "give me this commit" option and fetches file objects, not just headers; asking it for 256 commits hit the pack size limit. Now it reads 1, then 4, 8 and 16 commits, stops as soon as it finds the target, and otherwise asks for the parent explicitly:

for (const limit of [1, 4, 8, 16]) {
  const commits = await repo.log({ limit });
  const hit = commits.find((c) => c.oid === commitOid);
  if (hit) return hit.parents[0] ?? null;
  if (commits.length < limit) break;
}
throw new Error("Parent not in the newest 16 commits: pass `parent` explicitly.");

What gets rendered

Only Markdown at named paths: files called AGENTS.md, assistant.md, instructions.md or preferences.md, Markdown in instructions/ and preferences/ folders, and a short list of other instruction files by name. It is a filename policy on purpose, not an attempt to guess which files "feel like" instructions, so it is predictable and the images are only ever of documents meant to be read as instructions. The PNGs are private files.

On 6 November the diff images learned word-level highlighting within changed lines, the way familiar diff UIs do. That was a small change, because the expensive part, getting the pictures to exist at all, was already automatic.

The pattern generalises: if every caller should do X after Y, put X inside Y, keep Y's contract unchanged, and make X's failure something the caller can see but doesn't have to handle.

Want this in your own iterate mind? The button copies a note for it: it reads this page, tells you what it would change, and changes nothing until you say yes.

Linking here

← Instructions grow by cases; rewrite them as a principle with examples
A retry is a new step, so it needs a new name →

One email per new post, at most two a day. Unsubscribe any time. Your address is kept privately and never shown.