[FEATURE] Expose OTEL logs/metrics for slash command (skills) usage

Resolved 💬 4 comments Opened Mar 17, 2026 by dnode2 Closed Apr 17, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Skills can only be measured for observability (e.g. via OpenTelemetry) when they are interactive, which limits the ability to track usage of non-interactive skills invocations (e.g., slash commands). Additionally, if a slash command is backed by a plugin, there is no way to measure or attribute usage to that plugin.

Goal: enable measurement of adoption of skills and plugins, including those triggered via slash commands.

At the moment, there is no reliable way to observe or measure slash command usage (e.g. /fix, /test, /explain) within Claude Code.

This makes it difficult to:

  • track command usage for analytics and OTel metrics
  • measure adoption of skills and plugins
  • attribute usage to a specific plugin (if applicable)

Why this matters:

  • Enables observability and metrics without fragile workarounds
  • Allows proper OTel instrumentation for non-interactive features
  • Makes adoption of skills and plugins measurable

Proposed Solution

Expose structured slash command metadata either:

  • In hooks (e.g. pre-parse or dedicated hook), and/or
  • Directly in OpenTelemetry spans/events

OTel example:

  • Span/event name: claude_code.slash_command
  • Attributes: command=fix, plugin=my-plugin (if applicable)

Alternative Solutions

I have tried parsing the command by using the UserPromptSubmit hook. Here I obtained the full prompt and retrieved the command with the following pattern /$(command) [my-prompt]. This is a very hacky workaround.

The problem is that it retrieves also custom built-in commands while I only want to filter on skills. Also I am not able to link it easily to a plugin which is related to it.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

Measuring adoption of skills/plugins invoked by slash commands

Additional Context

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗