Repository navigation
feat(telemetry): add the Claude Code telemetry adapter (2/4, GRO-305) - #27
Conversation
|
@BugBot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1c51f07. Configure here.
teallarson
left a comment
There was a problem hiding this comment.
Independent final review at 1c51f07f115d5b3965b133368e542b37b13719ae: ready for human review with telemetry OFF.
Independent mapping/opt-out review: 21 focused tests, typecheck, generation and all 19 literal enabled-fixture shell commands silent while OFF. No remaining code finding.
Ready-for-review CI passed tests, all four client checks and the required aggregate gate; current-head Cursor Bugbot is green. Final combined heads plus main 18c7c99 passed 170/170 tests, zero skips, typecheck, four validators and 13 generated outputs. Independent combined privacy/release/adapter-removal review found no new blocker.
Windows, live client delivery and production ingestion remain activation prerequisites. No merge, release or collection enablement is authorized by this review. Descriptions preserve own-base review maps and limitations; Teal will inspect and request human reviewers.
— Strider 🐦⬛, Teal's agent · approved by Teal
…n gate The 19 enabled-fixture commands were fed a SessionStart input, which maps to no event, so the test passed even with TELEMETRY_ENABLED flipped true. Feed a sendable prompt, clear inherited Claude opt-outs, and add a positive control that the loopback capture server observes a direct send. Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
1c51f07 to
45edb2c
Compare
Move the gateway-on-another-server and service inference fallback into otherServerToolProperties so adapters keep only their own name parsing. Export hookEnv, spawnExitCode and assertSilentThenServerReachable from the telemetry test helpers, and use captureTelemetry instead of hand-rolled runTelemetry calls in the Claude tests. Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
…checks Register tempDataDir cleanup at module load; an after() hook created inside the first test only ran after that test. Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Part of GRO-305 · issue
What/why
Prepares Claude Code to measure when a prompt may benefit from Arcade and whether Arcade is used, including tool failures and operator completion status. These measurements would add client-side context that server call logs cannot provide. Collection stays disabled: this PR leaves shipped hooks unchanged and sends no telemetry.
Codebase changes
Adds a Claude Code adapter to the existing telemetry hook generator. It maps prompt, tool, and subagent callbacks into the shared event format, identifies Arcade versus other tools, and honors Claude-specific opt-outs. Fixtures and tests cover event mapping, turn scope, opt-outs, generated hook wiring, and the disabled runtime.
Additional notes
Current-head CI passes tests and all four client validators. Disabled-runtime tests verify that hooks emit no output or telemetry, with a positive control to confirm the test can detect a send. Live Claude delivery, Windows behavior, and production ingestion remain unverified. Enabling collection requires a separate reviewed change and privacy approval.
— Strider 🐦⬛, Teal's agent · approved by Teal.
Note
Medium Risk
Adds client-specific hook/telemetry wiring and classification logic that would run once enabled; behavior is heavily tested but production ingestion and live Claude delivery are still out of scope for this PR.
Overview
Adds a Claude Code telemetry adapter and registers it on the
claude-codehost so the shared hook generator can emit Claude-specific telemetry rows (prompt submit, Arcade/other MCP pre/post tool use, WebFetch/WebSearch, per-CLI Bash, subagent stop). The adapter normalizes hook payloads, maps plugin vsclaude_aiArcade MCP prefixes and third-party MCP servers into contract events, and treats Claude opt-out env vars as “any non-empty value disables.”Shared event building gains
otherServerToolPropertiesfor non-plugin MCP tools (gateway tools vs service inferred from tool/server names). Tests and fixtures exercise the full event matrix, turn/scope behavior, opt-outs, golden enabled manifest wiring, and that the shipped Claude manifest still omits telemetry so collection stays off at runtime.Test helpers now strip inherited telemetry env (
hookEnv), defer temp dir cleanup until file end, and addassertSilentThenServerReachableso “no send” cases cannot pass by posting elsewhere.Reviewed by Cursor Bugbot for commit a3fd91f. Bugbot is set up for automated code reviews on this repo. Configure here.