Skip to content

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.

(worktreePath, criticSessionId) => Promise<SessionUsage | null>

(criticSessionId, usage, now) => void

string

string

number

string

Promise<void>