Skill Compact — Development skill for Claude Code
Shrink Claude Code SKILL.md token cost without breaking skills.
How to install Skill Compact
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open momenbasel/skill-compact and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Skill Compact does
Shrink Claude Code SKILL.md token cost without breaking skills. Trigger-preserving description gate + lossless body compaction.
Alternatives in Development
- Code Simplifier — Simplify code while preserving functionality 14k ★
- Caveman Claude Skill — Ultra-compressed communication mode for Claude 396 ★
- Check Setup.En — Top-level alias — see lesson/check-setup.en.md for the full body 347 ★
README
skill-compact
Shrink the token footprint of Claude Code `SKILL.md` files **without breaking the skill**. It separates the two costs, attacks each honestly, and refuses any change that would drop an activation trigger.
The two footprints
- Description (frontmatter): loads into every session for every installed skill. Always-on tax. Small per skill, large in aggregate.
- Body + references: load only when the skill is invoked. Where the big bytes are.
Measured on one real library of ~600 skills: descriptions cost ~54k tokens every session; 276 skills carry a description over 350 characters.
What it does
| Command | Cost targeted | Guarantee |
|---|---|---|
analyze |
both | pure measurement, mutates nothing |
check / set-desc |
always-on | rejects a rewrite that drops any trigger token |
body |
on-invoke | lossless: strip HTML comments, collapse blank runs, trailing ws |
refs |
on-invoke | extract long code blocks to references/, leave a pointer |
The fidelity guard (why it will not break your skills)
`check` extracts the original description's trigger tokens - quoted phrases, `/slash-commands`, kebab and CamelCase identifiers, acronyms - and refuses any shorter description that loses one. This is not a heuristic hope; it is a hard gate.
It was validated adversarially. Compacting prose-y descriptions is safe (an OAuth-review skill went 373 to 330 chars, verified no lost triggers). Compacting a trigger-dense skill is **not**: a bug-bounty skill with a 1,405-char description enumerating dozens of vuln classes and non-English keywords cannot be shortened to 350 chars without dropping triggers, and the tool blocks that rewrite. Use `refs` and `body` on those instead.
Install
git clone https://github.com//skill-compact.git
python3 skill-compact/scripts/analyze.py --top 20
Usage
# 1. find the worst offenders
python3 scripts/analyze.py --top 20
# 2. always-on: propose a shorter desc
Related Skills
Token Consumer
Measure and shrink the token cost of Claude Code skills, tier by tier: the always-on system-prompt tax, the pe
Fire Cost
Track context usage, estimate session costs, and trigger strategic compaction
Magic Compact
Lossless context compression plugin for Claude Code & OpenCode.
Reducio
Shrink it — simplify and de-nest without changing behavior
Longhand
Lossless local memory for Claude Code. The full, unabbreviated version. Every tool call, every file edit, ever
Post Compact Reminder
Claude Code hook that detects context compaction and injects a reminder to re-read AGENTS.md, preventing post-
Related Agents
SkillReviewer
Skill quality reviewer — evaluates SKILL.md frontmatter, description trigger effectiveness, body content quali
Tp Session Restorer
PROACTIVELY use this as the FIRST step after /clear, compaction, or a fresh window when a recent session_snaps
RefactoringSpecialist
Senior refactoring specialist — transforms complex code into maintainable systems while preserving behavior. U