Skip to content

Capture Claude Code native usage through the existing telemetry path #4801

Closed

Description

@EHotwagner

Owner: Programme /root is accountable for intake, enrollment and acceptance. The .github telemetry owners own the source change. No dispatch follows from filing.

Done when: A Claude Code session's native usage reaches the existing local telemetry path with the same semantics Codex has, and no new wire schema is needed. Specifically: (1) a strict, bounded reader for Claude Code transcript JSONL (~/.claude/projects/<project>/<session>.jsonl) emits one row per distinct API response. Rows are keyed by message.id with requestId, model, effort and timestamp, and are deduplicated across the repeated per-content-block records. Uncached, cache-read and cache-creation input and output are counted, and output_tokens_details.thinking_tokens is reported as reasoning only when present. Main-thread and sidechain/subagent usage stay separate. Malformed, partial, rotated or oversized input fails closed or withholds totals, and is never reported as zero. (2) fsgg-coord telemetry usage collect claude accepts that transcript as well as the existing --snapshot, matching the Codex --session-file/--turn-id/--all-responses/--since/--until contract. (3) Passive capture accepts an explicitly selected Claude transcript through the existing provider-usage-observation/1 path, with its own provenance, stable passive identities and canonical-only partial attribution, as with codex-local-rollout/1. (4) The pnext-item lifecycle-ledger and runtime-observation guidance name the working Claude route instead of the unwired status-line/Stop-hook recipe. Focused tests use real-shape fixtures, include causal negative controls, and pass in the required CI.

Current deliverable: Source-only Delivery: the transcript reader, CLI/passive-capture wiring, tests and guidance in FS-GG/.github. Installed adoption, Host/receiver ingestion and browser display stay with parent #4640. Candidate: PR #4802 (routine/claude-native-usage-capture), head 1552a12ffbfb3dbda1c29ec35e7098bde31ae4a8, open and unmerged. Independent source review has not been recorded. Merging this source delivers no installed, Host or receiver acceptance.

Next action: The accountable source owner implements the reader beside SkillTelemetryReaders/Telemetry.collectClaude in one PR. Protected enrollment in the Project 3 cohort is a separate pending Programme/root effect before any board-selected dispatch.

Blocked on: Nothing blocks source preparation. Unknown: the subagent transcript location/shape (no Claude subagent transcript exists on the observing host), and whether the current status-line payload still carries prompt_id/timestamp as collectClaude requires. Both must be measured, not assumed.

Acceptance evidence: Gap observed 2026-10-22 on main 5a80f17. Codex has session collection (collectCodex), passive rollout capture (codex-local-rollout/1) and dispatched-child usage via App Server. Claude Code has only collectClaude, which needs a status-line snapshot file. No status line, Stop or SubagentStop hook is configured in .claude/settings.json or user settings, and scripts/v2-progress/collect-local.py reads only ~/.codex/sessions. Live Claude transcript shape observed: 69 distinct message.id values across 125 assistant records, with identical usage repeated within each id. .fsgg/agents.yml requires requireEquivalentClaudeAndCodexBehavior. Related parity fix: #4800; Atlas github/claude-codex-runtime-parity. Record the PR/head, CI and review here after they exist.

Candidate evidence, recorded 2026-10-22 for PR #4802 at head 1552a12f:

  • Local test runs at this head: dotnet test tests/FS.GG.Coord.Core.Tests -c Release 1227 passed; tests/FS.GG.Coord.Cli.Tests 750 passed; tests/FS.GG.Telemetry.Tests 118 passed.
  • Other local checks: tests/telemetry-parity/run.py passed; scripts/check-fsc02-telemetry-closure.py reported no issues; scripts/check-signature-doc-siting.py OK; skill-fsharp contracts, readers, adapter, preflight and cli all passed; scripts/check-skill-quality OK; skill-view-parity AGREE; generate-driver-manifest --check current; tests/atlas/check.py checked 355 records.
  • Causal mutations, each caught by the focused Claude tests: removing the disagreeing-usage refusal, defaulting a missing counter to 0, and counting streaming records.
  • Real-shape parity (local only, nothing committed): on copies of one main and one subagent transcript, CLI rows and passive records matched with 0 counter, turn or thread mismatches.
  • Measured on Claude Code 2.1.299 (shape only): the subagent transcript lives at <session>/subagents/agent-<agentId>.jsonl. Its streaming writer emits stop_reason: null records with provisional counters, and 11 of 17 ids disagreed until completion, so dedupe uses completed records only. promptId is on every user record.
  • Required checks passed. Non-required kit-published-coherence / pr-arm is red because .claude/skills/pnext-item is kit source and the Kit <Version>, which is the coherent set 0.112.0, is not above the published 0.112.0. A coherent-set/kit successor and kit release are needed under their own authority before or with merge. CI at this head: 67 pass, 1 skipping, and only pr-arm failing; coord-engine / engine passed.
  • Still Unknown: whether status-line prompt_id/timestamp exist; --snapshot is unchanged.
  • Atlas: github/claude-transcript-native-usage.

Activity

  1. EHotwagner commented on Oct 22, 2026

    @EHotwagner
    ContributorAuthor

    Source delivered: PR #4802 squash-merged as 61526e9 from reviewed head 3505d16. Independent fsgg-critic-best review: APPROVE at that exact head after three REQUEST CHANGES rounds (incomplete coherent113 composition, dropped standing advisories, Creator pin), all resolved. CI at head: 83 pass, 1 skipping (published), all 8 required green. Source 0.113.0 composed; published112 and installed pins unchanged. Remaining for parent #4640: coherent113 publication, installed tool adoption, Host built from this source for claude-local-transcript/1 ingestion (Home, via #4516), and per-session capture triggering. Protected Project 3 enrollment of #4801 remains a pending Programme/root effect.

  2. EHotwagner commented on Oct 22, 2026

    @EHotwagner
    ContributorAuthor

    Programme/root acceptance 2026-10-22: the four "Done when" parts of this source-only Delivery are established by PR #4802 (squash merge 61526e9, independently reviewed APPROVE at exact head 3505d16, all required checks green). Remaining publication (coherent113), installed adoption, Host claude-local-transcript/1 ingestion via Home #4516 and per-session capture triggering are retained under parent Outcome #4640 and are not claimed here. This item was never enrolled in the protected cohort; its Project 3 membership was added by root at intake and is removed now so the protected 69-member cohort, inspection and guarded writers stay consistent. Closing as completed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions