BURNLENSDocsDashboard

Scanning coding-agent logs

Verified against burnlens scan --help on 2026-08-16. For the shorter pitch rather than the reference, see the scan overview.

What it does

Coding agents already write a full session log to disk. burnlens scan walks those files, deduplicates the turns, routes each call through the pricing engine, and writes the result to ~/.burnlens/burnlens.db.

There is no proxy, no code change, no signup, and no network call. It is retroactive — the first run prices history that already happened, which is why it produces a real number immediately rather than after a week of collection.

burnlens scan          # every agent it can find
burnlens top           # live view of what is being spent
burnlens repos         # top repos by cost
burnlens prs           # top PRs by cost

What it reads

Agent--providerRead from
Claude Codeclaude~/.claude/projects/<project>/<session>.jsonl
Cursorcursor~/Library/Application Support/Cursor/.../state.vscdb
Codexcodex~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
Gemini CLIgemini~/.gemini/tmp/<project>/chats/session-*.{json,jsonl}

Flags

burnlens scan --provider claude,codex   # 'all' (default), or a comma-separated subset
burnlens scan --since 2026-08-01        # only sessions modified at/after this date
burnlens scan --project burnlens        # substring filter on project basename (Claude Code only)
burnlens scan --dry-run                 # parse and print counts, insert nothing

Re-runs are idempotent. Already-imported records are skipped through a partial unique index on (source, request_id), so scanning on a schedule cannot double-count a session.

What the data can and cannot tell you

Scanned rows carry no prompt or response text — model, token counts, timestamps and the repo the session ran in, and nothing else.

Cost is attributed per repository, not per branch or PR. Agent session logs record which repo a session ran in; they do not record which branch it belonged to. With several PRs in flight, per-repo spend divided by accepted outcomes is the honest reading of what one merged PR costs, and it is what burnlens outcome show reports.

A model with no pricing entry contributes $0. The session is still imported and the model name is logged so the gap is visible rather than silent — run burnlens pricing if a number looks too low. Any total derived from a scan is therefore a floor, not a ceiling.

Scanned rows also carry no prompt segmentation, so the waste detectors that need it (oversized tool schemas, retrieval efficiency, history bloat) stay quiet on scan data. Those need proxy traffic — no scan and no upgrade can backfill a measurement that was never captured.

Next

Turn merged PRs into a cost-per-accepted-outcome number with burnlens outcome derive and burnlens outcome show — see the CLI reference. To meter production API traffic rather than agent sessions, see the proxy.

All documentation

  • Overview & install — What BurnLens is, how to install it, and which of the two entry points you want.
  • Scanning coding agents — Import Claude Code, Cursor, Codex and Gemini CLI cost history from local logs.
  • Proxy & tagging — Route production API traffic through the local proxy and attribute it with tags.
  • Budgets & hard caps — Daily key caps, team and customer budgets, virtual keys, downgrade routing.
  • CLI reference — Every burnlens command, and where the config file and database live.

Something here wrong or missing? Open an issue or email support@burnlens.app.