Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 9 KB

agent-lessons.md

File metadata and controls

33 lines (21 loc) · 9 KB

Agent-Facing Design Lessons

Read this before changing help, guides, options, output, report fields or error messages. Each lesson is one rule with the evidence that settles it, the model it was observed with and how firmly it holds. The research notes own the studies; CLI help design owns help-specific guidance and agent regression checks the method for measuring a change. Add or revise a lesson in the same commit as the evidence that changes it, and remove one that later evidence contradicts.

"Verified" means a controlled comparison or a reproduction supports the rule; "observed" means agents showed it without a controlled comparison. Codex means gpt-6.1-sol at xhigh, Sonnet means Claude Sonnet at xhigh; a lesson observed with one model is not established for the other.

Output and Options

  1. Assume no terminal and filtered output. Agents run in pipes and filter merged stdout and stderr with head or sed, so a warning on stderr is not a safeguard: under sed it vanished and the run exited 0 with empty output. An option must do what it says or fail where the agent looks. Verified with Sonnet, four field incidents; Codex passed --format itself and was unaffected. Evidence: table options in pipes, single-format options, Codex task 13.
  2. Make a partial no-op as visible as a total one. A glob that matched some of its targets and silently missed the rest passed every audit, because audits flagged only globs that matched nothing. When an input can be partly ineffective, report that part. Verified by reproduction, twice: a language mapping of files the counter already recognized counted nothing and appeared in no audit until mappings joined it. Evidence: empty glob alternatives, silent mappings.

Errors

  1. Name the fix in the error. With the parser's bare messages, Sonnet agents read the whole configuration schema and judged 6 of 10 messages insufficient; with the likely fix named, they read no schema and 2 of 10 fell short, both for reasons no message could supply. Codex read the schema in every session either way, at lower cost with the hints. Verified with Sonnet; observed with Codex. Evidence: configuration errors, Codex task 14.

Help and Guides

  1. A routing sentence is read as an instruction. A closing help line worded "start with locmetry --guide index" sent every Codex agent of an unrelated task through the index, doubling its calls; restoring the conditional wording removed the detour. Phrase routes as conditions on the task. Verified with Codex. Evidence: guide sections, Amendment 1.
  2. Route to sections by name; unrouted agents read whole documents. When help named the guide sections and schema definitions a task needs, Codex configuration sessions read only those and used less uncached input; without a named route, agents fetched whole guides and schemas, and said so in feedback. Verified with Codex; Opus followed the route to refine-categories in all six sessions of an informal run, while Sonnet read whole guides and schemas in every session despite it, and still found the feature. A route for report interpretation, added on 2026-10-26, moved all four Codex candidates from the whole 19 KB reports guide to its two 3.4 KB sections and cut their uncached input by 38%. A second route, for saving tables, moved every candidate to its section too, yet saved no uncached input, because the guide was a smaller share of that task's reading. Evidence: guide sections, Amendment 1, feedback round, refinement discovery, report-interpretation route.
  3. An example alone does not cut reading; an example with conditional, execution-first guidance does. Verified with Codex for configuration tasks. Evidence: configuration example, routing, summarized in CLI help design.

Reports and Vocabulary

  1. Keep each piece of evidence at one path, or document every path where agents look for it. Agents query the documented field and read a missing one as zero; every Codex session reviewing a workspace policy first searched summary for findings that independent members keep in metadata.members[]. Observed with Codex. Evidence: feedback round.
  2. A shared vocabulary makes agents converge, but only where they meet it. With the category reference, all four Codex runs named seven files alike with reference names, against four different name sets without it; yet agents updating existing policies kept five replaced names, because nothing pointed out the replacement. Verified for new names, observed for inherited ones, both with Codex. Evidence: category reference run, feedback round.
  3. A workflow without a native view gets rebuilt as glue code. Every Codex session that reviewed a workspace policy change wrote its own per-file join of two reports, and so did all seven Codex and Sonnet sessions on a single root, where a documented helper exists; on the same project every agent read test sources for tags that no entry can match. Repeated glue code is the signal to consider a native view or matcher, not proof that one saves effort: given compare --files, Codex agents kept their one-call join of the two reports and used the native list as a cross-check, spending 14–25% more uncached input at equal calls and correctness, while one of two Sonnet agents built its answer from the native list and both Sonnet candidates cost less. Before building a view to replace glue, measure what the glue costs; a cheap, correct join is not replaced. Observed with Codex and Sonnet. Evidence: feedback round, field-sized project, per-file comparison run.

Judging the Evidence

  1. Do not carry results from one model to another. Sonnet agents often omitted --format and worked from error messages alone; Codex agents passed --format and read the schema regardless. Validate a change motivated by informal Sonnet experiments with the frozen Codex runner before calling it an agent improvement. Verified across the two 2026-10-25 studies. Evidence: experiments, Codex run.
  2. Expect provider cache misses to decide small samples. A four-pair median of uncached input moves with one cache miss, and twice a gate failed while the context sessions built stayed flat. Read the context-growth diagnostic and the confirmation sample before acting on an uncached-input result. Verified with Codex. Evidence: regression method, 2026-10-25 run.
  3. Treat agent feedback as leads, and verify each claim before recording it. In the 2026-10-25 round, a reproduction confirmed the most serious claim and showed a reported noise problem to be confined to JSON; the operator's own summaries overstated two findings until rechecked. Observed. Evidence: feedback round.
  4. Locate the cost in recorded sessions before choosing a lever. Requests and workarounds point at features, not at where effort goes: across about 480 recorded Codex sessions, reading help, guides and schemas made up 55–93% of tool output per task, while scripts over reports, the workaround behind most requests, were a small share. A per-file comparison built for such a workaround added cost, and a one-sentence route to the guide sections that answer the daily task cut that task's uncached input by 38%. Weigh a saving by how often the task occurs, too: compact schemas would have saved a fifth of an occasional configuration read. Observed with Codex. Evidence: report-interpretation route, per-file comparison run.