claude-code - 💡(How to fix) Fix [FEATURE] claude_code.tool spans don't identify which skill or agent was invoked [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49009Fetched 2026-04-17 08:53:24
View on GitHub
Comments
3
Participants
4
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×3labeled ×2

Code Example

{
  "span.type": "tool",
  "tool_name": "Skill",
  "duration_ms": 6
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Problem Statement

When OTEL tracing is enabled (beta), claude_code.tool spans for Skill and Agent tool invocations only include the generic tool_name (e.g., "Skill" or "Agent"). The specific skill being invoked (e.g., "compose-render", "direct-creative-brief") is not present on the span.

The corresponding claude_code.tool_result log records do include the specific name via tool_parameters and tool_input attributes, but log records do not carry traceId or spanId, so they cannot be linked back to their span.

Current span attributes:

{
  "span.type": "tool",
  "tool_name": "Skill",
  "duration_ms": 6
}

Proposed Solution

Resolve tool_name to the actual skill/agent name instead of the generic wrapper name (e.g., "fix-docs" instead of "Skill").

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

Developer tools/SDK

Use Case Example

When building an observability dashboard over Claude Code sessions (e.g., tracking which skills are used most, measuring per-skill latency, building operation DAGs), the span tree is the natural data source it provides timing, parent-child relationships, and trace context.

However, with tool_name: "Skill" on every skill span, it is not possible to break down metrics by actual skill without falling back to log records, which lack trace linkage.

Additional Context

No response

extent analysis

TL;DR

Update the OTEL tracing to include the specific skill name in the claude_code.tool spans, rather than the generic tool_name.

Guidance

  • Review the current implementation of OTEL tracing in the claude_code.tool spans to identify where the tool_name is being set and update it to include the specific skill name.
  • Verify that the tool_parameters and tool_input attributes in the claude_code.tool_result log records contain the specific skill name and can be used as a reference for the update.
  • Consider adding a new attribute to the claude_code.tool spans to include the specific skill name, rather than overwriting the existing tool_name attribute.
  • Test the updated tracing to ensure that the specific skill name is being correctly included in the spans and can be used for observability and metrics.

Example

{
  "span.type": "tool",
  "tool_name": "compose-render",
  "duration_ms": 6
}

Notes

The update should be done in a way that does not break existing functionality or compatibility with other parts of the system.

Recommendation

Apply workaround: Update the OTEL tracing implementation to include the specific skill name in the claude_code.tool spans, as this will provide the necessary information for observability and metrics without requiring significant changes to the existing system.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] claude_code.tool spans don't identify which skill or agent was invoked [3 comments, 4 participants]