Feature Request: Record (custom) slash command usage as telemetry events
As an organization, we would like to see what slash commands are providing the most value to our developers, e.g. to determine ROI based on automation of mechanical tasks.
We've implemented OpenTelemetry monitoring based off https://docs.anthropic.com/en/docs/claude-code/monitoring-usage, however it seems that no telemetry event is emitted when a slash command is invoked. One thought is maybe claude_code.user_prompt event would be emitted with the prompt contents starting with the /[command] text (when OTEL_LOG_USER_PROMPTS is enabled), however this is also not the case.
It would be great if there was an event tracking slash command usage. I think the key attributes would be:
- the slash command name
- the scope of the command (project vs. personal). Ideally with some way to determine what the project was as well? (but maybe that's a separate feature request).
- Maybe also the arguments to the slash command (but only with
OTEL_LOG_USER_PROMPTSenabled?)
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗