AI NewsDev toolsAnnouncement

Skill-diet trims agent skills by 70 to 80 percent of their tokens

Skill-diet is a Claude Code and Codex skill that rewrites other skills to be shorter. It kept the slim version only if agents did at least as well as before.

AI News

Editorial2 min read

LinkedInX
GitHub social card for nicobailon's skill-diet repository

Image: GitHub

Why it mattersAn agent reads a skill's full SKILL.md every time it uses the skill. Shorter skills cut tokens on every call.

Nico Bailon's skill-diet rewrites other agent skills to be shorter. It keeps the slim version only if agents do at least as well as before. The project is on GitHub under an MIT licence. It has 124 stars four days after launch.

The skill solves one problem. An agent reads a skill's whole SKILL.md every time it uses the skill. Skills written by hand grow with new rules and never shrink. The agent then reads a longer file on every call. The author's README says a diet has cut 70 to 80 percent of the tokens on real skills. It says there was no drop in test results.

What it does

Skill-diet has two jobs. One is a one-time rewrite of an existing skill. The other is a set of rules for every later update, so a skill does not grow back.

The rewrite follows five steps. First, measure the skill and mark what each task actually loads. Second, place each piece on the lowest level that still reaches the agent in time. Third, cut what the model already knows. Fourth, rewrite the rest tighter. Fifth, run the test. The levels run from the skill's description down to the tool's own help and errors. The description is read in every session. The tool's help is read only when the agent calls that command.

The test runs the agent on the same tasks three times. Once with the old skill, once with the new one, and once with no skill at all. The new skill is kept only if it does at least as well. The scorer fails the diet when the slim skill does worse than chance would explain.

The commands table

The README names which format of commands costs the fewest tokens on a real CLI. Usage lines, the way an agent types a command, are the base. A markdown table of the same commands costs 1.5 times as many tokens. TypeScript types cost 1.6 times, JSON Schema 2.8 times, and OpenAPI 4.7 times. Those figures are the author's, on one set of commands.

How to adopt it

Skill-diet installs through four routes. Pi uses pi install npm:skill-diet. Claude Code uses its plugin command with the project's marketplace. Codex, Cursor and other agents use the npx skills tool. It keeps one copy in ~/.agents/skills and links it into each agent. The author says to use one route per agent, because installing both loads the skill twice.

The before and after test needs a small adapter script that runs one session of your agent. The agent writes that adapter itself, from its CLI's help. The README says Claude Code and Pi each wrote one in under four minutes in the author's tests. Codex took 7 to 16 minutes.

Source

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project