Skip to content

feat(context-budget): warn on a Skills row at the default 1 listing budget - #11676

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-7231-41231397747-1
Oct 31, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-7231-41231397747-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7231

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Builds the owner's recorded decision (option A, 2026-10-18): the live breakdown marks the Skills row in the 'warning' theme key when it holds 1% or more of the window, a fixed constant with no userConfig option. In the pane, a line under the row names the fix (/skill-doctor, skillListingBudgetFraction). In the band, the warned Skills entry is drawn as its own Text in that color, and the fix text stays in the pane because the one-line legend has no room for it. Basis for the 1%: the skills docs say the listing budget 'scales at 1% of the model's context window' and counts characters, while the row counts tokens, so the warning compares the row's token share with 1% and does not claim the two sizes are equal (stated in the code comment and README). The engine gives Skills no kind of its own (kind is shared by all used rows), so this one check matches on the name 'Skills'; the types comment says so. No other category gets a warning, and context-guard is untouched.

Not verified

  • The mod test suite (claude plugin test over context-budget.test.ts) and tsc did not run here: check-affected skips 'claude plugin test (mods)' because it runs code from the checked tree. Left to the PR's CI.
  • typos was skipped by check-affected because it is not installed in this lane.
  • In a narrow band with the warning on, the legend is three truncating sibling Texts, so it may truncate per piece instead of cutting one line at the end. No test covers that case, and it was not rendered live.
  • The band warns by color alone; plugins/user-interface/reference/types/mods.md asks that a band status also be in words. The issue's refined criteria allow color alone in the band when the pane names the fix, which it does.
  • Tidy: passes 1-4 ran (one cast removed in Legend; no comment deletions; no residue edits; README paragraph reworded). Pass 5 (ai-slop:audit fix) ran as a manual rubric read only, because detect.sh and digest-guard.sh are not among the scripts this lane may run; no AI-writing tells found.
  • The 'Skills' category name and kind come from the docs and the existing code; no live interactive session was run to confirm the engine names the row exactly 'Skills'.

Fix

  • plugins/context-budget/hooks/parts.tsx: SKILLS_WARN_PERCENT (1, cites the docs and levers.json skill-listing-budget), exported SKILLS_FIX text and a warns() predicate. The pane colors a warned Skills row 'warning' and adds the fix line under it. A new Legend helper keeps the band legend one plain Te
  • plugins/context-budget/hooks/context-budget.test.ts: skills-over (10k of 1M = 1%) and skills-under (9k = 0.9%) fixtures taken from the free space; four tests cover pane color plus fix line, pane below 1% unchanged, the band entry colored with no fix text, and the band below 1% still one plain line.
  • plugins/context-budget/types/index.d.ts: the 'branch on kind, not name' comment names the Skills warning as its one exception.
  • plugins/context-budget/README.md: new 'Skills warning' paragraph in Live breakdown: threshold, pane and band behavior, fixed with no option, the characters-vs-tokens caveat, the rounding note, the docs pointer with as-of date and recheck trigger.
  • .changes/context-budget/work-resolve-issue-issue-7231-5d2e9b14.md: minor changelog fragment for the warning. Written by hand because new-changelog-fragment refuses to run on a detached HEAD; the name follows the existing work-resolve-issue-issue-<n>-<hex> pattern.

Verification

The runner ran each check from the base copy against f920fcf:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //code.claude.com/docs/en/skills: 'Skill descriptions are cut short' says the listing's character budget 'scales at 1% of the model's context window', that the Skills row in /context reports the listing after the budget, that skillListingBudgetFraction raises it (0.02 = 2%), and that /sk
  • read https: //code.claude.com/docs/en/settings-reference: the index lists skillListingBudgetFraction ('Reserve more or less context for the skill listing'); the read was truncated before the detail row, so the default comes from the skills page above
  • read https: //code.claude.com/docs/en/plugins/mods/interface: Text takes color (a theme key or color name), dimColor and wrap ('wrap', 'truncate', ...); nested Text is not documented, so the band splits the legend into sibling Texts
  • read https: //code.claude.com/docs/en/plugins/mods/events: no list of breakdown category kinds or names, so matching on the name 'Skills' rests on the skills page calling it 'the Skills row in /context'
  • check-changelog-fragments (run 3 times, last after the review fixes): all 4 fragments valid
  • check-affected (run 3 times, last after the review fixes): 11 passed, 7 skipped, 0 failed
  • fresh-context review subagent over the whole diff: no correctness findings. It worked out each new test's exact strings and rounding by hand (10k/1M = exactly 1.0; 855k shows as 86%). Its README line-wrap and rounding-clarity notes were fixed.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41231397747

Left out: the items under Not verified.

Related

#7231

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 25b5aef00d006d49cee8f2d6761fc68f694e6895: 0 finding(s), 0 as inline comments.

Security review (incremental, since 71cdb3a)

No security issues found.

This is an incremental review covering the two files changed since the last review:

  • plugins/context-budget/README.md: rewrites the "Skills warning" paragraph to explain how the character budget relates to the token count. It adds a pointer to the env-vars docs page for SLASH_COMMAND_TOOL_CHAR_BUDGET, plus a matching recheck trigger. It's documentation only.
  • plugins/context-budget/hooks/parts.tsx: rewords the comment above SKILLS_WARN_PERCENT and changes the text of the exported SKILLS_FIX string constant. Neither the threshold nor any logic changes, and nothing new reads input, runs commands, touches files or the network, or handles credentials.

Neither file matches a trusted-path glob. The changes don't touch any plugin manifest, trust control, merge hold or standing instruction, so the manifest and instruction-surface checks don't apply. The PR context file contains no embedded directives aimed at the review lane.

The change spends nothing billable.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on f920fcf16ee80e8d607056c8ac3bed765a41512e; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread plugins/context-budget/hooks/parts.tsx Resolved
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 25b5aef00d006d49cee8f2d6761fc68f694e6895: 0 finding(s), 0 as inline comments.

Incremental review (71cdb3a..25b5aef): no findings.

The change rewords the Skills warning. It touches plugins/context-budget/hooks/parts.tsx (the code comment and the SKILLS_FIX string) and plugins/context-budget/README.md (the "Skills warning" paragraph and its pointer).

  • Basis now stated. The README and the code comment now explain why a token-share row can be compared with a character budget. The documented 8,000-character fallback is 1% of a 200k window at 4 characters per token (200,000 × 1% = 2,000 tokens × 4 = 8,000 characters). The arithmetic is correct and gives a sound reason for the fixed 1% level. The pointer adds the env-vars page that holds this fallback, and the recheck trigger now covers both pages.
  • Fix text no longer overclaims. SKILLS_FIX used to say "over the default 1% skill listing budget". That was wrong whenever a user had raised skillListingBudgetFraction. It now says "Skills holds 1% or more of the window", which matches the warns() predicate (c.percent >= 1, before rounding).
  • Tests follow the constant. context-budget.test.ts builds its expected fix line from the imported SKILLS_FIX and checks only that it contains /skill-doctor and skillListingBudgetFraction, so the new wording breaks no assertion. I did not run the tests; the PR says the mod suite and tsc are left to CI.
  • Closing issue feat(context-budget): color-coded warnings in the live breakdown #7231 (decision A). The change still meets it: it marks the Skills row at the default 1% budget and names /skill-doctor and skillListingBudgetFraction.
  • Path-scoped rules. .claude/rules/mod-authoring.md matches plugins/*/hooks/**. It is an authoring-process pointer, and this copy and comment change breaks none of it.

No manifest changes in this increment, and no cost or security concerns.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so nothing will resolve it. The lane sets no label: the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=11676 -f activity=address-feedback

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

A lane run on this pull request's head failed because the token broker refused it as workflow-modified: .github/workflows/pr-run-activity-write.yml changed on main after the run's event, and a rerun keeps the old file. pr-merge pushes an empty commit so the next pr-unblock run uses main's files. It does this once per version of that file, so if a run fails the same way again, a person looks at it. The push starts no run itself: the conflict-resolution run starts at the next push to main or half-hourly pr-unblock-dispatch tick, or when a listed person runs it by hand, and an address-feedback run can start after both review lanes review the new head, if an unresolved thread is left for it.

The token broker refused a lane run on the previous head as workflow-modified (.github/workflows/pr-run-activity-write.yml). This commit changes no file.
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 71cdb3a1dda78e660e49a40d4192911b1bedb8a2. The lanes clear this reason on their own; the next scheduled run judges it again.

a pr-unblock lane stopped its head (pr-unblock/address-feedback is failure), which ci-status fails
  in the merge queue

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yT2fR
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 25b5aef.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 25b5aef00d006d49cee8f2d6761fc68f694e6895.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit dec6fbe Oct 31, 2026
42 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-7231-41231397747-1 branch October 31, 2026 23:06
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit dec6fbe2f5d059e2c475afcee1838b4e98eded47; later checks count it verified from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(context-budget): color-coded warnings in the live breakdown

1 participant