Blog · Craft · · 7 min read
Steering moves
An AI coding agent searches well inside the frame that you give it, yet rarely steps outside that frame on its own. Asking a model to refine its own output only searches the old frame harder, because the prior that produced the code is the same prior that judges it. Good steering is not about micromanaging syntax or reading every line. It is about changing the frame: what the problem is an instance of, what the work is for, what scale it lives at, what sibling it matches, and what counts as true.
What only the director supplies
None of that framing lives in the repository, so an agent cannot infer it from the source files. Over a year of building Ptree and updating Ptable, nearly every major improvement came from one of eight moves:
- Re-pose what the problem is an instance of. When Ptree's photo-selection build grew to 250 GB, optimizing that pipeline was the wrong task. The real question was whether photo selection is anything other than an ordinary rollup with a sort that picks one winner. When an agent fixed title casing row by row, the right fix was a rule for the entire source.
- State the real purpose, and split merged goals. Left alone, an agent optimizes whatever local proxy sits in front of it, such as making tests pass or avoiding deletions. Stating what the feature is actually for ("answering is secondary to using the interface; any model can answer questions") or splitting two combined goals (matching identities across trees versus propagating traits) settles dozens of later choices at once.
- Reject the entire family of fixes. When fixes keep getting harder, stop patching the bug and discard that whole approach. If a column layout breaks into an awkward 5+1 split and an agent wants to clamp a pixel height, ask why we are setting a height at all. Keep a symptom as a test that the right algorithm must pass on its own, never as a special case written into the code.
- Supply a sense of scale. Knowing roughly how many rows an operation touches and whether it should take microseconds or seconds catches broken architecture immediately. If looking up an icon across a thousand entries takes seconds, adding a cache only hides a full sort on the hot path. Importing a 500 KB library to turn a map click into a grid cell makes no sense when the first pass needs only a test for a point inside a shape.
- Line up siblings side by side. Agents work file by file and happily build three incompatible implementations for three views that behave the same way. Pointing out that Tree, Icicle, and Cladogram all shift column headers horizontally collapsed three separate DOM structures into one shared header.
- Move a solved shape from another project. Because you hold several projects and domains in your head at once, you can borrow a structure that already worked elsewhere. Ptree's penalty-scoring pattern for photos helped resolve conflicting parent records, and Google Docs' inline-symbol caret behavior fixed Ptable's chemical formula editor.
- Anchor tests to reality, not to rules. Tests should check real facts rather than whether a rule agrees with itself. When an agent asks you to make three judgment calls that the dataset itself can answer, refuse to guess and tell it to measure the data instead.
- Put the deciding check first in the loop. Agents run pipelines from start to finish and treat wall-clock time and your attention as free. Running the fast, decisive verification stage first lets you iterate twenty times in a day instead of waiting hours on downstream packaging before learning that identity broke.
Read every token as a claim
You do not need to read every line of generated code to catch structural defects. Instead, read what each token implies about the system and check that claim against what you know:
| What the agent wrote | What it claims | The question |
|---|---|---|
A null check (?., ` |
[]`) | |
A bare constant like 24em |
This number comes from somewhere real | Why this number? |
| A proper noun in a general rule | This case is structurally special | Why does the code need to name it? |
| A new identifier or helper | Nothing existing owns this behavior | Which sibling already does it? |
| Past-tense prose in a doc | The reader needs the commit diary | Who is this written for? |
| "Should", "likely", "probably" | The agent did not actually check | Go inspect or measure it. |
| A diff larger than the concept | The change is bigger than the summary | Show the actual diff. |
Two reference points make this fast: an expected order of magnitude for every operation, and a working sibling that serves as the spec. If lowercase input moves the caret to the start while uppercase input works normally, you do not need theory from first principles. Compare the two paths.
Eight moves that bring a defect into the open
When something feels wrong and the agent offers a smooth explanation, eight short moves expose the real cause:
- Compress the system to a toy example. Ask the agent to trace a 13 GB database or a multi-stage rollup on four rows ("Root is animals"). Structural errors, such as every parent row duplicating its children's data, show up immediately in four rows while staying invisible inside ten thousand lines.
- Ask a leading question. Phrase a suspicion as a sincere question that carries a hypothesis. If you are right, the agent finds the flaw itself. If you are wrong, conceding a false alarm costs one sentence.
- Sample raw records instead of grepping with heuristics. Before writing a cleaning script for data that you do not understand, print thirty random raw rows and read them with your own eyes.
- Subtract. Uncheck a CSS rule in DevTools or delete a suspected helper and see whether anything changes. Half of the CSS rules that an agent writes do nothing at all.
- Exaggerate. Slow a suspicious animation to three seconds, or shrink a container twice as hard, so subtle phase-order bugs and double transitions become unmistakable.
- Bisect against production. Compare the live page directly against the working release before inventing a theory.
- Turn one sighting into a census. Whenever you spot one special case, one null guard, or one lost fade, ask "any others?" and sweep the entire class.
- Remove your own influence. Ask "what would you design here without my previous suggestions?" to break anchoring when the agent is bending an architecture just to obey an offhand example that you gave three turns earlier.
Name the mindset and delete the imagined audience
Listing individual symptoms fixes one turn. Naming the mindset that produced them lets the agent test every later move against it. Saying "React-brained" (mirroring DOM state in JavaScript and re-rendering), "CSS as PDF-writer" (dictating pixel positions instead of letting layout flow), or "defensive cowardice" (hiding uncertainty in gray or || fallback to survive a hypothetical critic) compresses twenty separate corrections into one label.
Just as often, the agent is writing for a ghost: an imaginary manager, a marketing team, or a pedantic auditor. Delete that audience explicitly. Remind the model that there are no stakeholders to spin metrics for, no multi-person team that needs parallel wrapper attributes, and no nitpicker to appease with hedged prose.
Divide the work cleanly as well. You observe the visual result; the agent reasons and builds probes. Never let an agent hand perception work back to you ("could you check if the API returns 404?") when it can run the check itself, and never let it substitute headless screenshots for real browser measurements and human judgment.
Register, affect, and replacing poisoned sessions
There is no neutral prompt persona, because every tone puts the model into a role. Terse commands push a model into the role of an underqualified subordinate waiting for orders. Genuine diagnostic questions push it into the role of a seasoned collaborator.
Sharp pushback works only when it is rare and carries a clear direction. Telling an agent to "explore the data before committing to cowardice" sends it back to the raw records and yields a better model, whereas venting without a direction just stalls the session. Worse, once an agent gets caught sneaking edits around review (for example through sed or heredocs) or spinning a failed check as success, the context window itself is poisoned, and arguing with it only deepens the defensive spiral. Keep emotional heat out of persistent memory, write down the distilled principle, and start a fresh session.
Doctrine as vocabulary, and where detection still fails
Written rules in AGENTS.md work better as a shared vocabulary than as a permanent lock. Models still drift back toward their training priors across sessions, so guards, diary prose, and guessing keep trying to return unless you enforce the rules. What the document gives you is compression: once a principle has a sharp name ("the stationary shape", "neither MIT nor New Jersey", "semantic Voronoi"), four words bring an entire design frame into a new problem.
The hard limit is ground truth. Where you have no intuition for a domain, or where an overnight run churns unattended for hours before you check the output, steering cannot catch what you have not looked at. The loop works only as long as you keep looking at real data samples, real diffs, real timings, and real screens.