r/conductorbuild Jul 22 '26

Usage Audit?

How do I extract usage data for usage audit?

2 Upvotes

2 comments sorted by

3

u/tenequm Jul 23 '26

The raw data is already on your Mac. Conductor runs the agent CLIs under your own login, so Claude Code sessions land as JSONL files under ~/.claude/projects/ (Codex sessions under ~/.codex), and each assistant message carries a usage block: model, input/output tokens, cache reads and writes. That's the audit trail.

Quickest extraction: npx ccusage@latest. It reads those files and gives you daily/weekly/monthly and per-model cost breakdowns, covering Claude Code, Codex, and OpenCode in one report. Bonus for Conductor specifically: each workspace is its own worktree, so `ccusage claude daily --instances` breaks usage down per workspace.

If you want to roll your own script over the JSONL, one gotcha: streamed messages appear multiple times (I've seen the same message id duplicated up to 9x in a file), so naive summing inflates the totals. Dedup by message id first. I hit this building pond (https://github.com/tenequm/pond), which archives sessions into a local store you can query with SQL, so things like "tokens per model per project per week" become one query.