tokentrack 1.0.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/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/chunk-KQYHDGZP.js +1002 -0
- package/dist/cli.js +203 -0
- package/dist/server.js +6 -0
- package/dist/web/assets/index-BE3iEp6y.js +120 -0
- package/dist/web/assets/index-D46ZVHU7.css +1 -0
- package/dist/web/index.html +17 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Elisha Bajemon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# TokenTrack
|
|
2
|
+
|
|
3
|
+
Track your AI coding agent token consumption across Claude Code and OpenAI Codex.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx tokentrack
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
Claude Code and Codex store detailed usage logs on your machine — every prompt, every completion, every cached context. But there's no easy way to see the full picture: how many tokens you've burned, which projects consume the most, which models you're actually using, and how your usage evolves over time.
|
|
12
|
+
|
|
13
|
+
TokenTrack reads those local files and gives you a visual dashboard. Whether you're on a Pro plan watching your limits, a Max subscriber optimizing your workflow, or an API user tracking real costs — you get full visibility into your consumption.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Instant — no install needed
|
|
19
|
+
npx tokentrack
|
|
20
|
+
|
|
21
|
+
# CLI summary only (no browser)
|
|
22
|
+
npx tokentrack --summary
|
|
23
|
+
|
|
24
|
+
# Export your data
|
|
25
|
+
npx tokentrack --export csv --output usage.csv
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Requires Node.js 18+. Works on macOS and Linux.
|
|
29
|
+
|
|
30
|
+
## What You See
|
|
31
|
+
|
|
32
|
+
**KPI overview** — total tokens consumed, broken down by input / output / cache, with estimated API-equivalent cost
|
|
33
|
+
|
|
34
|
+
**Usage over time** — daily, weekly, or monthly token consumption with stacked breakdown (cache read, cache write, output, input)
|
|
35
|
+
|
|
36
|
+
**Provider comparison** — Claude Code vs Codex side by side: tokens consumed and estimated cost
|
|
37
|
+
|
|
38
|
+
**Model distribution** — which models you're actually using (opus-4-6, sonnet-4-6, gpt-5.4, gpt-5.3-codex, haiku-4-5...)
|
|
39
|
+
|
|
40
|
+
**Cost by project** — ranked by estimated API-equivalent cost so you can see where your tokens go
|
|
41
|
+
|
|
42
|
+
**Activity heatmap** — GitHub-style grid showing your daily coding agent activity
|
|
43
|
+
|
|
44
|
+
**Project table** — every project with sessions count, token breakdown, provider badges, and last activity date
|
|
45
|
+
|
|
46
|
+
**Session explorer** — drill into individual sessions, see every message with its token count and cost
|
|
47
|
+
|
|
48
|
+
**Filters** — slice everything by provider, project, model, and date range (7d / 30d / 90d / all time)
|
|
49
|
+
|
|
50
|
+
## About "Estimated Cost"
|
|
51
|
+
|
|
52
|
+
TokenTrack shows an **estimated API-equivalent cost** — what your usage would cost at standard API pay-per-token rates. This is a reference metric, not your actual bill.
|
|
53
|
+
|
|
54
|
+
- If you're on **Claude Pro/Max** or **ChatGPT Plus/Pro** → you pay a flat subscription. The cost shown is what your consumption would cost at API rates. Useful for understanding the value you're getting from your plan and how close you might be to usage limits.
|
|
55
|
+
- If you're using **API keys** (per-token billing) → the cost shown approximates your actual spend.
|
|
56
|
+
|
|
57
|
+
Pricing is fetched from [LiteLLM](https://github.com/BerriAI/litellm) (2600+ models, updated daily) and verified against [ccusage](https://github.com/ryoppippi/ccusage).
|
|
58
|
+
|
|
59
|
+
## Data Sources
|
|
60
|
+
|
|
61
|
+
| Tool | Local data path | Tokens tracked |
|
|
62
|
+
|------|----------------|----------------|
|
|
63
|
+
| Claude Code | `~/.claude/projects/` or `~/.config/claude/projects/` | input, output, cache write, cache read |
|
|
64
|
+
| OpenAI Codex | `~/.codex/sessions/` | prompt, completion, cached input, reasoning |
|
|
65
|
+
|
|
66
|
+
TokenTrack reads these files directly. No API keys needed. No accounts. **Nothing leaves your machine.**
|
|
67
|
+
|
|
68
|
+
## CLI Options
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
tokentrack # Launch dashboard (opens browser)
|
|
72
|
+
tokentrack --summary # Terminal summary only
|
|
73
|
+
tokentrack --port 4000 # Custom port
|
|
74
|
+
tokentrack --export csv # Export as CSV
|
|
75
|
+
tokentrack --export json # Export as JSON
|
|
76
|
+
tokentrack --output file.csv # Specify output file
|
|
77
|
+
tokentrack --pricing # Show current pricing table
|
|
78
|
+
tokentrack --provider codex # Filter to one provider
|
|
79
|
+
tokentrack --project adswize # Filter to one project
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Stack
|
|
83
|
+
|
|
84
|
+
TypeScript · React · Recharts · Hono · Tailwind · Zustand · Vite · tsup
|
|
85
|
+
|
|
86
|
+
## Acknowledgments
|
|
87
|
+
|
|
88
|
+
Built on ideas from [ccusage](https://github.com/ryoppippi/ccusage) by @ryoppippi — the reference CLI for Claude Code token tracking. TokenTrack adds a visual dashboard and multi-provider support.
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
PRs welcome. Open an issue first for major changes.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/elishab60/tokentrack.git
|
|
96
|
+
cd tokentrack
|
|
97
|
+
npm install
|
|
98
|
+
npm run dev
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT — [Elisha Bajemon](https://github.com/elishab60)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
*TokenTrack reads local data only. Nothing is sent anywhere. Your usage stays yours.*
|