skill-cleaner: An Open-Source Tool to Put Your Agent Skills on a Diet

·Toolin Editorial Team

Peter, the 'father of the lobster,' has open-sourced skill-cleaner: 5 core features that audit and optimize your Agent skill descriptions, saving Token costs and improving Agent selection accuracy. Now open on GitHub.

skill-cleaner: An Open-Source Tool to Put Your Agent Skills on a Diet

Writing your Agent skill (Skill) descriptions too long doesn't just waste Tokens — it also lowers the Agent's accuracy when picking a skill. After someone trimmed a 90-plus-word description down to under 40 words, the Agent picked the right skill on the very first try.

Peter, the "father of the lobster," couldn't stand watching this any more and open-sourced a tool that gives every Skill a "health check": skill-cleaner.

Why Put Your Skills on a Diet

The trouble with Skill prompts looks, on the surface, like copy length, but it actually affects three things:

  • Cost: every extra sentence of description is another Token bill on every Agent call
  • Latency: the more information the Agent sees, the more noise it faces when choosing
  • Accuracy: information overload makes the Agent pick the wrong tool

Peter's position is clear: a Skill should be like a road sign — its job is to help the Agent find the way, not to hang the entire manual on the sign. And skill-cleaner itself is the best demonstration -- its Skill.md is only 56 lines of prompts, while the scripts it invokes run to nearly a thousand lines of code.

skill-cleaner design philosophy

Five Core Features

1. Skill Prompt Budget Audit

It analyzes how much context Token space each Skill occupies, computes the budget utilization ratio, and proposes an optimization plan. The script uses the same prompt-budget accounting logic as Codex's official source code, reads the local model cache configuration to get GPT-5.5 context window parameters (272K Tokens by default), and strictly follows Codex's billing rule (UTF8 byte count / 4, rounded up).

2. Duplicate Skill Detection

It scans across Codex's built-in library, plugin caches, codebases, and personal skill root directories for same-named skills and duplicates with highly similar descriptions/content, flagging the redundant entries.

3. Unused Skill Screening

Based on history logs, it identifies idle skills that have gone a long time without being invoked, mentioned, or touched in any way, and provides a cleanup candidate list.

4. Skill Root Directory Audit

It tallies the source root directories of all skills, marks enabled/disabled status, and maps out the skill loading chain.

5. Description Slimming

It finds verbose skill descriptions and slims them down through a three-step process:

  • Text preprocessing: normalize the format, lowercase everything, strip punctuation
  • Scenario recognition: a built-in keyword lexicon of preset scenarios identifies the business domain each skill belongs to
  • Standardized replacement: replace verbose descriptions with preset short action phrases

For example: debugging skills become debug, inspect, fix; deployment and release skills become deploy, release, verify.

Example of optimization results

How to Use It

Preparation

  • A Node.js environment
  • An existing Agent Skills directory

Step 1: Installation

# Clone the repository
git clone https://github.com/steipete/agent-scripts/tree/main/skills/skill-cleaner

# Install dependencies
npm install

Step 2: Run the Audit Analysis

Run the script in your skills directory or repo root:

node skill-cleaner.js --dir /path/to/skills

Supported parameters:

  • --time-range: specify the time range to analyze
  • --log-depth: log analysis depth
  • --budget-threshold: budget threshold
  • --custom-root: custom skill root directory

Step 3: Review the Report and Optimize

Read the core reports in order: skill budget -> description optimization items -> duplicate skills -> unused skills -> root directory summary.

Safety principles while optimizing:

  • Keep Codex built-in skills first
  • Don't delete unrelated directories you haven't confirmed
  • Verify that the retained files are valid before modifying anything

Verifying the Results

After optimizing, you can watch two metrics:

  1. Token budget utilization: check whether each Skill's share of the context has dropped
  2. Agent invocation accuracy: after descriptions are slimmed, whether the Agent picks the correct skill more accurately

FAQ

  • Q: Will slimming descriptions lose key information? A: skill-cleaner's strategy is to replace verbose descriptions with standardized short phrases, keeping the "action" rather than the "explanation." What an Agent needs is an accurate road sign, not a detailed manual.

  • Q: Does it support non-Codex Agent frameworks? A: The core logic is generic, but the billing rule and budget baseline default to Codex standards. If you use another framework, you need to adjust the budget parameters yourself.

GitHub: https://github.com/steipete/agent-scripts/tree/main/skills/skill-cleaner

Related articles

Make an Overseas Short Drama Solo: A Three-Step Hands-On Tutorial with SenseTime Seko 3.0 + Seedance 2.0
AI Tutorials

Make an Overseas Short Drama Solo: A Three-Step Hands-On Tutorial with SenseTime Seko 3.0 + Seedance 2.0

With SenseTime Seko 3.0 (Agent + infinite canvas) and the Seedance 2.0 video model, produce the fully English overseas short drama Pawn the World solo in three steps: topic & script, character storyboards, then video generation. Includes pricing, the registration link, and Skill tips.

Toolin Editorial Team
The Claude Code System Prompt Cut List: 6 Categories of Old Rules to Delete, 2 New Sections to Add
AI Tutorials

The Claude Code System Prompt Cut List: 6 Categories of Old Rules to Delete, 2 New Sections to Add

Anthropic cut the Claude Code system prompt by 80% and added 70% back—deleting 6 categories of rules that patched older models, and adding two new sections, Delivering work and Corrections, to manage Opus 5's temper. An actionable checklist you can apply directly to your own agent prompts.

Toolin Editorial Team
Nami Work Hands-On: One Sentence, Three Model Providers, an Auto-Edited 32-Second Promo
AI Products

Nami Work Hands-On: One Sentence, Three Model Providers, an Auto-Edited 32-Second Promo

A real-task test of ByteDance's Nami Work (Work.n.cn)—a single prompt orchestrating Seedance 2.0 text-to-video + MiniMax TTS + ffmpeg across three model providers to deliver a 32-second promo video, with its reasoning, judgments, and constraints all visible in the interface.

Toolin Editorial Team
The Opus 5 "Challenge Loop" Prompt: Making AI Its Own Taskmaster to Grind Out a AAA Game Prototype in 24 Hours
AI Products

The Opus 5 "Challenge Loop" Prompt: Making AI Its Own Taskmaster to Grind Out a AAA Game Prototype in 24 Hours

Matt Shumer's "Challenge Loop" prompt drives Opus 5 to iterate on its own with a multi-agent structure of main Agent + builder Agents + judge Agent, paired with Three.js and Blender MCP, replicating an Outer Wilds-caliber browser game solo in 24 hours.

Toolin Editorial Team
DyRef Hands-On: Adding Multi-Reference Consistency to Qwen Image Editing Models—Stable Even at 7 Reference Images
AI Tutorials

DyRef Hands-On: Adding Multi-Reference Consistency to Qwen Image Editing Models—Stable Even at 7 Reference Images

DyRef from HIT Shenzhen (ECCV 2026 Oral) is a multi-reference consistency fine-tuning recipe + RL dynamic-reward training framework layered on Qwen-Image-Edit-2511, keeping subject, pose, and style consistent even with up to 7 reference images. This guide runs local inference, plus optional SFT/RL training.

Toolin Editorial Team
Qwen Work Hands-On: An Earnings PPT in 7 Minutes—Three Scenarios Through Alibaba's New Office Agent
AI Tutorials

Qwen Work Hands-On: An Earnings PPT in 7 Minutes—Three Scenarios Through Alibaba's New Office Agent

A hands-on tutorial for Alibaba's Qwen Work (qwenwork.cn) covering three reproducible scenarios—earnings PPT generation, podcast-to-Feishu-doc, and e-commerce site building—with pricing, credit consumption, and pitfalls to avoid.

Toolin Editorial Team