[BUG] Emit OTEL tool_result event for slash command (skill) invocations

Resolved 💬 6 comments Opened Mar 25, 2026 by al13bash Closed Jun 5, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a skill is invoked via slash command (e.g., /commit, /my-skill), no claude_code.tool_result OTEL event is emitted with tool_name: "Skill". The slash command gets expanded into a prompt injection, bypassing the Skill tool pipeline entirely. Only the inner tool calls (Bash, Read, etc.) are logged.

When Claude programmatically invokes the same skill via the Skill tool, the event is emitted correctly with tool_name: "Skill" and skill_name in tool_parameters.

This makes slash command usage invisible to OTEL-based observability.

What Should Happen?

Slash command invocations should emit a claude_code.tool_result event with tool_name: "Skill" and skill_name in tool_parameters (when OTEL_LOG_TOOL_DETAILS=1), just like programmatic Skill tool invocations do.

Error Messages/Logs

# Programmatic Skill invocation (works):               
@tool_name:Skill → found, tool_parameters: {"skill_name":"datadog:dd"}
                                                                                                                                                                                                                    
# Slash command /dd validate (missing):                                                                                                                                                                           
@tool_name:Skill → 0 results. Only inner Bash tool_result emitted.

Steps to Reproduce

  1. Set OTEL_LOG_TOOL_DETAILS=1, OTEL_LOGS_EXPORTER=otlp, configure OTLP endpoint
  2. Create or install a plugin with a skill (e.g., my-skill)
  3. In a Claude Code session, type /my-skill to invoke it via slash command
  4. Check OTEL logs for claude_code.tool_result events with @tool_name:Skill
  5. No event found — only inner tool calls (Bash, Read, etc.) are logged
  6. Now ask Claude something that triggers the same skill programmatically (auto-invocation)
  7. Check again — tool_name: Skill event appears with skill_name in tool_parameters

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.83

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issues: #22655 (skill_name missing in hook payloads), #14784 (subagent_type missing in OTEL). This is the OTEL counterpart — slash commands bypass the tool pipeline so neither hooks nor OTEL see them.

View original on GitHub ↗

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