Skip to content

Data files and storage locations

AI Ledger keeps everything in one folder per user, outside the installed code. An upgrade keeps the store and every stored line.

System Folder
macOS ~/Library/Application Support/ai-ledger/
Linux $XDG_DATA_HOME/ai-ledger/, or ~/.local/share/ai-ledger/ when XDG_DATA_HOME is unset or empty
With --db <file> The folder of that file

The app creates the folder on first start, readable by your user only.

File Holds Created by
ai-ledger.duckdb The store: a DuckDB database with every transcript line verbatim, and the tables derived from them. Only your user can read or write it. The app, on first start.
ai-ledger.duckdb.wal DuckDB’s write-ahead log of the store, and its temporary files. They hold transcript text too. DuckDB.
prices.json Model prices and plan prices. See Configuration. You, optional.
automated.json Extra automated projects. See Configuration. You, optional.
workloads.json Named groups of sessions for /metrics. See Configuration. You, optional.

With --db <file>, the configuration files are prices.json, automated.json and workloads.json next to that file, and the app uses that file as the store.

  • Every line of every transcript the app has read, from Claude Code (--projects), Codex (--codex) and Grok (--grok), as written. A deleted, truncated or rewritten source file does not remove or change the stored lines.
  • The tables derived from those lines: sessions, requests, tool calls and prompts, each linked to its project and session. All three sources map onto the same tables.
  • Claude Code’s /insights usage data, plan-limit snapshots and the /context snapshots that Claude Code records in transcripts.
  • The Errors page’s marks (fix days and muted types). They come from your actions, not from transcripts. ai-ledger rebuild leaves them as they are.

The store holds full transcript content, including any secrets that appeared in a session. Do not share it or commit it. See Privacy and security model.

What Where
Claude Code transcripts (read) ~/.claude/projects
Claude Code /insights usage data (read) ~/.claude/usage-data
Codex sessions (read) ~/.codex
Grok sessions (read) ~/.grok/sessions
Theme, sheet width and chart and list preferences (Activity’s metric, Cost’s measure, stacking, scale and hidden token kinds, Errors’ view and list mode) Your browser’s local storage, per browser

The app never writes to the transcript roots.

A source checkout that kept its store in data/ai-ledger.duckdb, or in the earlier data/claude.duckdb, has it moved to the data folder, with its log, the first time the app opens the default store. The app never replaces an existing store. When the two are on different disks, the app exits with the message “cannot move the store … they are on different disks” and names both paths; move the file by hand or pass --db <old path>.

To try a store without touching the live one, copy the .duckdb file (and its .wal file, if any) while the app is stopped, and serve the copy on another port:

Terminal window
ai-ledger --db <copy> --port 8766