repospend 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to RepoSpend will be documented in this file.
4
4
 
5
+ ## 0.1.0
6
+
7
+ - Add GitHub Copilot support for local OTEL exports, Copilot session-state files, and VS Code Copilot Chat transcript/debug files, leaving cost unknown when local data lacks full token splits.
8
+ - Add Copilot source status, labels, settings metrics, quick links, tests, API-equivalent model pricing aliases, and VS Code model metadata recovery.
9
+ - Add Claude service-tier metadata and Codex current-config service-tier visibility in the dashboard cost summary and settings.
10
+ - Add a Data Doctor confidence report in the dashboard, Settings, and `repospend doctor`, covering token coverage, pricing coverage, repo verification, parser issues, source warnings, and empty-data states.
11
+ - Add pricing-gap triage in Settings and Usage Health, with one-click review of unpriced token-bearing sessions and clearer separation between missing model rates and missing token detail.
12
+ - Add bundled Claude Opus 4.8 pricing and inherited pricing labels for nearby newer Claude and GPT model IDs when an exact local rate is not present.
13
+ - Improve dashboard scanability by simplifying the Overview, promoting "Start here" actions, normalizing compact number/model labels, cleaning noisy markdown session titles, and adding a Sessions cost-outlier legend.
14
+ - Improve Agent Friction by treating command failures as triage evidence, routing review actions directly to command evidence, and avoiding false positives from source text or HTTP-style status codes.
15
+ - Add dashboard-style filters to CLI summaries and exports, and apply API export filters consistently across JSON and CSV.
16
+ - Harden localhost settings/cache mutations with Host and Origin checks for local API writes.
17
+ - Remove unused budget configuration and UI/documentation copy so old budget fields are intentionally dropped on the next config save.
18
+ - Improve README, package metadata, AI-readable docs, and dashboard screenshots for repo-level AI coding usage discovery while keeping Cursor experimental and RTK framed as token-reduction workflow context.
19
+ - Move detailed source paths and Cursor troubleshooting into `docs/data-sources.md`, and publish the linked docs with the npm package.
20
+ - Raise the Vite chunk warning threshold to match the current local dashboard bundle size.
21
+
5
22
  ## 0.0.9
6
23
 
7
24
  - Cache parsed Codex session summaries under `~/.repospend/cache` so unchanged large transcripts reload much faster.
package/README.md CHANGED
@@ -1,18 +1,23 @@
1
1
  # RepoSpend
2
2
 
3
+ RepoSpend is a local-first dashboard for tracking AI coding token usage and API-equivalent spend by repository, session, model, and tool. It supports local Codex, Claude Code, and GitHub Copilot usage data, runs with `npx repospend`, and does not upload prompts, code, transcripts, or usage data.
4
+
3
5
  [![npm version](https://img.shields.io/npm/v/repospend)](https://www.npmjs.com/package/repospend)
4
6
  [![npm downloads](https://img.shields.io/npm/dm/repospend)](https://www.npmjs.com/package/repospend)
5
7
  [![license](https://img.shields.io/npm/l/repospend)](./LICENSE)
6
8
  [![node](https://img.shields.io/node/v/repospend)](https://www.npmjs.com/package/repospend)
7
9
  [![CI](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml/badge.svg)](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml)
8
10
 
9
- RepoSpend shows where your AI coding tool usage is going across Codex, Claude Code,
10
- Cursor, and RTK. It is local, private, and repo-first.
11
+ RepoSpend turns local AI coding usage data into a repo-level cost dashboard, so
12
+ developers can see which projects, sessions, models, and tools are driving token
13
+ usage and estimated API-equivalent cost.
11
14
 
12
- It reads supported local usage files in read-only mode and groups sessions by Git
13
- repo.
15
+ Project links:
14
16
 
15
- No login. No telemetry. No prompt uploads.
17
+ - Website: [https://repospend.com](https://repospend.com)
18
+ - GitHub: [https://github.com/mehmetdemircs/RepoSpend](https://github.com/mehmetdemircs/RepoSpend)
19
+ - npm package: [`repospend`](https://www.npmjs.com/package/repospend)
20
+ - AI-readable summary: [docs/llms.txt](docs/llms.txt)
16
21
 
17
22
  ```bash
18
23
  npx repospend
@@ -21,6 +26,13 @@ npx repospend
21
26
  RepoSpend opens a local dashboard, usually at
22
27
  [http://localhost:2005](http://localhost:2005).
23
28
 
29
+ Best for developers who want to:
30
+
31
+ - see which repositories are driving AI coding usage
32
+ - compare Codex, Claude Code, and GitHub Copilot usage locally
33
+ - inspect expensive sessions without uploading prompts or code
34
+ - understand token shape, cache reuse, model mix, and agent friction
35
+
24
36
  ## Preview
25
37
 
26
38
  ![RepoSpend overview dashboard with fictional Middle-earth usage data](docs/screenshots/dashboard-overview.png)
@@ -29,16 +41,32 @@ Screenshots use fictional Middle-earth demo data. The Lord of the Rings themed
29
41
  repo names, sessions, prompts, token counts, and costs are intentional; no private
30
42
  repository data is shown.
31
43
 
44
+ ## What is RepoSpend?
45
+
46
+ RepoSpend is a local-first AI coding spend dashboard for developers and teams
47
+ who want to understand usage by repository instead of only by account, day, or
48
+ tool. It reads supported local files in read-only mode, normalizes them into
49
+ sessions, and groups them by Git repository.
50
+
51
+ Use it to inspect Codex token usage, Claude Code token usage by repo, GitHub
52
+ Copilot local usage data, model mix, cache reuse, and the sessions behind high
53
+ estimated API-equivalent spend.
54
+
32
55
  ## Why RepoSpend?
33
56
 
34
- AI coding tools are powerful, but it is hard to see where the usage goes.
57
+ AI coding tools are powerful, but it is hard to see which repo, session, model,
58
+ or workflow is responsible for the usage.
35
59
 
36
- RepoSpend helps answer:
60
+ RepoSpend helps answer practical questions:
37
61
 
38
62
  - Which repo is using the most tokens?
39
63
  - Which sessions were unusually expensive?
40
64
  - Which model or tool generated the spend?
65
+ - What token shape drove the cost: input, cached input, output, or reasoning?
66
+ - Are cache reads reducing repeated input work?
67
+ - Is spend concentrated in one model, one repo, or one day?
41
68
  - Where did the agent get stuck retrying commands?
69
+ - Which sessions should be exported or reviewed later?
42
70
  - How much would this usage roughly cost at API-style rates?
43
71
 
44
72
  Everything stays local.
@@ -68,18 +96,22 @@ prints the dashboard URL. By default it runs at
68
96
  |---|---|---|
69
97
  | Codex | Most complete support | Tokens, models, sessions, repo grouping, command friction |
70
98
  | Claude Code | Initial support | Sessions, projects, models, timestamps, tokens when available |
99
+ | GitHub Copilot | Initial support | Copilot CLI OTEL exports, Copilot CLI session state, and VS Code Copilot Chat transcripts; costs only when local data includes full token splits |
71
100
  | Cursor | Experimental opt-in | Local JSONL and SQLite/vscdb discovery; tokens/cost only when local data includes them |
72
- | RTK | Optional/local | Shown only when local RTK data exists |
101
+ | RTK | Token reduction workflow | Not an AI model or coding assistant; shown by default as workflow context for reducing token waste |
73
102
 
74
103
  RepoSpend started as a Codex-first release. Claude Code support is newer, and
75
- Cursor is off by default because accurate Cursor token usage often requires
76
- account-backed usage data rather than local files alone.
104
+ GitHub Copilot support is newest. Cursor is off by default because accurate
105
+ Cursor token usage often requires account-backed usage data rather than local
106
+ files alone.
77
107
 
78
108
  ## Requirements
79
109
 
80
110
  - Node.js `20` or newer
81
111
  - macOS, Linux, or Windows
82
- - Local Codex, Claude Code, Cursor, or RTK data, depending on what you want to inspect
112
+ - Local Codex, Claude Code, or GitHub Copilot data for usage analytics
113
+ - Optional RTK data if you want token-reduction workflow context
114
+ - Cursor data only if you enable experimental Cursor import
83
115
 
84
116
  RepoSpend uses `better-sqlite3`, so npm may install a native SQLite package for
85
117
  your platform.
@@ -88,23 +120,12 @@ your platform.
88
120
 
89
121
  RepoSpend helps you break down local AI coding usage by:
90
122
 
91
- - repo
92
- - session
93
- - day and hour
94
- - model
95
- - source/tool and app/surface, where detectable
96
- - token type
123
+ - repo, session, day, and hour
124
+ - model, source/tool, and app/surface where detectable
125
+ - input, cached input, output, and reasoning token shape
97
126
  - estimated API-equivalent cost
98
127
 
99
- If Codex records work from both of these paths:
100
-
101
- ```text
102
- /Users/elrond/dev/RivendellRecords
103
- /Users/elrond/dev/RivendellRecords/apps/web
104
- ```
105
-
106
- RepoSpend walks up to the Git root and shows them together as one
107
- `RivendellRecords` project.
128
+ Nested paths are grouped by Git root so usage rolls up to the repository.
108
129
 
109
130
  ## Screenshots
110
131
 
@@ -112,43 +133,37 @@ RepoSpend walks up to the Git root and shows them together as one
112
133
 
113
134
  ![RepoSpend repositories table with fictional repo usage](docs/screenshots/repos-view.png)
114
135
 
115
- The repos view compares spend, tokens, sessions, cache hit rate, file edits, and
116
- token intensity across projects.
136
+ Compare spend, tokens, sessions, cache hit rate, file edits, and token intensity.
117
137
 
118
138
  ### Repository Detail
119
139
 
120
140
  ![RepoSpend repository detail for one-ring-infra](docs/screenshots/repo-detail.png)
121
141
 
122
- Repo detail explains why a project stands out, including cost concentration,
123
- warnings, token shape, sessions, and command signals.
142
+ Inspect cost concentration, warnings, token shape, sessions, and command signals.
124
143
 
125
144
  ### Models
126
145
 
127
146
  ![RepoSpend models view with fictional model usage and token shape](docs/screenshots/models-view.png)
128
147
 
129
- The models view compares token shape, API-equivalent cost, cache reuse, sessions,
130
- and repo concentration across the models used in the current scan.
148
+ Compare token shape, API-equivalent cost, cache reuse, and repo concentration.
131
149
 
132
150
  ### Sessions
133
151
 
134
152
  ![RepoSpend sessions table with fictional session titles](docs/screenshots/sessions-view.png)
135
153
 
136
- The sessions view makes individual AI coding runs searchable and sortable by
137
- repo, tool, model, outcome, cost, tokens, and activity.
154
+ Search and sort individual AI coding runs by repo, tool, model, cost, and tokens.
138
155
 
139
156
  ### Session Detail
140
157
 
141
158
  ![RepoSpend session detail for a fictional palantir event stream fix](docs/screenshots/session-detail.png)
142
159
 
143
- Session detail shows the shape of one run: cost, tokens, model, file edits,
144
- commands, highlights, and issues to inspect.
160
+ Review one run's cost, tokens, model, file edits, commands, and issues.
145
161
 
146
162
  ### Agent Friction
147
163
 
148
164
  ![RepoSpend agent friction screen with fictional command issue signals](docs/screenshots/agent-friction.png)
149
165
 
150
- Agent Friction separates blocking command failures from harmless shell exits so
151
- high-token troubleshooting is easier to review.
166
+ Separate blocking command failures from harmless shell exits.
152
167
 
153
168
  ## Privacy
154
169
 
@@ -158,7 +173,7 @@ on your machine.
158
173
  - No login or account required.
159
174
  - No telemetry.
160
175
  - No prompt or transcript uploads.
161
- - It does not modify Codex, Claude Code, Cursor, or RTK files.
176
+ - It does not modify Codex, Claude Code, GitHub Copilot, Cursor, or RTK files.
162
177
  - It does not claim to match your subscription bill exactly.
163
178
  - It does not read Codex Desktop server-side sessions that are not stored locally.
164
179
 
@@ -166,18 +181,12 @@ on your machine.
166
181
 
167
182
  RepoSpend shows **API-equivalent cost**.
168
183
 
169
- That means it estimates cost from local token counts and the pricing assumptions
170
- stored in RepoSpend. It is useful for comparing repos and sessions, but it is not
171
- an invoice.
184
+ RepoSpend estimates cost from local token counts and local pricing assumptions.
185
+ It is useful for comparing repos and sessions, but it is not an invoice. Actual
186
+ cost can differ because of subscriptions, credits, included usage, account terms,
187
+ provider changes, or missing local token data.
172
188
 
173
- Your actual cost may be different because of subscriptions, credits, included
174
- usage, account-level terms, provider changes, or other billing details. If you use
175
- Codex or Claude Code through a subscription, read the number as "what this token
176
- usage would roughly cost at API-style rates."
177
-
178
- Codex support is the most complete today. Claude Code and Cursor support depend
179
- on what those tools store locally, so some sessions may show unknown tokens or
180
- cost.
189
+ For pricing details, see [docs/pricing.md](docs/pricing.md).
181
190
 
182
191
  ### Token Accounting
183
192
 
@@ -194,70 +203,84 @@ reads/writes as separate addable token columns.
194
203
  For the detailed accounting model and comparison with `ccusage` and Tokscale,
195
204
  see [docs/token-accounting.md](docs/token-accounting.md).
196
205
 
197
- ## What It Reads
206
+ ## Data Sources
198
207
 
199
- RepoSpend only reads local files. It does not edit Codex, Claude Code, Cursor, or
200
- RTK data.
208
+ RepoSpend only reads local files. It does not edit Codex, Claude Code, GitHub
209
+ Copilot, Cursor, or RTK data.
201
210
 
202
- Codex data:
211
+ | Source | What RepoSpend reads | Notes |
212
+ |---|---|---|
213
+ | Codex | Local CLI state and session files | Most complete token, model, repo, session, and command-friction support |
214
+ | Claude Code | Local project and session JSONL files | Tokens and models are shown when present in local transcripts |
215
+ | GitHub Copilot | Local OTEL exports, session-state, and VS Code Copilot Chat files | Full cost requires local input/cache/output token splits |
216
+ | Cursor | Experimental local transcript/database discovery | Off by default; local files vary and often omit exact token/cost data |
217
+ | RTK | Local workflow context | Not an AI token source; helps explain token-reduction practices |
203
218
 
204
- ```text
205
- ~/.codex/state_5.sqlite
206
- ~/.codex/sessions
207
- ```
219
+ Detailed paths, source-specific behavior, and Cursor troubleshooting live in
220
+ [docs/data-sources.md](docs/data-sources.md).
208
221
 
209
- Claude Code data:
222
+ RepoSpend-owned settings live under `~/.repospend/`, including pricing overrides,
223
+ local app settings, and the parse cache.
210
224
 
211
- ```text
212
- ~/.claude/projects
213
- ~/.config/claude/projects
214
- ~/Library/Application Support/Claude/local-agent-mode-sessions
215
- ~/.config/Claude/local-agent-mode-sessions
216
- ```
225
+ ## FAQ
217
226
 
218
- RepoSpend also checks `~/.claude/history.jsonl` for source status, but does not
219
- import history-only entries into usage analytics because they do not contain
220
- reliable token/model data.
227
+ ### What is RepoSpend?
221
228
 
222
- Claude Code transcript files can contain prompt text, tool output, and file
223
- contents. RepoSpend keeps all scanning local.
229
+ RepoSpend is a local-first dashboard for tracking AI coding token usage and
230
+ API-equivalent spend by repository, session, model, and tool.
224
231
 
225
- Cursor data (experimental):
232
+ ### Does RepoSpend upload prompts or code?
226
233
 
227
- ```text
228
- ~/.cursor/
229
- ~/.cursor/chats/
230
- ~/.cursor/projects/
231
- ~/.cursor/projects/*/agent-transcripts/
232
- ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
233
- ~/Library/Application Support/Cursor/User/workspaceStorage/
234
- ~/.config/Cursor/User/globalStorage/state.vscdb
235
- ~/.config/Cursor/User/workspaceStorage/
236
- %APPDATA%\Cursor\User\globalStorage\state.vscdb
237
- %APPDATA%\Cursor\User\workspaceStorage\
238
- ```
234
+ No. RepoSpend runs locally, reads supported client files in read-only mode, and
235
+ does not upload prompts, code, transcripts, or usage data.
239
236
 
240
- RepoSpend prioritizes Cursor JSONL transcripts, then searches local SQLite,
241
- `.db`, and `.vscdb` files for chat/composer/agent-like JSON blobs. Unknown or
242
- locked Cursor databases are skipped with warnings. Prompt and response text is
243
- never uploaded.
237
+ ### Which tools does RepoSpend support?
244
238
 
245
- RepoSpend-owned settings:
239
+ RepoSpend tracks local usage from Codex, Claude Code, and GitHub Copilot. Cursor
240
+ import is experimental and opt-in. RTK can appear as workflow context for
241
+ token-reduction signals, but it is not an AI model or coding assistant. Support
242
+ depth depends on what each tool stores locally; Codex is currently the most
243
+ complete path.
246
244
 
247
- ```text
248
- ~/.repospend/pricing.json
249
- ~/.repospend/config.json
250
- ~/.repospend/cache/
245
+ ### How do I run RepoSpend?
246
+
247
+ Run it with:
248
+
249
+ ```bash
250
+ npx repospend
251
251
  ```
252
252
 
253
- The Settings page includes a reset action for RepoSpend-owned files under
254
- `~/.repospend/`. It does not delete or edit anything under `~/.codex` or
255
- `~/.claude`.
253
+ RepoSpend starts a localhost dashboard, usually at
254
+ [http://localhost:2005](http://localhost:2005).
255
+
256
+ ### How is RepoSpend different from ccusage?
257
+
258
+ `ccusage` is excellent for Claude Code usage totals and terminal reporting.
259
+ RepoSpend is a visual, repo-first dashboard across multiple AI coding tools. It
260
+ focuses on repository grouping, session inspection, model mix, token shape,
261
+ cache reuse, exports, and command/agent friction signals.
262
+
263
+ ### Is RepoSpend open source?
264
+
265
+ Yes. RepoSpend is open source under the Apache-2.0 license. The GitHub repository
266
+ is [mehmetdemircs/RepoSpend](https://github.com/mehmetdemircs/RepoSpend).
267
+
268
+ ## Compared With Other Usage Tools
256
269
 
257
- RepoSpend caches parsed session summaries under `~/.repospend/cache/` so
258
- unchanged large transcripts reload faster. Rescan actions clear this parse cache
259
- before reading local logs again. The Advanced settings tab can clear only the
260
- parse cache without removing pricing or source settings.
270
+ RepoSpend is complementary to command-line usage tools such as `ccusage` and
271
+ generic Claude Code usage monitors.
272
+
273
+ Use `ccusage` when you want fast Claude Code totals, daily breakdowns, or a CLI
274
+ view that is close to Claude Code's local usage files. Use RepoSpend when you
275
+ want a local dashboard that compares AI coding usage across repos, sessions,
276
+ models, and tools.
277
+
278
+ Generic Claude Code monitors usually focus on one source. RepoSpend is designed
279
+ as a repo-level AI coding cost tracker: it brings together local Codex, Claude
280
+ Code, and GitHub Copilot data, includes experimental Cursor imports when enabled,
281
+ and can show optional RTK workflow context for token-reduction signals. The
282
+ dashboard then explains the token shape and sessions behind the estimated
283
+ API-equivalent spend.
261
284
 
262
285
  ## Commands
263
286
 
@@ -271,6 +294,7 @@ There are also a few terminal-friendly commands:
271
294
 
272
295
  ```bash
273
296
  repospend scan
297
+ repospend doctor
274
298
  repospend by-repo
275
299
  repospend by-day
276
300
  repospend by-hour
@@ -280,13 +304,12 @@ repospend export --format json
280
304
  repospend export --format csv
281
305
  ```
282
306
 
283
- Most commands also accept a simple source filter:
307
+ Most commands also accept dashboard-style filters:
284
308
 
285
309
  ```bash
286
- repospend by-repo --source codex
287
- repospend by-repo --source claude
288
- repospend by-repo --source cursor
289
- repospend by-repo --source all
310
+ repospend by-repo --source codex # codex, claude, copilot, cursor, all
311
+ repospend export --format csv --repo my-app --from 2026-05-01 --to 2026-05-29
312
+ repospend doctor --model gpt-5-codex --sourceApp "VS Code"
290
313
  ```
291
314
 
292
315
  Use `REPOSPEND_NO_OPEN=1 repospend` if you want the URL printed without opening a
@@ -305,31 +328,13 @@ browser.
305
328
  local schemas.
306
329
  - Cost estimates do not represent subscription billing, credits, regional
307
330
  pricing, or account-specific terms.
308
- - Budget alerts are not available yet.
309
331
  - Some older sessions may not include full token, command, or prompt details.
310
- - RTK analytics appear only when local `rtk` data is available.
332
+ - RTK is workflow context, not an AI token source; it helps explain token-reduction
333
+ practices alongside AI usage.
311
334
  - On Windows, RepoSpend captures Codex **CLI** usage from `~/.codex/`. The Codex
312
335
  **Desktop app** does not persist session transcripts or per-turn token usage to
313
336
  disk; real session data lives server-side.
314
337
 
315
- ## Troubleshooting Cursor Import
316
-
317
- Cursor local files vary by version and surface. To inspect what exists locally:
318
-
319
- ```bash
320
- find ~/.cursor -type f | grep -E "jsonl|sqlite|db|vscdb|chat|transcript"
321
- ls -la "$HOME/Library/Application Support/Cursor/User/globalStorage"
322
- ls -la "$HOME/Library/Application Support/Cursor/User/workspaceStorage"
323
- ```
324
-
325
- On Linux, replace the `Library/Application Support` paths with
326
- `$HOME/.config/Cursor/User/...`. On Windows, check
327
- `%APPDATA%\Cursor\User\globalStorage` and `%APPDATA%\Cursor\User\workspaceStorage`.
328
-
329
- If Cursor sessions import with unknown tokens or cost, that usually means the
330
- local files did not include exact usage data. RepoSpend keeps the session visible
331
- and avoids guessing.
332
-
333
338
  ## Develop
334
339
 
335
340
  From source: