Skip to content

feat(telemetry): add the Claude Code telemetry adapter (2/4, GRO-305) - #27

Open
teallarson wants to merge 10 commits into
cursor/telemetry-foundation-a3a4from
cursor/telemetry-claude-a3a4
Open

teallarson wants to merge 10 commits into
cursor/telemetry-foundation-a3a4from
cursor/telemetry-claude-a3a4

Conversation

@teallarson

@teallarson teallarson commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Part of GRO-305 · issue

What/why

This connects Claude Code callbacks to the shared measurement pipeline: relevant prompts identify possible opportunities, tool callbacks record attempts/calls/failures, and operator completion records bounded status. Future reports compare selected opportunities with observed Arcade invocation by turn, extending what server call logs can show. Callback wiring and opt-outs are prepared, but no telemetry hooks are installed while collection is OFF.

See #26’s shared measurement diagram for local classification, privacy filtering and the current OFF gate, and #29’s reporting diagram for opportunity versus observed invocation and the client grouping limits.

Codebase changes

The Claude adapter translates hook inputs, declares client opt-outs and intended hook rows, and identifies tools without duplicating the shared event pipeline. Its registration remains inactive while the foundation's hard-OFF gate is false; reverting this slice leaves the foundation and Copilot slice intact.

Review area Files Added Removed
Hook/runtime and generator source 2 123 0
Shipped generated outputs 0 0 0
Tests, fixtures and test helpers 4 748 0
Documentation 0 0 0
Build config and dependencies 0 0 0
Total 6 871 0

Review map: foundation 26710300 → head 1c51f07f, using git diff --numstat base...head; this excludes every foundation change. The copied enabled-hook manifest is a test fixture, not a shipped generated-output change; categories are exclusive.

Proof

Behavior Evidence at 1c51f07f
Mapping, scope, opt-outs and malformed inputs Fresh independent Node 22.23.2 review passed 21 focused tests and typecheck; 19 literal manifest commands remain silent while OFF, including a plugin root containing spaces
Refactor parity 213 independently constructed comparisons against PR13 3035324: zero differences; enabled Claude fixture byte-identical to PR13's manifest
Client packaging and generation Exact-head CI: tests, all four validators and the non-draft aggregate check pass; local generated-file check passes

Additional notes

Merge #26 first, #27/#28 in either order, then #29. The three leaves currently target the foundation branch; after its squash merge, retarget/replay their own changes onto main and revalidate changed heads. Hold the generated release PR until the complete stack lands. Merging the release PR versions and tags the inactive build; it does not enable collection.

Activation requires a separate reviewed change and collection/privacy approval, verified Windows and live-client hook/opt-out delivery, and validated production ingestion and retention. Gateway telemetry remains canonical.

These are fixture/validator checks, not live Claude sessions, IDE or desktop Code delivery, Cowork opt-outs, or production ingestion. Existing keyword and tool-alias coverage limits remain; observations cannot establish complete routing recall or task success. Implementation run; merge foundation first, then Claude/Copilot in either order, and reporting/docs last.

cursoragent and others added 8 commits October 7, 2026 00:03
Inactive while TELEMETRY_ENABLED is false; the adapter itself comes in
hooks/telemetry-adapters/claude-code.mjs.

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>
Port PR #13 Claude hook mapping into hooks/telemetry-adapters/claude-code.mjs
with contract event fixtures and captureTelemetry coverage. Telemetry remains
off; generated hooks.json is unchanged.

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Ignore hooks/telemetry-adapters/ in the top-level telemetry filename filter.

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Document connector service inference, Bash hook if/extraArgs, and Claude
opt-out switch semantics. Build manifest rows without duplicate telemetry
entries; rename the hook-group test to describe behavior.

Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
cursoragent and others added 2 commits October 7, 2026 00:58
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
Co-authored-by: Teal Larson <LARSON.TEAL@GMAIL.COM>
@teallarson

Copy link
Copy Markdown
Contributor Author

@BugBot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 teallarson left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@teallarson teallarson changed the title Add the Claude Code telemetry adapter (2/4, GRO-305) feat(telemetry): add the Claude Code telemetry adapter (2/4, GRO-305) Oct 7, 2026
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.

2 participants