TL;DR
SkillReducer is a novel, two-stage optimization framework designed to "debloat" the prompt instructions (or "skills") used by LLM coding agents. By compressing routing descriptions and restructuring skill bodies into an on-demand tiered architecture, it slashes token costs by up to 43% while counter-intuitively improving agent task performance by 2.8%.
What Problem Does This Paper Address?
Modern LLM-based coding agents (like Claude Code or Cursor) use "skills"—pre-packaged instruction sets, code templates, and documentation—to extend their capabilities without repeating prompts in every single turn. However, because these skills are written by humans in free-form natural language, they suffer from massive skill bloat.
Every unnecessary token injected into an LLM's context window costs money and dilutes the model's attention (the "lost in the middle" effect). To quantify this, the authors conducted a massive empirical study of over 55,000 public skills. They discovered systemic inefficiencies: 26.4% lacked routing descriptions entirely (forcing the agent to guess when to use them), and over 60% of the instruction bodies consisted of non-actionable background information or verbose examples.
Methods
SkillReducer treats prompt optimization like a traditional software engineering problem, adapting concepts like software debloating, delta debugging, and program slicing into a two-stage pipeline.
Stage 1: Routing Layer Optimization
This stage ensures that the short descriptions used by agents to select ("route") the correct skill are minimally sufficient.
- Delta Debugging (
ddmin): The framework segments descriptions into semantic clauses and uses a fast, simulated routing oracle to iteratively discard clauses that don't affect routing correctness. To make this robust, they introduce an LLM-generated "shadow skill"—an adversarial distractor designed to cause routing confusion if the description gets too vague. - Real-Environment Validation: The compressed description is tested inside the actual agent runtime (e.g., Claude Code CLI). If it fails to trigger, a selective restore mechanism greedily adds back deleted clauses.
Stage 2: Body Restructuring via Progressive Disclosure
Instead of dumping the entire monolithic skill body into the context window, Stage 2 splits it into a tiered architecture.
- Taxonomy-Driven Classification: An LLM segments the text into five categories: core rules, background, examples, templates, and redundant content.
- Progressive Disclosure: Only the actionable core rules are always loaded. Background info, examples, and templates are moved into separate, compressed reference files. The agent is given a
read_filetool and autonomously decides to load these extra modules only when needed. - Quality Gates & Feedback Loop: The framework verifies structural faithfulness. If a task evaluation fails, a self-correcting feedback loop analyzes the failure and automatically promotes the missing reference content back into the core rules.
Datasets
The authors evaluated SkillReducer using a diverse and rigorous suite:
- Empirical Dataset: 55,315 "Wild" skills crawled from GitHub, 100 curated skills from the SkillHub marketplace, and 620 community-shared skills.
- Evaluation Set: A balanced subset of 600 skills (87 Official, 464 Community, 49 Wild) evaluated across 3,000 generated tasks.
- SkillsBench: An independent external benchmark consisting of 87 tasks across 229 skills with deterministic, assertion-based test verifiers.
Key Insights and Ideas
- The "Less-is-More" Effect: Compressing prompts doesn't just save money; it actually makes agents smarter. Removing non-essential background text and examples reduces context window distraction, leading to a 2.8% absolute improvement in task success rates.
- Prompting as Software Slicing: Natural language prompts can be structurally segmented and modularized just like source code. By separating the specification (core rules) from the data (examples/templates), we can achieve a layered architecture for LLM context.
- Skill Obsolescence: As frontier LLMs grow inherently more capable, many user-authored skills become completely redundant. SkillReducer's validation gate successfully identified that 10.7% of skills failed to trigger because the base model could already handle the user queries without them.
Key Results
SkillReducer achieves massive token reductions without sacrificing functional quality:
- Token Savings: It achieved a 48% mean compression rate for routing descriptions and a 39% mean reduction for skill bodies, translating to an expected end-to-end input token savings of up to 43.2%.
- Quality Retention: 86% of the optimized skills maintained or improved their task performance scores. On the external SkillsBench benchmark, SkillReducer achieved a 100% pass rate with zero regression.
- Robust Generalization: The optimizations are highly transferable. Compressions generated by a strong model (DeepSeek-V3) successfully transferred across five different model families (including smaller models like Qwen2.5-7B) with a mean quality retention of 0.965, and generalized perfectly to an entirely independent agent framework (OpenCode).
Limitations and Future Work
The primary limitation identified is example-as-specification. In some poorly authored skills, developers implicitly define core rules inside their code examples rather than stating them explicitly. Because SkillReducer's classifier moves examples to on-demand modules, the agent can lose access to these implicit rules during core execution.
Additionally, the framework was primarily tested using the Anthropic skill protocol; future work includes validating its efficacy on other popular agent platforms like Cursor or Windsurf.
Summary updated