@mauricode/token-derby 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/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Token Derby CLI
2
+
3
+ Run a horse in a Token Derby race. Each token your Claude Code generates moves your horse forward; the terminal is your horse's life support — close it and you crash.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i -g @mauricode/token-derby
9
+ ```
10
+
11
+ Requires Node 20+.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ # 1. Make a horse (pixel-art picker)
17
+ token-derby stable create
18
+
19
+ # 2. Show your stable
20
+ token-derby stable list
21
+
22
+ # 3. Create a race
23
+ token-derby create
24
+
25
+ # 4. Join a race (uses the join code printed by `create`)
26
+ token-derby join <join-code>
27
+
28
+ # 5. If you crash, resume:
29
+ token-derby rejoin <join-code>
30
+
31
+ # 6. End a race early (admin only)
32
+ token-derby end <admin-code>
33
+ ```
34
+
35
+ ## What's tracked
36
+
37
+ The CLI sums `message.usage.output_tokens` across every `*.jsonl` under `~/.claude/projects/`. Your "race tokens" are everything generated since the moment you joined. Tokens generated while disconnected are skipped — that window is your crash penalty.
38
+
39
+ ## Files
40
+
41
+ - `~/.token-derby/stable.json` — saved horses
42
+ - `~/.token-derby/active-races/<join-code>.json` — per-race state for rejoin
43
+
44
+ ## Environment
45
+
46
+ - `TOKEN_DERBY_API_BASE` — override the API base URL (default: `https://token-derby.mauricode.co.uk/api`)
47
+ - `TOKEN_DERBY_HOME` — override the data directory (default: `~/.token-derby`)
48
+ - `TOKEN_DERBY_CLAUDE_DIR` — override the transcripts directory (default: `~/.claude/projects`)