Repository navigation
fix(cli): check fails a session that belongs to another project #872
Description
Description
aidd telemetry check reports hook fired FAIL — this session left no run file when the anchored session belongs to a different project. The hook is fine; the session simply never worked in this repository.
The anchor is inherited: any process nested inside a Claude Code session sees CLAUDE_CODE_SESSION_ID, whatever directory it runs in. resolveSessionAnchor (cli/src/contexts/telemetry/domain/session-anchor.ts) already documents that inheritance for the Codex-inside-Claude case and orders the variables accordingly, but nothing downstream asks whether the anchored session belongs to this project.
So a user running check from a shell that another tool's session spawned — an agent running the 02-check skill against a second repository, a terminal opened inside an editor session, a CI step under an agent — is told the chain is broken when it is not. That is the failure this layer forbids elsewhere: an unknown shown as a negative instead of being named.
Affected
cli/src/contexts/telemetry/domain/telemetry-claim.ts — sessionAnchoredClaim, reason session-left-no-run-file
Expected
Three distinguishable answers, as the claim already models them:
- the anchored session journalled here →
ok - no anchor at all →
unknown, whichnoAnchorClaimalready returns - an anchor that belongs to another project →
unknown, naming that, notfail
fail stays for what it means: this project's own session ran and the hook wrote nothing.
Observed
hook fired FAIL this session left no run file — the newest one is from 2026-09-16T03:30:54Z
session journalled ok 3 of 5 run file(s) carry more than session_start
records join ok 12 of 20 record(s) joined a step, 8 unattributed
Every other claim on the same run says the chain records. Only the anchored-session claim fails, and it fails for a session that was never supposed to appear in this repository.
Steps
- Open a Claude Code session in project A.
- From that session, run
aidd telemetry checkin project B, where measurement is on and sessions have been journalled. hook firedreports FAIL, naming a run file that has nothing to do with the anchored session.
Possible direction, not a prescription
The data to tell the two apart is already read by this command:
- the stored records carry
vendor_idandproject_id, so an anchor found under another project is decidable; - Claude Code's own transcript for a session id sits under its project directory, and the
tool files readableclaim already walks those files.
Either source answers "is this anchor this project's session"; neither needs a new input. The change is one reason, one branch, and its display string.
Environment
- Tool: Claude Code
- CLI: 5.3.0
- Plugin: aidd-telemetry 0.2.0
- OS: macOS
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(cli): check names an anchor that belongs to another project (#886)
blafourcade commentedon Sep 24, 2026
Resolved by #886, merged into
nexton 2026-09-21.Verification:
unknownwith reasonanchor-in-another-project; this project's own missing run file still reportsfail.Closing as completed.