[BUG] Compaction silently omits older invoked skills above the 25,000-unit aggregate budget; --resume reconstructs none
Version tested: Claude Code 2.1.280 (Linux).
Minimal reproduction
- Create six project skills under
<fixture-root>/skills/repro-{a,b,c,d,e,f}/SKILL.md. Give each a short frontmatter header and uniqueHEADandTAILsentinels in its body. Pad the bodies so the length of each charged string,"Base directory for this skill: <skill-dir>\n\n" + body-without-frontmatter, is 18,106 characters for B through F and 9,460 characters for A. ThusMath.round(length/4)is 4,527 for each B–F and 2,365 for A: 25,000 units total. - In one CLI process, invoke A, B, C, D, E, F in that order, then run
/compact. Inspect the post-boundaryinvoked_skillsattachment. All six appear. - Add four body characters to A, making its charged length 9,464 characters (2,366 units, 25,001 total). Repeat in a fresh process with the same invocation order and
/compact.
Expected: All invoked skills remain available after compaction, or an explicit notice names any skill whose content was omitted.
Actual: At 25,001 units, the oldest skill A is absent from invoked_skills without a marker or error; B–F remain. The 25,000-unit fixture retains all six. The separate 5,000-unit per-skill truncation path does emit [... skill content truncated for compaction; use Read on the skill path if you need the full text].
Resume finding
In a separate test, invoke six skills in one process, exit without compacting, then use --resume and run /compact. No invoked_skills attachment is produced: zero of six skills are reconstructed. The observed restore path reads earlier invoked_skills attachments, not the earlier Skill-tool invocations. Auto-compaction and --continue were not runtime-tested.