You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(aidd-telemetry): a session run in a git worktree is missing from every report outside that worktree, and lost when the worktree is removed #932
A session run in a git linked worktree is missing from aidd telemetry report run anywhere else, and is lost for good once the worktree is removed.
The hook writes the run journal under the worktree's own aidd_docs/runs/ (git rev-parse --show-toplevel). The CLI reads only the journal of the checkout it runs in, and the sink is filled only from that journal. aidd telemetry on git-ignores aidd_docs/runs/, so git worktree remove deletes the journal with the worktree.
Affected file(s)
cli/src/kernel/paths.ts (resolvedRunsDir)
cli/src/kernel/reading/repository-root.ts (repositoryRootAbove stops at the worktree's .git file)
plugins/aidd-telemetry/hooks/lib/repo.cjs (journal anchored at --show-toplevel)
Expected behaviour
A session run in any worktree of a repository appears in a report run from any checkout of that repository, and still appears after that worktree is removed.
Observed behaviour
One repository, three active worktrees, one Claude Code session each:
Session
session_start in its worktree journal
Records in the sink
A
yes, with worktree_id
0
B
yes, with worktree_id
695 (a report was run from B)
C
yes, with worktree_id
0
A report from the main checkout sees none of them. Removing the worktree of A or C now leaves no journal to recover their cost from; the transcripts remain but nothing names them.
Whatever is chosen, a journal must outlive git worktree remove.
A report run from any checkout of a repository counts the sessions of all its worktrees. Only the cumulative figure is reported: worktree_id stays in the journal, and the report adds no worktree axis (the task, backlog, flow and agent axes already answer what a piece of work cost).
Context / Technical constraints
fix(framework): a git worktree gets its own journal, by accident rather than by decision #693 assumed "sessions from worktree B still contribute their tokens, the sink pools everything, they read as unattributed". That no longer holds: the sink is filled only through the current checkout's journal (read-local-cost-use-case.ts, report-cost-use-case.ts catch-up), so those sessions are absent, not unattributed.
Committing journals is not an option: aidd telemetry on git-ignores them on purpose (telemetry-on-use-case.ts).
Agent runners (Orca, Claude Code under .claude/worktrees/) give each agent its own worktree, so this is the common case, not an edge case.
Environment
AI tool
Claude Code 2.1.283
aidd-cli version
5.4.0
OS
Windows 11 Pro (10.0.26100)
node
24.12.0
aidd-telemetry
0.2.0
QA
In a repository with telemetry on, create two worktrees and run one session in each.
From the main checkout, run aidd telemetry report: both sessions appear.
git worktree remove one worktree, run the report again: its session still appears.
Description
A session run in a git linked worktree is missing from
aidd telemetry reportrun anywhere else, and is lost for good once the worktree is removed.The hook writes the run journal under the worktree's own
aidd_docs/runs/(git rev-parse --show-toplevel). The CLI reads only the journal of the checkout it runs in, and the sink is filled only from that journal.aidd telemetry ongit-ignoresaidd_docs/runs/, sogit worktree removedeletes the journal with the worktree.Affected file(s)
cli/src/kernel/paths.ts(resolvedRunsDir)cli/src/kernel/reading/repository-root.ts(repositoryRootAbovestops at the worktree's.gitfile)plugins/aidd-telemetry/hooks/lib/repo.cjs(journal anchored at--show-toplevel)Expected behaviour
A session run in any worktree of a repository appears in a report run from any checkout of that repository, and still appears after that worktree is removed.
Observed behaviour
One repository, three active worktrees, one Claude Code session each:
session_startin its worktree journalworktree_idworktree_idworktree_idA report from the main checkout sees none of them. Removing the worktree of A or C now leaves no journal to recover their cost from; the transcripts remain but nothing names them.
Proposed solution
worktree_idfield (feat(framework): a session says which worktree it ran in #695), and the per-worktree default was kept without a recorded decision.git worktree remove.worktree_idstays in the journal, and the report adds no worktree axis (the task, backlog, flow and agent axes already answer what a piece of work cost).Context / Technical constraints
read-local-cost-use-case.ts,report-cost-use-case.tscatch-up), so those sessions are absent, not unattributed.aidd telemetry ongit-ignores them on purpose (telemetry-on-use-case.ts)..claude/worktrees/) give each agent its own worktree, so this is the common case, not an edge case.Environment
QA
aidd telemetry report: both sessions appear.git worktree removeone worktree, run the report again: its session still appears.Relations