Skip to content

perf(planning): cut the interview's repeated loop.md reads and plugin-file listing - #18340

Closed
kyle-sexton wants to merge 2 commits into
mainfrom
perf/interview-efficiency
Closed

kyle-sexton wants to merge 2 commits into
mainfrom
perf/interview-efficiency

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

No related issue: follow-up to #17965's efficiency findings (owner: "I want all variants and forms of this skill to be operating as efficiently as possible").

Hold: eval regressions on the touched cases (below); not to merge until they are fixed or the owner decides.

Summary

In the redesign's eval traces the interview skill spent turns on avoidable reads: 48 ls, 6 wc, 6 sed and grep over its own plugin directory (one voided a run), and context/loop.md read whole 12 times plus 14 chunked rereads, because loop.md (80 KB) exceeded one Read. This change aims to remove both.

Fix

  • context/survey.md: loop.md's "Step 1. Survey before you ask" and "Engineering defaults" sections, moved verbatim (only the "Unattended path" pointers re-aimed). loop.md drops from 80 KB to 70 KB and comes back from one Read.
  • SKILL.md: the spoke-path map moves up and names every file and script by its ${CLAUDE_PLUGIN_ROOT} path, with a rule not to list, count or grep the plugin and to read each file once per session; SKILL.md and routing.md say "read once at entry, apply at every round boundary".
  • One re-pin (SKILL.md Stance section; digests in the commit message). Defenses 185/0, reattach-slice 25/0, check-round-codes all pass.

Verification

Eval runs on this head (opus-5-5, sonnet judge), the 9 cases whose graded behavior reads the edited text, against the latest new-skill runs before the change:

Case Before This head
quality-bar-stated-prototype PASS FAIL x3 (one run took the skip-the-interview route at 5 turns)
coded-terms-round-answerable PASS FAIL x3 (answerable-without-session)
intent-asked-recorded PASS 2 of 3 1 of 3
consumer-standard-override, intent-unattended-blocked, nfr-quality-requirement, quality-bar-stated-production, term-clash-qualified-name PASS PASS
intent-prototype-one-line FAIL (fails on both skills) FAIL

Single runs on the 9: median turns 29 -> 27, median cost 1.38 -> 1.50 USD (list price): no cost saving shown.

Bisect and baseline, 3 runs each, all VALID:

Build quality-bar-stated-prototype coded-terms-round-answerable
this branch's base 555ae87eb1 3 of 3 not run
main c783b51481 (later main, includes #18236) 2 of 3 0 of 3
efcfdb4f7c only (survey split + path map, no routing read-once) 0 of 3 0 of 3
this head 0 of 3 0 of 3

Next step: rerun quality-bar-stated-prototype with the survey split reverted (loop.md whole again, the moved path block kept) to tell those two apart.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh

kyle-sexton and others added 2 commits November 22, 2026 22:53
…ery spoke path

Eval traces showed loop.md read whole 12 times plus 14 range rereads, and
48 ls, 6 wc and 6 sed calls over the plugin's own files. loop.md was 80,169
bytes (27,561 tokens), past what one Read returns, so every whole read came
back partial and was finished in ranges. Rounds that needed only the
engineering defaults or the glossary fallback loaded all of it.

- context/survey.md now holds loop.md's "Step 1. Survey before you ask" and
  "Engineering defaults" sections, moved verbatim (two "below" pointers now
  name loop.md "Unattended path"). loop.md drops to 70,368 bytes and reads
  in one call; SKILL.md Purpose, Stance item 4 and nfr-prompts.md point at
  survey.md.
- SKILL.md "Spoke paths" moves under Variables and maps every link form and
  the four bare script names to exact ${CLAUDE_PLUGIN_ROOT} paths, with one
  rule: read each file once per session and keep it.

Re-pin (plugins/planning/tests/interview-defenses.test.sh):
- "SKILL.md Stance section is unchanged (the in-round no-silent-resolve rule
  lives here)": 3186a92e888b864d54c9226e7a4144772ce7932e69eb27f7a2cd705f5a0469ce
  -> 52931addcf0b17d61e97cb03a8971e3c659486cd97ad1a5f2198265780ceb313.
  The only change in the section is Stance item 4's pointer for the glossary
  fallback, from loop.md to context/survey.md, which holds the same text
  verbatim. No rule in the section is added, removed or qualified, so the
  no-silent-resolve defense and every phrase pin in it are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh
SKILL.md "Routing by size and fog" and routing.md's preamble told the model
to read routing.md at entry and again at every round boundary, which
contradicts the read-once rule in "Spoke paths". Both now say read it once
at entry and apply it at every round boundary; the boundary checks are
unchanged. Neither line is inside a digest-pinned region.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015XWwmeDkiEnVmSx4dtkkfh
@kyle-sexton

Copy link
Copy Markdown
Member Author

Closing by the owner's Q4 decision ("fix or close by the result"). Bisect on quality-bar-stated-prototype: base 555ae87 3/3; this PR 0/6; without the two read rules 0/3; with loop.md kept whole (survey split reverted, spoke-paths block and read-once rules kept) 1/3. No variant restores the base result, and the PR measured no saving (median turns 29 -> 27, cost per run 1.38 -> 1.50 USD). The efficiency idea can return as a new change measured in CI compare mode (docs/review/evals.md).

@github-actions
github-actions Bot deleted the perf/interview-efficiency branch November 24, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Hard merge gate: do not merge while applied.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant