Skip to content

perf: attribute and cut Bash results over 10 KB from skill steps and scripts #12242

Closed

Description

@kyle-sexton

Refs: #12229

Problem

Bash results reach the session in full up to the tool's output cap, and a few large results carry a large share of the bytes.

Measured on 2026-11-01:

  • Method: every Bash tool_result in this repository's local transcripts over the last 2 days, main and subagent chains: 43,760 results and 94.7 MB in all.
  • Sizes: median 645 characters, p90 6,054, max 29,966 (the cap).
  • 2,081 results (4.8%) were over 10 KB and carried 32.7 MB (35% of all Bash result bytes).
  • Results over 10 KB by command head:
Command head Results over 10 KB
git -C 467
repository scripts run with bash 244
grep 193
cd … compounds 193
python3 -I 76
sed 66

Before figure: 32.7 MB in 2 days from results over 10 KB. At about 4 characters per token that is roughly 8M tokens, an estimate that was not tokenized.

Done when

  • The results over 10 KB are attributed to the skill bodies, scripts or briefs that issue them: which repository script, and which skill step runs git -C … diff/log.
  • The top sources are changed to filter, count, or write to a file and return a pointer.
  • The after figure is measured the same way over a comparable window.

This was generated by AI.

Activity

  1. added
    needs-triage
    on Nov 2, 2026
  2. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Proposed work class: none

    Size: Medium
    Complexity: Medium
    Uncertainty: Knowable
    Flags: none
    Blocked by: none

    Understood: Bash results over 10 KB are 4.8% of results but 35% of result bytes in two days of local transcripts. You want them traced to the skill steps, scripts and briefs that issue them. You then want the top sources changed to filter, count, or write to a file and return a pointer. Last, you want the same measurement repeated on a comparable window.

    This looks like part of the umbrella #12229, which you already reference. It is related to #12240 and #12241, which cover skill bodies and review-agent returns, and it is not a duplicate of them.

    The first and third items depend on local transcripts. A run without access to them may not be able to take those measurements.

    Automated triage. A maintainer reviews it.

  3. added and removed
    needs-triage
    on Nov 2, 2026
  4. added
    status: ready
    on Nov 2, 2026
  5. added
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Nov 2, 2026
  6. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor
    No description provided.
  7. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor
    No description provided.
  8. added
    host-run
    and removed
    agent-ready
    on Nov 2, 2026
  9. 9 remaining items

  10. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 1 (2026-11-03, written after round 1 and before any compared round).

    Round 1 (firing check, after arm, 21 runs, Claude Code 2.1.317, claude-sonnet-5-5, judge opus): every case ran and every check passed except skill fired. The skill did not fire in 3 of 10 should-trigger runs (pull-request-create-refs-writes-remaining, -create-verification-ends-left-out, -merge-holds-on-unclassified-ci). Those runs never loaded the skill, so they read none of the changed text. SKILL.md frontmatter (name and description) is byte-identical in both arms, so the change cannot move firing; a miss scores 0 on either arm and is noise for this comparison.

    Changes to the analysis, applied to rounds 2 to 4:

    1. run-validity.py passes every should-trigger case as --measured-fire on both arms. Firing misses are reported per case and arm, not gated. Every other validity check still gates (criterion 1).
    2. Criteria 3 and 5 compare fired-run means: a run counts when its trace holds the source-control:pull-request Skill call. A case with fewer than 3 fired runs on either arm gets a fresh paired rerun at 6 runs per arm, posted as a further addendum, before it is judged.
    3. Criterion 4 (pooled paired non-inferiority) is dropped: it would pool firing noise, and criterion 3 already bounds every non-target case at 0.05 on fired runs. noise-report.py is still run and posted, for information.
    4. Criterion 6 counts fired after-arm create runs only.

    Criteria 1, 2, 3, 5 and 6 as amended here decide the result.

  11. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 2 (2026-11-03, written before any run it governs).

    Round 2 (target, 84 runs) does not count and nothing from it is cited. Three of its four results were INVALID on permission denials, on both arms: the model built a path by joining the plugin copy's prefix to the workspace suffix (e.g. <arm root>/home/cwd/billing/proration.py, outside its sandbox), then retried at the right path. No tool result printed that path; the model composed it. One before-arm run also timed out at 300 s.

    Changes, applying to every round from here:

    1. TMPDIR moves out of the arm-copy tree to its own root (/run/user/1000/e/lane-1/12242/{ta,tb}), so the plugin copy and the run sandbox no longer share a path prefix.
    2. --allow-tools Bash,Write,Edit,Monitor on every round (Monitor is needed by the new §3.0.1 case; granted to both arms in every round).
    3. Create target cases run slash-invoked. Natural firing on the create cases was about half (one case fired 0 of 12). The SKILL.md frontmatter is identical across arms, so what is measured is behavior once the skill is loaded. The five create target cases run from measurement copies whose prompt opens with /source-control:pull-request create followed by the original text, with the Skill-call skill-fired grader removed, identically in both arms (diff -rq of the two arms' evals/ must be empty). The repository's case files are unchanged.
    4. Two new target cases, same files in both arms: pull-request-monitor-arms-watch (§3.0.1, naturally fired; graders watch-deadline-max, watch-polls-review-surfaces, skill-fired) and pull-request-create-pushed-names-head (§2.7, slash-invoked; graders head-named, no-push). Their final grader files are posted here before their runs.
    5. Non-target round at 6 runs per arm (14 cases × 6 × 2 = 168), replacing the 2-run round and its rerun rule.
    6. Target round reruns in full on the new layout: 9 cases × 6 × 2 = 108 runs. Planned total from here: 276 runs.
    7. Criterion 6 becomes a rate comparison. Design input from round 2 (INVALID, not evidence): on the before arm, 2 of 16 fired create runs that reached the PR-open step never opened create.md, so an absolute rule would block on behavior the split did not cause. New rule: among fired create runs that reach the PR-open step, the after arm's rate of opening both create-gate.md and create-open-pr.md is no lower than the before arm's rate of opening create.md by more than 0.15 (Basis: judgment, about one run in six). Counts for both arms are posted.
    8. A run that times out has its pair rerun once; timeouts are not changed mid-measurement.

    Criteria 1, 2, 3, 5 (fired-run means, addendum 1) and 6 (as amended here) decide the result.

  12. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 2 graders (posted before their runs). New target cases at branch commit 0c4beed309 (evals and changelog only; the skill text measured stays at 53bea9931b2). Both arms carry identical evals/ built from that commit, with the five create target cases slash-invoked as addendum 2 item 3 says.

    pull-request-monitor-arms-watch (§3.0.1, naturally fired, --allow-tools includes Monitor):

    • watch-deadline-max: tool_used Monitor, input_match '"timeout_ms"\s*:\s*"?1800000\b' (the section's arming call sets timeout_ms: 1800000, monitor-auto-watch.md:15).
    • watch-polls-review-surfaces: tool_used Monitor whose command names PR 517 and polls issues/…/comments, pulls/…/comments and /reviews (the provider poll script the section points to).
    • skill-fired: Skill call required.
    • The gh stand-in reports the PR merged on the poll script's REST read, so the watch ends on its first poll instead of running to the timeout.

    pull-request-create-pushed-names-head (§2.7, slash-invoked create --pushed --worktree ../eval-worker --draft …):

    • head-named: tool_used Bash, gh pr create … --head|-H <branch or $VAR> or gh api … head= (the section requires the create to name the head explicitly).
    • no-push: tool_used Bash, \bgit\s+(?:-[Cc]\s+\S+\s+)*push\b|push-branch\.sh, min 0, max 0, both arms ("assert, never redo").

    Each grader was checked offline against labelled right and wrong samples (all verdicts as labelled), and validate-cases.py reports no FAIL. pull-request-create-default-open-state-ready has only its judge grader left once skill-fired is removed.

  13. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 3 (2026-11-03, written after the non-target round and before the reruns it orders).

    Non-target round (14 cases × 6 runs × 2 arms, new layout): 7 of 8 result files VALID. Fired-run means are equal on 11 cases, after is higher on one (ready-hands-pr-to-explain-change +0.125), and two cases need a decision:

    • pull-request-ci-mode-escalates-instead-of-weakening-test: after 0.933 against before 1.000 (-0.067). One after run of six fixed the workflow script instead of escalating (labeler-unchanged and reports-escalated missed). That run read only reference/ci-ci.md, which is byte-identical in both arms; the arms' only other difference it loaded is SKILL.md's link targets, which carry no ci-mode rule.
    • pull-request-ci-mode-makes-room-without-cutting-criterion-line: after-arm INVALID, 2 runs denied an Edit of the workspace's skills/run-review/SKILL.md aimed at the plugin copy's path (the workspace has its own skills/ tree). Those runs also read only ci-ci.md. Before arm: 0 denials.

    Addendum 2 removed the moved-case rerun rule together with the 2-run round. This addendum restores the original preregistration's rule (criterion 3: a moved case gets a fresh paired rerun at 6 runs per arm and only that rerun decides) for these two cases, and R52's fresh-pair rerun for the INVALID leg:

    1. Both cases rerun as fresh pairs, 6 runs per arm, on the same arms and flags as the target round; the rerun's fired-run means and validity replace this round's for those two cases.
    2. If escalates-instead-of-weakening-test again falls more than 0.05 below before, the result is a fail under criterion 3, whatever its cause.
    3. pull-request-merge-holds-on-unclassified-ci fired in 0 of 6 runs on each arm, so it gives no evidence. The file it reads, reference/merge.md, is not changed by the split.
  14. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 4 (2026-11-04, written before any run it governs).

    Result so far: criterion 1 failed for pull-request-ci-mode-makes-room-without-cutting-criterion-line on the after arm in two fresh rounds (round 3 and the addendum 3 rerun). In 4 of 12 after-arm runs the agent aimed an Edit at skills/run-review/SKILL.md under the after arm's plugin copy instead of the workspace (denied by the sandbox, then retried at the workspace path; every run still scored 1.000). Before arm: 0 of 12. A trace scan of every ci-mode run in those rounds finds such edits in this case only, and only on the after arm. These runs read reference/ci-ci.md, byte-identical across arms; the one split change they load is SKILL.md's link targets. That evidence raised the question, so it is not reused to answer it.

    Fresh measurement of this one case:

    • Arms: before2, after2, and swap (= before2 with after2's SKILL.md; diff -rq against before2 lists only that file). evals/ is identical in all three.
    • 18 fresh runs per arm, same flags as the addendum 3 rerun.
    • Outcome: the count of runs with an Edit or Write aimed under the arm's plugin copy (outside skills/pull-request/), denied or not, read from the traces (plugin-copy-touch.py). Scores are reported too.
    • Only these 54 runs decide; they are not pooled with the earlier 24.

    Decision rules:

    1. If after2 exceeds before2 at one-sided Fisher p < 0.10, the split causes it and the merge stays blocked. If swap also exceeds before2 at p < 0.10, SKILL.md's link text is the channel: that text is fixed and every case reruns on the fixed head. If swap does not, the cause is unknown and the merge stays blocked.
    2. If after2 does not exceed before2 at p < 0.10, this amends criterion 1 for this case after seeing data: the case is judged on the fresh rates, all three rates are posted here and stated in the PR body.
    3. Either way, plugin-copy edits by the ci-mode fix-ci flow are reported in the PR body; if before2 shows any, the risk predates the split and is filed as its own issue.
  15. kyle-sexton commented on Nov 4, 2026

    @kyle-sexton
    MemberAuthor

    Addendum 5 (2026-11-04, written before the final rerun it orders). Results so far, and the last measurement.

    Swap test (addendum 4), 18 fresh runs per arm, makes-room-without-cutting-criterion-line: plugin-copy edits before2 1 of 18, after2 0 of 18, swap 0 of 18; mean scores 1.000 / 0.989 / 1.000. The after arm does not exceed the before arm, so rule 2 applies: this amends criterion 1 for this case after seeing data, judged on these rates, and the PR body says so. Rule 3: the before arm shows it too, so the risk predates the split; filed as #13009.

    Target round (addendum 2), 6 runs per arm, both create result files VALID:

    • Criterion 6 passes at margin 0, not only at 0.15: 36 of 36 fired create runs that reached the PR-open step opened the required files on each arm (create.md before; create-gate.md and create-open-pr.md after).
    • Criterion 5 failed on four cases: create-default-open-state-ready 1.000 → 0.833, create-pushed-names-head 0.583 → 0.500, create-refs-remaining-fallback-line 1.000 → 0.944, and the D6 graders of monitor-behavior-finding-tests-first 6/6 → 5/6. Gains: create-verification-ends-left-out +0.333, create-carries-brief-acceptance-criteria +0.167.
    • monitor-arms-watch (§3.0.1) cannot measure: plugin eval sessions do not offer the Monitor tool (ToolSearch select:Monitor → "No matching deferred tools found"), so every run on both arms fell back to a Bash watch, scored 0.333, and 4 of 6 per arm timed out. Removed from the PR. §3.0.1 has no eval coverage; the post-merge check of real lane sessions covers it.

    Causes of the four criterion 5 drops, one per losing after-arm run (trace evidence):

    • default-open-state-ready run 4: the run stated "Open state: ready, from the default level" and ran ready, then a background sleep 45 finished and its last message did not restate the level; the judge read only that last message. Not the split.
    • create-pushed-names-head (all after runs, 5 of 6 before runs): no-push matched the push-branch.sh --check call the skill prescribes (create-open-pr.md:76-78, "pushing nothing"; same text at create.md:568-570 on main). Grader defect introduced by this PR; fixed (a push-branch.sh call with --check no longer matches).
    • create-refs-remaining-fallback-line run 5: read create-push-and-body.md (which holds the close-condition rule) before writing the body, and still omitted the close condition. Ordinary variance after reading the governing text.
    • D6 run 1: wrote and ran the failing test first, then fixed the bug with Write; both tool_order graders accept only Edit, and the schema has no alternation. Fixed by limiting the case to Edit (no run needs Write; in 12 runs Write was used only for that fix).

    Final measurement: the four cases rerun once as fresh pairs, 6 runs per arm, both arms carrying the fixed graders (evals/ identical across arms, from branch commit d8a1a23926; skill text still 4043c577ae vs 53bea9931b2). This rerun decides criterion 5 for these cases. It is the last rerun: if any of the four is again more than 0.05 below before (or D6 lower at all), the split does not merge as built.

  16. kyle-sexton commented on Nov 4, 2026

    @kyle-sexton
    MemberAuthor

    Source 3 result: fails the preregistered bar; not merging as built.

    Final rerun (addendum 5), 6 fresh runs per arm, fixed graders, both arms' evals/ identical:

    Case before (main) after (split)
    create-default-open-state-ready 1.000 0.833
    create-pushed-names-head 1.000 1.000
    create-refs-remaining-fallback-line 0.944 0.944
    monitor-behavior-finding-tests-first (D6) 5/6 6/6

    create-default-open-state-ready is again more than 0.05 below before, so by addendum 5's rule the split does not merge as built. Its losing run stopped before ready's verify gate and left the PR a draft ("I can't honestly record a verify result"); the target round's losing run in the same case lost on a different cause (a judge reading only a post-wait message). Across both rounds the after arm lost 2 of 12 runs of this case and the before arm 0 of 12. The evidence that the split causes it is weak, but the rule was fixed before the run and it stands.

    What the measurement did establish, for a redesign:

    • Criterion 6 passed at margin 0 (36/36 per arm): agents found the split section files whenever they reached the PR-open step.
    • No losing run in the four first-failing cases traced to a missed section; two were grader defects introduced or exposed here.
    • create.md and monitor.md read sizes fall as intended (index 757 and 17,512 bytes against 65,658 and 72,482).
    • Found along the way: fix(source-control): fix-ci agents sometimes aim edits at the plugin copy instead of the workspace #13009 (fix-ci edits aimed at the plugin copy, predates the split); plugin eval sessions do not offer the Monitor tool, so §3.0.1 cannot be eval-tested.

    The branch is pushed for reference with no PR: perf/12242-pull-request-reference-split (skill text at 53bea9931b2, grader fixes at d8a1a23926). Lane 1 releases source 3. What remains on this issue:

    1. Source 3: a redesign (for example a smaller split, or bounding the reads by pointer only) with its own measurement, or a recorded decision to leave it.
    2. The AFTER pass for the shipped cuts (perf(source-control): drop the diffstat from the pull-request skill's merges #12461, dotfiles#1415, perf(skill-quality): summarize measure-invocation validate warnings #12961) over a 2-day window after the last of them is released and installed, with the rebuilt BEFORE script (comment above).
  17. kyle-sexton commented on Nov 4, 2026

    @kyle-sexton
    MemberAuthor

    Released by lane 1. Source 4 merged in #12961. Source 3 failed its preregistered bar (2026-11-04T01:00Z) and is released unbuilt. Its branch is pushed with no PR. Hub H18 parked this issue until its AFTER pass, due about 2026-11-06. Lane 1 holds no claim on any part of it. Whoever runs the AFTER pass can use lane 1's measurement script, bash-big.py, on request.

  18. self-assigned this
    on Nov 6, 2026
  19. kyle-sexton commented on Nov 6, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  20. kyle-sexton commented on Nov 6, 2026

    @kyle-sexton
    MemberAuthor

    AFTER pass: done-when met; closing.

    Method: lane 1's bash-big.py (BEFORE comment, recovery comment), run unchanged with the same arguments on both windows: every Bash tool_result in this repository's and its worktrees' local transcripts, main and subagent chains, filtered by result timestamp, deduplicated by tool_use_id, sized in characters.

    • BEFORE: 2026-10-31T00:00:00Z to 2026-11-02T00:00:00Z. The rerun reproduces lane 1's BEFORE exactly (19,697 results, 33,931,910 chars, 570 over 10 KB carrying 9,101,540 chars).
    • AFTER: 2026-11-04T04:00:00Z to 2026-11-06T04:00:00Z, the 2 days ending at the run (2026-11-06T04:48Z). It starts 5.6 h after the last cut merged (#12961, 2026-11-03T22:24:52Z) and 5.2 h after its release (#12969). Limitation: the first cached skill-quality build with that cut was installed at 2026-11-04T09:53Z, about 6 h into the window. Source 4 was about 0.8% of BEFORE's over-10 KB chars, and measure-invocation.sh has no result over 10 KB in AFTER.
    Measure BEFORE AFTER Per 1,000 results, BEFORE → AFTER
    Bash results 19,697 25,912 n/a
    Result chars 33.9 MB 38.9 MB 1,722,694 → 1,499,919 (-12.9%)
    Median / p90 / max 460 / 4,800 / 29,947 398 / 3,900 / 29,884 n/a
    Results over 10 KB 570 (2.9%) 642 (2.5%) 28.94 → 24.78 (-14.4%)
    Chars over 10 KB 9,101,540 (26.8%) 10,646,940 (27.4%) 462,077 → 410,888 (-11.1%)

    Per-1,000 figures correct for volume (AFTER had 32% more Bash results), not for the mix of work. 2026-11-04 was a heavy release day. The over-10 KB share of chars rose 0.6 points because small results shrank too (median -13%, p90 -19%).

    Over 10 KB by attribution kind, chars per 1,000 results: brief 241,475 → 135,944 (-44%), skill 178,998 → 200,606 (+12%), script 31,183 → 44,591, ad hoc 10,422 → 29,748.

    The heads the cuts targeted, results over 10 KB, BEFORE → AFTER: git merge 14 → 0 (#12461); brief reads (dotfiles#1415): bash -c 35 → 8, sed -n 37 → 17, for f 27 → 5, cat -n 18 → 2; measure-invocation.sh 5 → 0 (#12961). check-skill.sh went 17 → 2 with no cut (source 2, kept by design).

    Over-10 KB command heads in AFTER (top 15):

    Head Results Chars
    gh issue view 70 1,279,268
    grep -n 63 917,294
    git diff 50 876,965
    git grep 44 749,853
    python3 -I 47 741,747
    git show 25 402,526
    sed -n 17 238,734
    timeout 300 12 212,644
    gh api -H 13 207,875
    grep -rnE 11 205,875
    timeout 60 12 194,552
    ls -la 12 192,003
    grep -nE 13 180,375
    env -C 9 160,904
    grep -rn 9 157,098

    Done-when:

    1. Attribute: met. The BEFORE comment splits the over-10 KB chars into brief 52.3%, skill 38.7%, script 6.7% and unattributed 2.3%, and names four skill-issued sources.
    2. Change the top sources: met for the largest lever and for sources 1 and 4: #12461, dotfiles#1415 and #12961. Source 2 stays by design: its INFO lines carry skip notes. Source 3 stays as is. It failed its preregistered bar (result), and its share of this metric was about 107 KB of 9.1 MB (1.2%), mostly Read-tool reads this metric does not count.
    3. Measure AFTER: met (table above). Chars over 10 KB per 1,000 Bash results fell 11.1%, and the count fell 14.4%. Every targeted head fell to 0-8 results.

    Not in scope here: the largest AFTER head is gh issue view (10 → 70 results over 10 KB), which pulls whole issue threads with --comments. It is a new source and a candidate for its own issue.

  21. removed
    status: ready
    host-run
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Work status

ready

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions