Skip to content

Commit bb957e9

Browse files
docs: updates structure of readme
1 parent e48971f commit bb957e9

1 file changed

Lines changed: 41 additions & 54 deletions

File tree

‎.github/README.md‎

Lines changed: 41 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<h1 align="center">AI usage dashboard 📊</h1>
1+
<h1 align="center">AI usage dashboard</h1>
22
<p align="center">
3-
<i>Every token your AI coding tools have spent, off the transcripts already on your machine</i>
3+
<i>Beautiful dashboard showing a breakdown of where all of your tokens are going</i><br>
4+
<b><code>npx token-usage-dashboard</code></b>
45
</p>
56

67
<p align="center">
@@ -11,26 +12,20 @@
1112

1213
## About
1314

14-
Claude Code, Codex and friends all leave a paper trail. A JSONL transcript per session, token
15-
counts on every turn, and in Codex's case the rate-limit windows too. Nothing reads them, so you
16-
end up guessing what a week of agents actually cost you.
15+
Ever wondered where all your tokens are going? Or how much your AI usage is valued at?
16+
This usage dashboard reads your local Claude Code, Codex, Open Code transcripts and builds a beautiful dashboard breaking down your full historical usage.
1717

18-
This reads those files, keeps a copy in a small SQLite database, and draws the lot:
18+
Everything happens locally, so your data never leaves your device.
19+
Stats are cached in a local SQLite DB, so that you get full history even after Claude and Codex have pruned old transcripts.
20+
Cost estimates come from current published API rates.
1921

22+
The dashboard shows:
2023
- a calendar heatmap of every day since your records start
21-
- daily totals, stacked by tool or by model
24+
- daily totals, stacked by tool, model and project
2225
- the split between fresh input, output, cache reads and cache writes
23-
- which projects and models the tokens went to
24-
- your Claude 5-hour and 7-day windows, and the Codex ones
25-
- every session, with what it spent and how long it ran
26-
27-
The database matters more than it sounds like it should. Claude Code prunes its transcripts after
28-
a week or two, so anything not copied out is gone. Once this has been running a while its history
29-
goes back further than the files do.
30-
31-
Cost is an estimate at published API rates. If you're on a subscription that's a weight rather
32-
than a bill, and the plan windows are the thing really constraining you. A model we have no
33-
price for is reported as unpriced, never quietly counted as free.
26+
- which projects, AI providers and models the your tokens went to
27+
- Anthropic and OpenAI 5-hour and 7-day windows
28+
- every session, with full token usage breakdown
3429

3530
---
3631

@@ -54,6 +49,30 @@ turn off in settings.
5449

5550
---
5651

52+
## Configuration
53+
54+
Most of it lives behind the gear icon: theme, default range, how often to rescan, whether to ask
55+
Anthropic for your plan windows, and price overrides for any model we've got wrong or don't know.
56+
57+
Paths are environment variables, since they're needed before the app starts. See
58+
[`.env.example`](https://github.com/NotAFlightRisk/ai-usage-dashboard/blob/main/.env.example) for the full list. The ones you'll actually want are
59+
`AIUSAGE_DB`, `AIUSAGE_CLAUDE_DIR` and `AIUSAGE_CODEX_DIR`.
60+
61+
---
62+
63+
## Supported tools
64+
65+
| Tool | Where it reads |
66+
| ----------- | -------------------------------------------------------------- |
67+
| Claude Code | `~/.claude/projects/**/*.jsonl`, subagent transcripts included |
68+
| Codex | `~/.codex/sessions/**/*.jsonl` |
69+
| OpenCode | `~/.local/share/opencode/storage/message` |
70+
71+
Adding another is one file in `src/lib/server/sources/`. If a tool writes token counts somewhere
72+
we can read, it can go in - open an issue with a sample and we'll have a look.
73+
74+
---
75+
5776
## Deployment
5877

5978
### Option 1: Docker
@@ -91,40 +110,12 @@ then `npm ci --omit=dev && npm start`.
91110

92111
Follow [Development](#development) below, then `npm run build && npm start`.
93112

94-
No hosted deploy, and there won't be one. It reads files on your machine, so somebody else's
95-
server would have nothing to look at.
96-
97-
---
98-
99-
## Configuration
100-
101-
Most of it lives behind the gear icon: theme, default range, how often to rescan, whether to ask
102-
Anthropic for your plan windows, and price overrides for any model we've got wrong or don't know.
103-
104-
Paths are environment variables, since they're needed before the app starts. See
105-
[`.env.example`](https://github.com/NotAFlightRisk/ai-usage-dashboard/blob/main/.env.example) for the full list. The ones you'll actually want are
106-
`AIUSAGE_DB`, `AIUSAGE_CLAUDE_DIR` and `AIUSAGE_CODEX_DIR`.
107-
108-
---
109-
110-
## Supported tools
111-
112-
| Tool | Where it reads |
113-
| ----------- | -------------------------------------------------------------- |
114-
| Claude Code | `~/.claude/projects/**/*.jsonl`, subagent transcripts included |
115-
| Codex | `~/.codex/sessions/**/*.jsonl` |
116-
| OpenCode | `~/.local/share/opencode/storage/message` |
117-
118-
Adding another is one file in `src/lib/server/sources/`. If a tool writes token counts somewhere
119-
we can read, it can go in - open an issue with a sample and we'll have a look.
120-
121113
---
122114

123115
## Development
124116

125-
You'll need [Node](https://nodejs.org/) 22.12 or newer (that's where `node:sqlite` lands), plus
126-
[Git](https://git-scm.com/). It's a [SvelteKit](https://svelte.dev/docs/kit) app and the build
127-
comes out self-contained, so an install of it pulls in no runtime dependencies at all.
117+
You'll need [Node](https://nodejs.org/) 22.12 or newer, plus [Git](https://git-scm.com/).
118+
It's a [SvelteKit](https://svelte.dev/docs/kit) app and the build is self-contained so there's no runtime dependencies at all.
128119

129120
```bash
130121
git clone git@github.com:NotAFlightRisk/ai-usage-dashboard.git
@@ -133,12 +124,8 @@ npm install
133124
npm run dev
134125
```
135126

136-
The dev server is then on [localhost:5173](http://localhost:5173). The other scripts you'll want
137-
are `npm run check` (types), `npm test` (tests) and `npm run format`.
138-
139-
Provider logos come from [Simple Icons](https://simpleicons.org) (CC0) and
140-
[LobeHub](https://github.com/lobehub/lobe-icons) (MIT), which covers the few Simple Icons has
141-
dropped. The marks themselves belong to their owners and are only used to point at them.
127+
The dev server is then on [localhost:5173](http://localhost:5173).
128+
The other scripts you'll want are `npm run check` (types), `npm test` (tests) and `npm run format` (prettier).
142129

143130
---
144131

0 commit comments

Comments
 (0)