R387 · Harness tips › Harness tips

Planning as a committable artifact, and the three places the recipe is fragile

Read the original

agent-harnesscoding-agentshuman-verificationharness-tipsdocumentationspecifications

Source: a three-minute screencast walking one support-ticket change through a coding agent's plan mode, ending with a specification committed to the repository and no source touched. Claims below are checked against the agent's own published permission-mode documentation and, for the version-control steps, against a local reproduction.

The idea worth keeping

The worked example is small and the point is sharp. A customer writes "this is not urgent." A proposed keyword rule scans for urgent, finds it, and files the ticket as high priority. The negation is invisible to the rule.

That defect is cheapest to catch while the change is still a paragraph of prose. Once it is a function with tests around it, fixing it costs a code change, a test change, and a review. So the walkthrough does something most agent demonstrations skip: it stops at the plan, writes the plan to a file in the repository, commits that file, and ends the session with zero lines of source changed and the test suite in exactly the state it started in.

The artifact that comes out is not a plan in the agent's scratch space. It is docs/specs/priority.md, in version control, where a teammate cloning the repository can read how the proposed function would have handled the ticket — including the decision that it would have got it wrong.

Architecture: what plan mode actually constrains

The agent's documentation describes plan mode as: "Plan mode tells Claude to research and propose changes without making them." It reads files, runs shell commands to explore, and writes a plan, "but does not edit your source." Entry is Shift+Tab until the status bar reads ⏸ plan mode on, or a single prompt prefixed with /plan. Edits "stay blocked until you approve the plan" except in interactive terminal sessions where bypass permissions are available.

Two things in that description matter more than they look.

The constraint is on editing your source, not on writing. The phrase read-only is never used of plan mode in the documentation. The permission table's row for plan reads "Reads, plus classifier-approved commands when auto mode is available." Whether the agent may create a new, non-protected file during planning is not stated anywhere — not blocked, not prompted, not allowed. The walkthrough resolves the question empirically: the agent asks to create the spec file, the operator approves that one file, and the status bar still reads plan mode afterwards. That is the most useful thing in the source, precisely because it is evidence about behaviour the documentation leaves open.

The mode cycle is not a fixed-length ring. The documented cycle runs default → acceptEdits → plan, but from auto the first press switches to default first, and two further modes appear in the cycle only "when available." So the narrator's advice — press Shift+Tab until the label says what you want, and never count presses, because your starting mode can differ — is not fussiness. A press count is genuinely unsafe across machines and configurations. Reading the displayed label is the only correct stopping rule.

The verification step, which is the part to copy

After the spec file exists, the walkthrough proves what changed with two commands rather than one:

The stated reason is that a plain diff skips untracked files. This reproduces exactly. In a fresh repository with one committed file, creating docs/specs/priority.md leaves git diff completely empty while git status --short prints ?? docs/ — the directory, not the file, which is also what the narration says. Stage and commit the one path, and git status --short goes empty again; the commit stat reads one file changed.

This is the discipline that makes the exercise checkable instead of merely demonstrated. An agent session that claims to have touched nothing is asserting something, and git diff alone cannot falsify it for newly created files. Both commands, every time.

The closing instruction is also well judged: compare the number of changed files against the reference tag, not the line count. Line counts out of a generative plan are prompt-dependent and will differ run to run. File count is the property the exercise is actually testing.

Three places the recipe is fragile

1. The approval prompt does not work the way it is described

The narration says that at the plan-approval dialog, Shift+Tab approves the plan with your feedback and can start the build. The documentation describes that prompt as a short list of choices — approve and run automatically, approve and review each edit individually, or keep planning — and Shift+Tab is not among them. The only documented Shift+Tab behaviour at that point is the opposite: "Press Shift+Tab again to leave plan mode without approving a plan."

The documented way to amend a plan before proceeding is a different key entirely: "Press Ctrl+G to open the proposed plan in your default text editor and edit it directly before Claude proceeds."

A viewer following the narration is reaching for a key that, on the documented behaviour, abandons the plan rather than approving it.

2. "Choose option 3" is keyed to a position that moves

The companion instruction tells the viewer to choose option 3 at a specific timestamp. The choices are presented as a list, not numbered, and — this is the problem — the list is not a fixed length. A documented setting adds "a first option" to the list that approves the plan and clears the planning context.

With that setting off, the third item is keep planning — what the walkthrough wants. With it on, every item shifts down by one and the third item approves the plan and starts editing. A recipe pinned to an ordinal position silently inverts from "do not implement this" to "implement this" on a configuration flag the reader may not know they have.

This is a general lesson about agent tutorials, not a quibble about one video. Instructions for an interactive agent should name the choice, never its index. The text of an option is stable; its position is a function of the reader's settings.

3. The built-in place for plans goes unmentioned

The agent already persists plans. The documentation's protected-directories section carves out an exception for "The current session's own plan files in ~/.claude/plans/, or in the plansDirectory you set", and Ctrl+G already opens the current plan in an editor.

The hand-rolled route — instruct the agent to write the plan to docs/specs/priority.md — is still defensible on its own terms, and the walkthrough's goal makes the case: a session-scoped plans directory is not in the repository, so a teammate cloning the project cannot read it, and it is not in the review history either. But the viewer is never told the built-in mechanism exists or why it was passed over, which leaves them unable to tell whether they are learning a technique or a workaround.

Failure modes to watch for

FailureHow it shows upGuard
Ordinal drift in a recipeA step that said "don't implement" starts implementingName the option's text, never its number
Press-counting into the wrong modeSession is in acceptEdits while you believe it is planningRead the status bar label before every prompt
Untracked file invisible to git diffA session reports "nothing changed" while adding filesAlways pair git diff with git status
Plan written where nobody will find itDecision is captured but not reviewablePut the artifact where review already happens — the repository
Mistaking planning for a read-only guaranteeA write lands during a phase assumed inertTreat "does not edit your source" as narrower than "writes nothing"
Pinned tool version in the instructionsRecipe quietly diverges from current behaviourRe-verify key bindings and prompts against current documentation, not the recording

Review checklist

For a planning step that is meant to produce a committable artifact:

  1. Does the session end with source and tests provably untouched, shown by both git diff and git status?

  2. Is the plan stored where code review will see it, or only where the agent can see it?

  3. Does the plan record the decision that was questioned, not just the file list? The value here was a sentence about how a keyword rule mishandles a negation.

  4. Does the written procedure identify interactive choices by their text rather than their position?

  5. Does it name the key bindings and status strings it depends on, so they can be re-checked against current documentation?

  6. Is the test count before and after the step stated explicitly, so a reader can tell whether the step was inert?

  7. Would a teammate, reading only the committed artifact, learn why the change was not made?

Where this stops being useful

The example is a single-decision change — one keyword rule, one negation, one spec file. The economics of "fix it in the plan" hold most strongly there. A plan that spans a dozen files is itself a document requiring review, and review effort scales with it; at some size the cheapest fix really is in the code, where the type checker and the test suite help. The source does not probe where that boundary falls, and the three-minute format does not leave room to.

It also demonstrates on a project built for the exercise, with five passing tests and a clean tree at the start. That baseline is what makes the "nothing changed" proof legible. On a repository with existing uncommitted work, the same two-command check is noisier and the discipline is harder to hold.

Connections

See R387 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.