Repository navigation
Description
Summary
A large skill catalog (more than 100 skills or more than 64 KiB of descriptions) is already listed in compact mode, but each compact entry is still a five-line XML block with a full rN/<name>/SKILL.md location and a 160-character description cut mid-word. On a real 101-skill catalog that block is about 8,300 tokens (o200k estimate) on every request. The compact trigger also has a cliff: hiding a few skills (for example retired ones) drops a 98-skill catalog back to full multi-sentence descriptions, which is larger, not smaller.
Reproduction
- Load ~100 skills whose descriptions average ~300 characters (a typical personal skill library).
- Render the system prompt (
formatSkillsForPrompt). - Each entry is
<skill>\n<name>..</name>\n<description>..</description>\n<location>rN/name/SKILL.md</location>\n</skill>; 100 of 101 locations are exactlyrN/<name>/SKILL.mdand carry no information beyond the root alias. - Remove three skills (98 left, ~29 KiB of descriptions): the catalog falls below both thresholds and every full description is listed.
Measured (real 101-skill catalog, o200k estimate)
| format | tokens |
|---|---|
| current compact XML, 160-char descriptions | 7,963 (+315 header) |
| one line per skill, location kept, 160 chars | 5,439 |
one line, root alias when the path is <name>/SKILL.md, 160 chars |
4,526 |
| same, 100 chars cut at a word boundary | 3,113 |
Expected (ideal state)
- A large catalog lists one line per skill:
- name [location]: one-line description, inside the same<available_skills>wrapper and after the same<skill_roots>table. locationis the root alias alone (r0) when the file is<root>/<name>/SKILL.md, else the path under the root (r1/bundle/SKILL-x.md), so every skill stays resolvable; one header line states the rule.- The one-line description is at most 100 characters, cut at a word boundary.
- The compact trigger uses a 16 KiB description budget (count threshold unchanged), so a ~100-skill library stays compact when a few skills are hidden, while a default install with ~30 bundled skills keeps full descriptions.
- The names-only fallback (over the 48 KiB cap) uses the same one-line form without descriptions.
- Small catalogs are unchanged.
Actual
packages/coding-agent/src/core/skills-prompt.ts: renderSkills emits the XML block for compact entries; ONE_LINE_DESCRIPTION_MAX_CHARS = 160 cut without a word boundary; COMPACT_SKILL_CATALOG_DESCRIPTION_BYTES = 64 KiB.
Acceptance criteria
- Regression test: a 98-skill catalog with ~300-character descriptions is compact; every line is
- name [location]: …, at most 140 characters; every location resolves to the skill's file through the roots table. - Existing small-catalog and names-only bounds tests still hold (updated for the line form).
- Real first-request measurement before/after (input total and cacheRead) in the PR.
Related
- No per-request context budget or spend guard: 1M-window models (e.g. OpenGateway DeepSeek) grow to ~500K-800K tokens per call on unattended runs #3460 / fix(coding-agent): bound context files and large skill catalogs added to every request #3463 (compact catalog and prompt budgets), GPT-6 Astra over-prepares and over-verifies: skill catalog stance, forced first-turn verification phase, and preset gates codex does not carry #2505 (skill catalog stance)
- The Claude-subscription prompt extractor keys on the catalog marker and
</available_skills>, both kept.
Activity
code-yeongyu commentedon Oct 27, 2026
Correction: the "cliff" in the summary does not hold for a ~100-skill library like the one measured. With 98 skills (32 KiB of descriptions) the catalog stays compact, because its full render exceeds the existing 48 KiB cap (
MAX_SKILL_CATALOG_BYTES). The 16 KiB trigger matters for catalogs whose full render fits under 48 KiB. Real-session numbers are on #4456.test(prompt): refresh #3483 compact golden for one-line skill catalog (…
fix(skills): keep each skill's when-to-use sentence in the one-line c…
test(skills): assert the lead fill survives a short trigger clause
code-yeongyu commentedon Oct 28, 2026
Fixed by #4456, merged into main as 4179b9d.
Evidence:
4449-compact-skill-catalog-lines.test.ts, mutation-proven).feat(coding-agent): list a large skill catalog one line per skill (co…