Skip to content

caude hook trace propagation - #330

Open
davidabram wants to merge 7 commits into
mainfrom
claude-hook-trace-propagation
Open

davidabram wants to merge 7 commits into
mainfrom
claude-hook-trace-propagation

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

davidabram and others added 6 commits October 17, 2026 13:28
Capture the staged implementation plan for connecting Claude Code hook execution to managed OTLP tracing, including propagation probing, hook span admission, child spans, privacy and parity constraints, and live verification.

Plan: claude-hook-trace-propagation
Tasks: T01, T02, T03, T04, T05

Co-authored-by: SCE <sce@crocoder.dev>
Capture Claude Code 2.1.301 probe results for PreToolUse and PostToolUse hooks,
including the interaction-span parent context, tool_use_id correlation, caller
environment markers, and telemetry gating behavior. Update the context map and
complete T01 with the qualified parent_context_available verdict, while
documenting that future SCE hook spans must be siblings of Claude tool spans
under claude_code.interaction.

Plan: claude-hook-trace-propagation (T01)

Co-authored-by: SCE <sce@crocoder.dev>
Enable managed OTLP telemetry for Claude-invoked hook processes while keeping non-Claude hooks and the telemetry-header helper on Noop. Classify admitted invocations before credential lookup, emit one privacy-filtered `sce.hook` span with Claude correlation IDs, and preserve fail-open hook behavior under credential or exporter failures. Add admission, payload-redaction, and parity coverage while updating the observability contract and decision record.

Plan: claude-hook-trace-propagation (T02)

Co-authored-by: SCE <sce@crocoder.dev>
Join Claude hook telemetry to Claude Code's W3C trace when a valid parent is available, while preserving independent roots for missing or invalid context. Extract TRACEPARENT/TRACESTATE only for Claude hooks, attach the parent to the root span, and verify child-span inheritance across async polls and worker migration.

Plan: claude-hook-trace-propagation (T03)

Co-authored-by: SCE <sce@crocoder.dev>
Expose the mutation-scope, Git snapshot, and persistence phases of admitted Claude hooks as low-cardinality OTLP child spans so hook traces show which operations actually ran without changing command behavior. Add reusable span instrumentation at the Claude adapter, mutation-trace coordinator, and scope runtime boundaries, and filter child spans out of ordinary command exports.

Ref: context/plans/claude-hook-trace-propagation.md (T04)

Co-authored-by: SCE <sce@crocoder.dev>
Complete T05 for the claude-hook-trace-propagation plan by recording Dash0 evidence for `sce doctor` and a Claude Code session, documenting the verified and unverified span hierarchy, and adding an opt-in live smoke procedure. Sync the current admission, session-boundary behavior, credential, and context-map documentation.

The live evidence confirms standalone and session-boundary exports while leaving parented tool-hook delivery unverified; local validation and smoke results are recorded without claiming collector delivery.

Plan: claude-hook-trace-propagation, task T05

Co-authored-by: SCE <sce@crocoder.dev>
@davidabram
davidabram force-pushed the claude-hook-trace-propagation branch from b3d9d9f to 1f10987 Compare October 17, 2026 17:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant