XNews

Skills in AI Agents: From Curation to Code Optimization

Skills in AI Agents: From Curation to Code Optimization

Spotify Engineering's Portal tool reduced Claude Code token consumption by 90% by routing low-reasoning tasks to smaller models, while a curated Skills collection highlighted best practices. AI coding costs are concentrated in I/O; Claude Code wastes tokens reading multiple files for a simple query, generating test files following patterns, and updating docs. Portal uses two declarative Agents (Modes) on ephemeral runtimes, both using Gemini 2.5 Flash: a bulk-reader that compresses large files into structured summaries with line numbers and no pleasantries, and a boilerplate code generator that outputs only code mimicking reference patterns. A shunt plugin with three layers (PreToolUse hooks, bash scripts, skills) intercepts large file reads (over 350 lines default) and routes them to the bulk-reader, while allowing targeted reads. In a Java monorepo test, bulk-read saved ~90% tokens; code-write saved both input and output tokens. Limitations: worker summaries lack reliable line numbers for editing, cannot delegate reasoning tasks (missed a thread-safety bug), and delegation adds 10-30 second latency, making it unsuitable for small files. A separate post shared a curated collection of Skills, including design, single-point, enterprise, and methodology Skills, as well as the author's own three Skills.

Key insights

AI Coding Spends Heavily on I/O Tasks That Are 'Severely Over-Spec' for Frontier Models

Spotify Engineering found that Claude Code tokens are largely consumed by routine tasks like reading five files to answer a method question, generating test files following existing patterns, and updating documentation after meetings. These do not require frontier model reasoning.

Spotify Portal's Declarative Agents Route Grunt Work to Cheap Models, Achieving ~90% Token Savings

Portal uses two declarative Modes (bulk-reader and boilerplate code generator) running on ephemeral runtimes with Gemini 2.5 Flash. Bulk-read compresses large files into structured summaries with line numbers, while code generator mimics reference patterns and outputs only code. Together they cut token consumption by about 90% in a Java monorepo test.

The Shunt Plugin Uses a Three-Layer Approach to Intercept and Delegate Tasks

The shunt plugin consists of PreToolUse hooks that intercept file reads exceeding a threshold (default 350 lines), bash scripts that handle Portal CLI calls with error handling and token reporting, and a skills file that instructs Claude when and how to use the scripts. This ensures cheap tasks are routed to small models transparently.

The Delegation Approach Has Clear Limitations: No Editing, No Reasoning, Added Latency

Worker summaries do not provide reliable line numbers for editing, so Claude must still read relevant sections directly. The worker model cannot be trusted with reasoning tasks—it missed a subtle thread-safety bug that Claude found quickly. Each delegation adds 10-30 seconds of latency, making it unsuitable for small files or safety-critical code.

A Curated Skills Collection Demonstrates Growing Community Interest in Systematizing AI Agent Capabilities

A post shared a collection of recommended Skills, covering design, single-point, enterprise/workflow, and methodology categories, plus the author's own three Skills. This indicates active curation and sharing of reusable agent skills.

Source posts