Claude Code skill sprawl gets tamed with OpenTelemetry and Loki
The post by astronaut describes how to make a growing Claude Code skills catalog observable using native OpenTelemetry support, routing skill activation events to Loki and cost/token metrics to Prometheus — without modifying source code.
Score breakdown
Without skill-level observability, teams pay input tokens on every request for skills that may never be called, and have no mechanism to detect broken or unused skills — the post describes a concrete path to closing that gap using Claude Code's native telemetry.
- 01A team cited in Claude Code feature request #35319 grew from 67 to 183 skills in one month with zero usage visibility.
- 02Every skill's name and description is injected into the system prompt at session startup, so unused skills still cost input tokens on every request.
- 03`maxSkillDescriptionChars` defaults to 1536 characters per skill; `skillListingBudgetFraction` defaults to 1% of the context window.
The post by astronaut frames Claude Code skill accumulation as "skill sprawl" — the same disease as server sprawl or feature-flag sprawl — where artifacts multiply faster than insight into who is using them. A real feature request (#35319 in the Claude Code tracker) is cited as evidence: a team describes growing from 67 to 183 skills in a month with zero usage visibility. The post notes that mature observability consoles such as Datadog for Claude Code currently stop at user/model/repo/cost breakdowns, with no skill-level analytics.
When the listing overflows, descriptions for least-used skills are collapsed to bare names.
The underlying cost mechanism is explained: at session startup, Claude Code scans all available skills and inserts each one's name and description into the system prompt, so every API request pays input tokens for the full listing. Two dedicated settings manage this: `maxSkillDescriptionChars` caps per-skill description length (default: 1536 characters) and `skillListingBudgetFraction` limits the total context-window fraction allocated to the listing (default: 1%). When the listing overflows, descriptions for least-used skills are collapsed to bare names. Running `/doctor` reveals whether truncation is occurring in a given session.
The proposed observability stack routes four signal types without patching source code: `claude_code.skill_activated` log events (carrying `skill.name`, `invocation_trigger`, and `skill.source`) go to Loki; `claude_code.cost.usage` and `claude_code.token.usage` metrics (broken down by `skill.name`, model, and token type) go to Prometheus; and `claude_code.tool_result` events (with `tool_name`, `success`, and `duration_ms`) also go to Loki. The post emphasizes that skill activations are events, not metrics, so a Prometheus-only setup is insufficient for answering who called a skill, when, and from what trigger. The source text is truncated before the remaining practical gotchas beyond the first (`OTEL_LOG_TOOL_DETAILS=1`) are fully described.
Key facts
- 01A team cited in Claude Code feature request #35319 grew from 67 to 183 skills in one month with zero usage visibility.
- 02Every skill's name and description is injected into the system prompt at session startup, so unused skills still cost input tokens on every request.
- 03`maxSkillDescriptionChars` defaults to 1536 characters per skill; `skillListingBudgetFraction` defaults to 1% of the context window.
- 04Running `/doctor` shows whether skill-listing truncation is occurring in the current session.
- 05Skill activation signals are log events (not metrics), requiring a log pipeline like Loki in addition to Prometheus.
- 06The `OTEL_LOG_TOOL_DETAILS=1` flag is mandatory; without it, custom skill names collapse into a generic `custom_skill` placeholder.
- 07The four signal types are: `claude_code.skill_activated`, `claude_code.cost.usage`, `claude_code.token.usage`, and `claude_code.tool_result`.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 11, 2026 · 08:34 UTC. How this works →