captureUsage
captureUsage(
readUsage,completeReviewerSpawn,worktreePath,criticSessionId,now,logLabel):Promise<void>
Defined in: src/critic-core.ts:495
Best-effort usage attribution: read the finished reviewer’s token totals off its transcript and complete its spawn row. The reviewer transcript lives under ~/.claude/projects (keyed by worktree path) and survives the worktree removal, so reading it after finalize is safe. Individually guarded — a transcript-read failure must never strand the caller.
Parameters
Section titled “Parameters”readUsage
Section titled “readUsage”(worktreePath, criticSessionId) => Promise<SessionUsage | null>
completeReviewerSpawn
Section titled “completeReviewerSpawn”(criticSessionId, usage, now) => void
worktreePath
Section titled “worktreePath”string
criticSessionId
Section titled “criticSessionId”string
number
logLabel
Section titled “logLabel”string
Returns
Section titled “Returns”Promise<void>