Skip to content

fix(skills): keep recovery-skill triggers inside Claude Code's listing budget - #7558

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
mhaney93:fm/fm-7545-skill-listing
Oct 20, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
mhaney93:fm/fm-7545-skill-listing

Conversation

@mhaney93

@mhaney93 mhaney93 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Closes #7545.

Claude Code caps its skill listing at about 1% of the context window, and when the listing overflows it drops descriptions from the least-invoked skills first. AGENTS.md section 13 relies on those descriptions as the trigger index, so firstmate's rarely-invoked recovery skills are the first to lose their triggers.

This PR covers the scope the triage marked ready-for-pr:

  • Shrink firstmate's own listing: remove the decision-hold-lifecycle redirect stub (nothing on main still points at it) and tighten the longest descriptions to their load triggers.
  • Document the Claude Code listing-budget settings (skillListingBudgetFraction, skillOverrides: "name-only", /skill-doctor) in the Claude Code harness adapter notes, as opt-in per-home settings rather than part of the shared contract.

No session-start warning or other default-on surface is added.

What Changed

  • Removed the decision-hold-lifecycle redirect stub skill and its entry in docs/documentation-audiences.json.
  • Shortened the frontmatter descriptions of about 20 skills under .agents/skills/ so each one keeps its load triggers. Preamble sentences such as "Agent-only reference/policy for…", harness lists, and restated procedure summaries are gone, which shrinks firstmate's share of Claude Code's skill listing.
  • Added a "Skill listing budget" section to the Claude Code harness adapter notes (harness-adapters/references/harness/claude.md). It explains the 1% budget and how descriptions get dropped, covers /doctor and /skill-doctor, and documents skillListingBudgetFraction and skillOverrides: "name-only" as opt-in settings for each home. These go in user settings or .claude/settings.local.json, never the tracked project settings.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: This change only touches documentation and skill frontmatter, and it stays within the scope the maintainer marked ready-for-pr. The removed decision-hold-lifecycle stub has no remaining references, and its documentation-audiences.json entry was removed too. Every load trigger in the shortened descriptions survives, and the shortened descriptions match AGENTS.md §13 and the agent-skill-trigger-index skill. The Claude Code settings are documented only in the Claude harness adapter notes as opt-in, per-home settings. No default-on warning or other new surface is added.

Testing

I ran three targeted tests (documentation-audiences, harness-adapter-references, brief) and all passed. I then parsed every skill's YAML frontmatter at the base and target commits. Every skill still parses with a matching name and a non-empty description. Only decision-hold-lifecycle was removed, and nothing still references it. Total description text fell from 11,312 to 6,142 characters, which fits a rough 8,000-character budget for a 200k-context model (1% of context at about 4 characters per token) that the old listing went over. Side-by-side comparison shows the trimmed descriptions keep their load triggers; what was cut is procedure text and the "Agent-only ..." preambles. The adapter notes document the Claude Code settings as opt-in and home-local, and no default-on warning was added. I did not run a live Claude Code /doctor session, so the budget check is an estimate from the parsed listing. This is a docs-only change, so there is no screenshot. The measurement is saved as a text artifact, and the temporary files have been removed.

Evidence: Skill listing size, base vs target (YAML frontmatter parse)

Source: Skill listing size, base vs target (YAML frontmatter parse)

skills: base=29 target=28; removed=['decision-hold-lifecycle'] added=[] total description chars: base=11312 target=6142 (46% smaller) approx budget @200k ctx (1% * ~4 chars/token) = 8000 chars: base fits=False target fits=True

# Skill listing measured via YAML frontmatter parse (base a65dcee vs target 8f35f68)
skills: base=29 target=28; removed=['decision-hold-lifecycle'] added=[]
total description chars: base=11312 target=6142 (46% smaller)
skill                               base  target
afk                                  920     351
bearings                             762     395
bootstrap-diagnostics                740     637
fmx-respond                          703     324
process-event-sources                625     277
quiet                                592     254
firstmate-coding-guidelines          583     180
stuck-crewmate-recovery              539     336
updatefirstmate                      517     200
secondmate-provisioning              514     190
captain-hold-lifecycle               438     269
harness-adapters                     433     226
firstmate-self-repo                  407     360
stow                                 406     294
ask-user-authority                   398      83
firstmate-codexapp                   337     195
project-management                   317     140
diagnostic-reasoning                 272      76
quota-array-dispatch                 249      86
firstmate-orca                       243     176
approx budget @200k ctx (1% * ~4 chars/token) = 8000 chars: base fits=False target fits=True

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-documentation-audiences.test.sh (audience manifest without the removed stub; owner pointers and local links still resolve)
  • bash tests/fm-harness-adapter-references.test.sh (harness adapter routing, including the edited claude.md reference, is readable)
  • bash tests/fm-brief.test.sh (brief scaffolds that consume skill paths)
  • grep -rn decision-hold-lifecycle across the worktree: no references left after the stub was removed
  • Parsed every .agents/skills/*/SKILL.md frontmatter as YAML at base a65dcee and target 8f35f68: checked that name matches the directory, descriptions are non-empty, the skill set changed, and per-skill and total description sizes
  • Compared base and target descriptions for the most heavily trimmed skills against the trigger list in agent-skill-trigger-index and AGENTS.md section 13, including whether any backticked trigger tokens were lost
  • Reviewed the claude.md diff: the vendor settings are described as opt-in and kept out of the tracked .claude/settings.json
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

…g budget (kunchenguid#7545)

Claude Code lists skill descriptions within a budget of 1% of the context
window and drops the least-invoked skills' descriptions first, which are
the rarely-loaded recovery skills whose descriptions AGENTS.md section 13
uses as the trigger index.

- Remove the decision-hold-lifecycle redirect stub; nothing on main
  points briefs at it any more (captain-hold-lifecycle owns the policy and
  docs/captain-hold-lifecycle.md still documents the fm-decision-hold.sh
  shim).
- Tighten the longest skill descriptions to their load triggers, keeping
  every trigger. Total description size drops from 11312 to 6142
  characters across the listing.
- Document /doctor, /skill-doctor, skillListingBudgetFraction, and
  skillOverrides "name-only" in the Claude harness adapter notes as
  opt-in, home-local vendor settings.

No session-start budget warning or other default-on surface is added.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you, @mhaney93. This is a focused, well-measured fix for the issue you filed, and it stays inside the scope marked ready-for-pr on #7545. Cutting description text from 11,312 to 6,142 characters while keeping the load triggers is exactly what was needed.

First look on head 8f35f682 against main a65dceee:

  • Closes #7545 checked against the body.
  • Nothing on main references decision-hold-lifecycle outside the stub and its docs/documentation-audiences.json entry, so removing both is clean. The stub's own description promised that removal.
  • The diff is skill frontmatter plus one new section in the Claude adapter notes. No scripts, workflows, or settings files change. The vendor knobs are documented as per-home settings that stay out of the tracked .claude/settings.json.
  • I spot-checked the trimmed descriptions. The load triggers survive, and what was cut is procedure text and "Agent-only ..." preambles.
  • This is a first-time fork, so I approved its workflow runs (CI 39382808893, Require no-mistakes 39382808722 and 39391794110). They are running now.

Contract-class: restore (my own read). The trimmed listing and stub removal bring back the trigger index AGENTS.md section 13 already relies on. The adapter-notes settings are opt-in and change nothing unless a home sets them. No default-on surface is added.

One thing I'd love from you (waiting on you): the PR says no live Claude Code session was run, so the budget fit is an estimate from parsed frontmatter. Could you open a real Claude Code session on this branch, run /doctor (and /skill-doctor if your version has it), and paste the listing numbers? Ideally on a home with a plugin installed, like the Vercel one from #7545, so we can see the recovery-skill descriptions survive. Re-raising through no-mistakes with that evidence attached also works. Once that's posted and CI is green, this can land.

VISION.md, rule by rule

  • One captain, one interface: aligns. Recovery playbooks keep loading when they're needed, so fewer things fall through.
  • Authority is explicit and never inferred: aligns. No new autonomy, and the vendor settings are opt-in per home.
  • Scripts own the mechanics, agents own the judgment: aligns. Docs and frontmatter only.
  • A restart is a non-event: aligns, nothing changes here. No records change.
  • Delegation with a spine: aligns. Workers and firstmate keep their skill triggers on small-context models.
  • The fleet outlives any vendor: aligns. Claude-specific knobs live only in the Claude adapter notes, not in the shared contract.
  • Scope: aligns. Token efficiency is a first-class concern, and this shrinks the always-listed surface.

@mhaney93

Copy link
Copy Markdown
Contributor Author

Live numbers from Claude Code 2.1.304, captured in interactive sessions on this branch (8f35f682) and on current main (3eabd356). Both had the Vercel plugin 0.50.0 loaded (41 skills), plus 3 user skills, 13 claude.ai-synced skills, and the built-ins. Counts come from /context all, where a skill whose description was dropped shows as < 20 tokens. /doctor in this version only gives a model estimate of the listing, and /skill-doctor now redirects to /plugin → Stats, so /context all was the exact source.

Model (context) Budget main: firstmate skills name-only branch: firstmate skills name-only
Opus 5.5 (1M) default 1% 0 / 29 (27 / 102 skills name-only overall) 0 / 28 (10 / 101 overall)
Haiku 4.5 (200k) default 1% 29 / 29 28 / 28
Haiku 4.5 (200k) skillListingBudgetFraction: 0.02 15 / 29 (incl. bootstrap-diagnostics, session-start-recovery, stow, fmx-respond) 4 / 28 (secondmate-provisioning, session-start-recovery, scout-completion, stow)
Haiku 4.5 (200k) skillListingBudgetFraction: 0.03 0 / 29 0 / 28

Firstmate's listing drops from about 4.0k to about 2.3k tokens per /context all. On the 1M model that keeps every recovery-skill description and frees room for other skills: 17 fewer descriptions are dropped across the session. On a 200k model at the default budget, the trim is not enough on its own in this setup. Built-in skills keep their descriptions and fill most of the roughly 2k-token budget, so every firstmate description is dropped on both main and the branch, with or without the plugin. The opt-in skillListingBudgetFraction documented in the adapter notes closes that gap, and the trim makes it cheaper: at 0.02 the branch keeps 24 of 28 firstmate descriptions where main keeps 14 of 29. At 0.03 both keep all of them.

One adapter-notes nit from testing: in 2.1.304, /skill-doctor redirects to /plugin → Stats. I can add that line here or leave it for a follow-up.

@kunchenguid
kunchenguid merged commit 9d76aa8 into kunchenguid:main Oct 20, 2026
20 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @mhaney93 — really appreciate you taking the time on this.