tokengolf 0.4.3 → 0.5.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 +9 -0
- package/CLAUDE.md +6 -1
- package/README.md +228 -109
- package/dist/cli.js +86 -25
- package/docs/assets/banner.svg +45 -0
- package/docs/index.html +125 -92
- package/hooks/session-end.js +12 -27
- package/install.sh +69 -0
- package/package.json +1 -1
- package/scripts/update-homebrew.sh +39 -0
- package/src/components/ActiveRun.js +7 -3
- package/src/components/ScoreCard.js +7 -9
- package/src/components/StartRun.js +20 -4
- package/src/components/StatsView.js +31 -11
- package/src/lib/ui.js +16 -0
- package/assets/demo-hud.png +0 -0
- package/assets/scorecard.png +0 -0
- package/docs/assets/demo-hud.png +0 -0
- package/docs/assets/scorecard.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,15 @@ TokenGolf patch notes — what changed, what it measures, and why the mechanic e
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
### Changed
|
|
10
|
+
- **Design D block accent UI** — All bordered boxes replaced with left-only `██` block accent bars. Eliminates persistent right-border misalignment caused by emoji/unicode width differences across terminals. Color-coded: yellow for won, red for died, gray for neutral.
|
|
11
|
+
- ScoreCard, StatsView, ActiveRun, StartRun components all use custom Ink `borderStyle` with `left: '██'`, no right/top/bottom borders
|
|
12
|
+
- session-end.js ANSI scorecard uses `██` prefix per line with `─` horizontal separators
|
|
13
|
+
- Achievement badges in StatsView rendered inline (no individual bordered boxes)
|
|
14
|
+
- Death tip in ScoreCard rendered as indented text (no bordered box)
|
|
15
|
+
- Landing page terminal demos updated to match `██` style
|
|
16
|
+
- README screenshots replaced with inline code block demos — no more stale PNGs
|
|
17
|
+
|
|
9
18
|
### Fixed
|
|
10
19
|
- StatusLine HUD effort label now reads exclusively from live `settings.json` — `/model` changes (High, Low, Max) reflect immediately without requiring a new session
|
|
11
20
|
- Medium effort no longer shown in HUD or scorecard — it's the default, so it's omitted (same as not annotating Sonnet as "normal difficulty")
|
package/CLAUDE.md
CHANGED
|
@@ -388,9 +388,11 @@ Thinking tokens are estimated from character count ÷ 4 (approximate — display
|
|
|
388
388
|
|
|
389
389
|
7. **Death marks fire before the early return** — `calculateAchievements` has an `if (!won) return []` early exit, but death marks (blowout, so_close, tool_happy, silent_death, fumble, expensive_taste, hubris) fire before it. `indecisive` (model switches) and `expensive_taste` also fire on won runs — they're behavior patterns, not death verdicts.
|
|
390
390
|
|
|
391
|
+
8. **Design D: ██ block accent, no right borders** — All UI cards use a left-only `██` block accent bar instead of full box borders. This eliminates persistent right-border misalignment caused by emoji/unicode width calculation differences across terminals. Color-coded: yellow `██` for won, red `██` for died, gray `██` for neutral (stats, wizard). Ink components use a custom `borderStyle` object with `left: '██'` and `borderRight/Top/Bottom={false}`, `paddingLeft={3}`. session-end.js ANSI scorecard uses `██` prefix + `─` horizontal separators. No screenshots — README uses inline code block demos.
|
|
392
|
+
|
|
391
393
|
---
|
|
392
394
|
|
|
393
|
-
## Current Status: v0.
|
|
395
|
+
## Current Status: v0.4
|
|
394
396
|
|
|
395
397
|
### Done
|
|
396
398
|
- [x] Full project scaffold with esbuild pipeline
|
|
@@ -418,6 +420,9 @@ Thinking tokens are estimated from character count ÷ 4 (approximate — display
|
|
|
418
420
|
- [x] 28 new achievements: prompting skill, tool mastery, cost/prompt, time, subagents, turn discipline, death marks
|
|
419
421
|
- [x] 3 new hooks: PostToolUseFailure, SubagentStart, Stop
|
|
420
422
|
- [x] Vitest test suite — 120 tests covering all achievements + pure score functions
|
|
423
|
+
- [x] Design D block accent UI — ██ left bar, no right borders, color-coded state
|
|
424
|
+
- [x] Landing page terminal demos updated to ██ style
|
|
425
|
+
- [x] README inline code block demos (replaced PNG screenshots)
|
|
421
426
|
|
|
422
427
|
### Next up (v0.4)
|
|
423
428
|
- [ ] `tokengolf floor` command to advance floor manually
|
package/README.md
CHANGED
|
@@ -1,49 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
Turn Claude Code token efficiency into a game. Declare a quest, commit to a budget, pick a character class. Work normally. At the end, get a score based on how efficiently you used your budget.
|
|
6
|
-
|
|
7
|
-
**Better prompting → fewer tokens → higher score.**
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/assets/banner.svg" alt="TokenGolf" width="800" />
|
|
3
|
+
</p>
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Flow mode tracks you. Roguelike mode trains you.</strong>
|
|
7
|
+
</p>
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/tokengolf"><img src="https://img.shields.io/npm/v/tokengolf?style=flat&color=d4a840&label=npm" alt="npm version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/tokengolf"><img src="https://img.shields.io/npm/dm/tokengolf?style=flat&color=6bb54a&label=downloads" alt="npm downloads" /></a>
|
|
12
|
+
<a href="https://github.com/josheche/tokengolf/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/tokengolf?style=flat&color=7cb8d4" alt="license" /></a>
|
|
13
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/node/v/tokengolf?style=flat&color=9a9180" alt="node version" /></a>
|
|
14
|
+
</p>
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://josheche.github.io/tokengolf/">tokengolf.dev</a> · <a href="https://www.npmjs.com/package/tokengolf">npm</a> · <a href="https://github.com/josheche/tokengolf">GitHub</a>
|
|
18
|
+
</p>
|
|
14
19
|
|
|
15
20
|
---
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
Turn Claude Code token efficiency into a game. Declare a quest, commit to a budget, pick a character class. Work normally. At the end — a scorecard, achievements, and a score that measures how well you prompt.
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
**Better prompting → fewer tokens → higher score.** 60+ achievements. 9 hooks. 4 character classes. Zero config beyond `npm install`.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
```
|
|
27
|
+
██ 🏆 SESSION COMPLETE
|
|
28
|
+
██ add pagination to /users endpoint
|
|
29
|
+
██ ──────────────────────────────────────────────────
|
|
30
|
+
██ $0.2300 /$1.50 15% ⚔️ Sonnet 🥇 Gold
|
|
31
|
+
██ 🌟 LEGENDARY
|
|
32
|
+
██ ──────────────────────────────────────────────────
|
|
33
|
+
██ 🎯 Sniper 🥈 Silver 🔥 No Rest ✅ Clean Run 🧰 Toolbox 🤫 Silent Run
|
|
34
|
+
```
|
|
22
35
|
|
|
23
36
|
---
|
|
24
37
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
### ⛳ Flow Mode
|
|
28
|
-
Just work. TokenGolf auto-creates a tracking session when you open Claude Code. `/exit` the session and the scorecard appears automatically. No pre-configuration required.
|
|
38
|
+
## Quick Start
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
**npm** (recommended)
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g tokengolf
|
|
43
|
+
```
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
**Homebrew**
|
|
46
|
+
```bash
|
|
47
|
+
brew tap josheche/tokengolf
|
|
48
|
+
brew install tokengolf
|
|
49
|
+
```
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
**curl**
|
|
52
|
+
```bash
|
|
53
|
+
curl -fsSL https://raw.githubusercontent.com/josheche/tokengolf/main/install.sh | bash
|
|
54
|
+
```
|
|
36
55
|
|
|
56
|
+
Then set up the hooks (npm and brew only — curl does this automatically):
|
|
37
57
|
```bash
|
|
38
|
-
|
|
39
|
-
tokengolf install
|
|
58
|
+
tokengolf install # patches ~/.claude/settings.json
|
|
40
59
|
```
|
|
41
60
|
|
|
42
|
-
|
|
61
|
+
That's it. Open Claude Code, work normally, `/exit` — scorecard appears automatically (Flow mode). Or declare a run first:
|
|
43
62
|
|
|
44
|
-
|
|
63
|
+
```bash
|
|
64
|
+
tokengolf start # pick quest, class, effort, budget
|
|
65
|
+
# ... work in Claude Code ...
|
|
66
|
+
tokengolf win # complete run, auto-detect cost
|
|
67
|
+
```
|
|
45
68
|
|
|
46
|
-
|
|
69
|
+
<details>
|
|
70
|
+
<summary>All commands</summary>
|
|
47
71
|
|
|
48
72
|
```bash
|
|
49
73
|
tokengolf start # declare quest + class + effort + budget, begin a run
|
|
@@ -53,103 +77,92 @@ tokengolf bust # manual permadeath override
|
|
|
53
77
|
tokengolf scorecard # last run scorecard
|
|
54
78
|
tokengolf stats # career dashboard
|
|
55
79
|
tokengolf install # patch ~/.claude/settings.json with hooks
|
|
56
|
-
tokengolf demo # show all
|
|
80
|
+
tokengolf demo # show all UI states (for screenshots)
|
|
57
81
|
```
|
|
58
82
|
|
|
83
|
+
</details>
|
|
84
|
+
|
|
59
85
|
---
|
|
60
86
|
|
|
61
|
-
##
|
|
87
|
+
## Two Modes
|
|
62
88
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
| 🏹 Rogue | Haiku | — *(skips effort step)* | Glass cannon. Prompt precisely or die. |
|
|
66
|
-
| ⚔️ Fighter | Sonnet | Low / **Medium** / High | Balanced. The default run. |
|
|
67
|
-
| 🧙 Warlock | Opus | Low / **Medium** / High / Max | Powerful but costly. |
|
|
68
|
-
| ⚜️ Paladin | Opus (plan mode) | Low / **Medium** / High / Max | Strategic planner. Thinks before acting. |
|
|
69
|
-
| ⚡ Warlock·Fast | Opus + fast mode | any | 2× cost. Maximum danger mode. |
|
|
89
|
+
### ⛳ Flow Mode
|
|
90
|
+
Just work. TokenGolf auto-creates a tracking session when you open Claude Code. `/exit` and the scorecard appears. No pre-configuration.
|
|
70
91
|
|
|
71
|
-
|
|
92
|
+
### ☠️ Roguelike Mode
|
|
93
|
+
Pre-commit before you start. Declare a quest, pick a class and effort level, set a budget. Go over budget = permadeath — the run is logged as a death. The pressure trains better prompting habits, which makes your Flow sessions cheaper over time.
|
|
72
94
|
|
|
73
95
|
---
|
|
74
96
|
|
|
75
|
-
##
|
|
97
|
+
## Character Classes
|
|
76
98
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
| 🥉 Bronze | $2.50 | $10.00 | $50.00 | Heavy / complex |
|
|
85
|
-
| ✏️ Custom | any | any | any | Set your own bust threshold |
|
|
99
|
+
| Class | Model | Difficulty | Feel |
|
|
100
|
+
|-------|-------|------------|------|
|
|
101
|
+
| 🏹 **Rogue** | Haiku | Nightmare | Glass cannon. Prompt precisely or die. |
|
|
102
|
+
| ⚔️ **Fighter** | Sonnet | Standard | Balanced. The default run. |
|
|
103
|
+
| 🧙 **Warlock** | Opus | Casual | Powerful but expensive. |
|
|
104
|
+
| ⚜️ **Paladin** | Opus (plan mode) | Tactical | Strategic planner. Thinks before acting. |
|
|
105
|
+
| ⚡ **Warlock·Fast** | Opus + fast mode | Danger | 2× cost. Maximum risk, maximum speed. |
|
|
86
106
|
|
|
87
|
-
|
|
107
|
+
Effort levels: Low / **Medium** / High / Max (Opus-only). Fast mode toggled with `/fast` in Claude Code, auto-detected by TokenGolf.
|
|
88
108
|
|
|
89
109
|
---
|
|
90
110
|
|
|
91
111
|
## Scoring
|
|
92
112
|
|
|
93
|
-
**Efficiency
|
|
113
|
+
**Efficiency** (roguelike — % of budget used):
|
|
94
114
|
|
|
95
115
|
| 🌟 LEGENDARY | ⚡ EFFICIENT | ✓ SOLID | 😅 CLOSE CALL | 💀 BUSTED |
|
|
96
116
|
|---|---|---|---|---|
|
|
97
117
|
| < 25% | < 50% | < 75% | < 100% | > 100% |
|
|
98
118
|
|
|
99
|
-
**Spend tier** (absolute
|
|
119
|
+
**Spend tier** (absolute, shown on every scorecard):
|
|
100
120
|
|
|
101
|
-
| 💎 | 🥇 | 🥈 | 🥉 | 💸 |
|
|
121
|
+
| 💎 Diamond | 🥇 Gold | 🥈 Silver | 🥉 Bronze | 💸 Reckless |
|
|
102
122
|
|---|---|---|---|---|
|
|
103
123
|
| < $0.10 | < $0.30 | < $1.00 | < $3.00 | > $3.00 |
|
|
104
124
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
## Ultrathink
|
|
108
|
-
|
|
109
|
-
Write `ultrathink` anywhere in your prompt to trigger extended thinking mode. It's not a slash command — just say it in natural language:
|
|
110
|
-
|
|
111
|
-
> *"ultrathink: is this the right architecture before I write anything?"*
|
|
112
|
-
> *"can you ultrathink through the tradeoffs here?"*
|
|
113
|
-
|
|
114
|
-
Extended thinking tokens are billed at full output rate. A single ultrathink on Sonnet can cost $0.50–2.00 depending on problem depth. TokenGolf detects thinking blocks from your session transcripts and tracks invocations and estimated thinking tokens — both show on your scorecard.
|
|
115
|
-
|
|
116
|
-
**The skill is knowing when to ultrathink.** One expensive deep-think that prevents five wrong turns is efficient. Ultrathinking every prompt when you're at 80% budget is hubris.
|
|
125
|
+
Budget presets are model-calibrated — Haiku Diamond is $0.15, Opus Diamond is $2.50. Same relative difficulty, different absolute cost.
|
|
117
126
|
|
|
118
127
|
---
|
|
119
128
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
The dungeon crawl framing maps directly to real session behaviors:
|
|
123
|
-
|
|
124
|
-
- **Overencumbered** = context bloat slowing you down
|
|
125
|
-
- **Made Camp** = hit usage limits, came back next session
|
|
126
|
-
- **Ghost Run** = surgical context management before the boss
|
|
127
|
-
- **Hubris** = reached for ultrathink on a tight budget and paid for it
|
|
128
|
-
- **Silent Run** = solved it with pure prompting discipline, no extended thinking needed
|
|
129
|
-
- **Lone Wolf** = didn't spawn a single subagent; held the whole problem in one context
|
|
130
|
-
- **Agentic** = gave Claude the wheel and it ran with it — 3+ turns per prompt
|
|
129
|
+
## Achievements
|
|
131
130
|
|
|
132
|
-
|
|
131
|
+
60+ achievements tracking how you prompt, what tools you use, and how efficiently you spend. Here are some highlights:
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
| | Achievement | How |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| 🥊 | **One Shot** | Completed in a single prompt |
|
|
136
|
+
| 🎯 | **Sniper** | Under 25% of budget used |
|
|
137
|
+
| 💎 | **Diamond** | Haiku under $0.10 total |
|
|
138
|
+
| 🔪 | **Surgeon** | 1–3 Edit calls, under budget |
|
|
139
|
+
| 🤫 | **Silent Run** | No extended thinking, SOLID or better |
|
|
140
|
+
| 👑 | **Archmagus** | Opus at max effort, completed |
|
|
141
|
+
| 🥷 | **Ghost Run** | Manual compact at ≤30% context |
|
|
142
|
+
| 🐺 | **Lone Wolf** | No subagents spawned |
|
|
143
|
+
| 🤦 | **Hubris** | Used ultrathink, busted anyway *(death mark)* |
|
|
144
|
+
| 💥 | **Blowout** | Spent 2× your budget *(death mark)* |
|
|
135
145
|
|
|
136
|
-
|
|
146
|
+
<details>
|
|
147
|
+
<summary><strong>Full achievement list (60+)</strong></summary>
|
|
137
148
|
|
|
138
149
|
**Class**
|
|
139
150
|
- 💎 Diamond — Haiku under $0.10 total spend
|
|
140
151
|
- 🥇 Gold — Completed with Haiku
|
|
141
152
|
- 🥈 Silver — Completed with Sonnet
|
|
142
153
|
- 🥉 Bronze — Completed with Opus
|
|
154
|
+
- ⚜️ Paladin — Completed as Paladin (Opus plan mode)
|
|
155
|
+
- ♟️ Grand Strategist — LEGENDARY efficiency as Paladin
|
|
143
156
|
|
|
144
157
|
**Efficiency**
|
|
145
158
|
- 🎯 Sniper — Under 25% of budget used
|
|
146
159
|
- ⚡ Efficient — Under 50% of budget used
|
|
147
160
|
- 🪙 Penny Pincher — Total spend under $0.10
|
|
148
|
-
-
|
|
161
|
+
- 💲 Cheap Shots — Under $0.01 per prompt (≥3 prompts)
|
|
149
162
|
- 🍷 Expensive Taste — Over $0.50 per prompt (≥3 prompts)
|
|
150
163
|
|
|
151
164
|
**Prompting skill**
|
|
152
|
-
-
|
|
165
|
+
- 🥊 One Shot — Completed in a single prompt
|
|
153
166
|
- 💬 Conversationalist — 20+ prompts in one run
|
|
154
167
|
- 🤐 Terse — ≤3 prompts, ≥10 tool calls
|
|
155
168
|
- 🪑 Backseat Driver — 15+ prompts but <1 tool call per prompt
|
|
@@ -164,12 +177,12 @@ Roguelike mode surfaces these patterns explicitly. Flow mode lets them compound
|
|
|
164
177
|
- 🧰 Toolbox — 5+ distinct tools used
|
|
165
178
|
|
|
166
179
|
**Effort**
|
|
167
|
-
-
|
|
168
|
-
-
|
|
180
|
+
- 🏎️ Speedrunner — Low effort, completed under budget
|
|
181
|
+
- 🏋️ Tryhard — High/max effort, LEGENDARY efficiency
|
|
169
182
|
- 👑 Archmagus — Opus at max effort, completed
|
|
170
183
|
|
|
171
184
|
**Fast mode**
|
|
172
|
-
-
|
|
185
|
+
- ⛈️ Lightning Run — Opus fast mode, completed under budget
|
|
173
186
|
- 🎰 Daredevil — Opus fast mode, LEGENDARY efficiency
|
|
174
187
|
|
|
175
188
|
**Time**
|
|
@@ -179,19 +192,29 @@ Roguelike mode surfaces these patterns explicitly. Flow mode lets them compound
|
|
|
179
192
|
|
|
180
193
|
**Ultrathink**
|
|
181
194
|
- 🔮 Spell Cast — Used extended thinking during the run
|
|
182
|
-
-
|
|
195
|
+
- 🧮 Calculated Risk — Ultrathink + LEGENDARY efficiency
|
|
183
196
|
- 🌀 Deep Thinker — 3+ ultrathink invocations, completed under budget
|
|
184
|
-
- 🤫 Silent Run — No extended thinking, SOLID or better
|
|
185
|
-
- 🤦 Hubris — Used ultrathink, busted anyway *(death
|
|
197
|
+
- 🤫 Silent Run — No extended thinking, SOLID or better
|
|
198
|
+
- 🤦 Hubris — Used ultrathink, busted anyway *(death mark)*
|
|
186
199
|
|
|
187
200
|
**Multi-model**
|
|
188
201
|
- 🏹 Frugal — Haiku handled ≥50% of session cost
|
|
189
202
|
- 🎲 Rogue Run — Haiku handled ≥75% of session cost
|
|
203
|
+
- 🔷 Purist — Single model family throughout
|
|
204
|
+
- 🦎 Chameleon — Multiple model families used, under budget
|
|
205
|
+
- 🔀 Tactical Switch — Exactly 1 model switch, under budget
|
|
206
|
+
- 🔒 Committed — No switches, one model family
|
|
207
|
+
- ⚠️ Class Defection — Declared one class but cost skewed to another
|
|
208
|
+
|
|
209
|
+
**Paladin planning ratio**
|
|
210
|
+
- 🏛️ Architect — Opus handled >60% of cost (heavy planner)
|
|
211
|
+
- 💨 Blitz — Opus handled <25% of cost (light plan, fast execution)
|
|
212
|
+
- ⚖️ Equilibrium — Opus/Sonnet balanced at 40–60%
|
|
190
213
|
|
|
191
214
|
**Rest & recovery**
|
|
192
|
-
-
|
|
215
|
+
- 🔥 No Rest for the Wicked — Completed in one session
|
|
193
216
|
- 🏕️ Made Camp — Completed across multiple sessions
|
|
194
|
-
-
|
|
217
|
+
- 🧟 Came Back — Fainted (hit usage limits) and finished anyway
|
|
195
218
|
|
|
196
219
|
**Context management (gear)**
|
|
197
220
|
- 📦 Overencumbered — Context auto-compacted during run
|
|
@@ -199,16 +222,16 @@ Roguelike mode surfaces these patterns explicitly. Flow mode lets them compound
|
|
|
199
222
|
- 🪶 Ultralight — Manual compact at ≤40% context
|
|
200
223
|
- 🥷 Ghost Run — Manual compact at ≤30% context
|
|
201
224
|
|
|
202
|
-
**Tool reliability**
|
|
225
|
+
**Tool reliability**
|
|
203
226
|
- ✅ Clean Run — Zero failed tool calls (≥5 total)
|
|
204
227
|
- 🐂 Stubborn — 10+ failed tool calls, still won
|
|
205
228
|
|
|
206
|
-
**Subagents**
|
|
229
|
+
**Subagents**
|
|
207
230
|
- 🐺 Lone Wolf — Completed with no subagents spawned
|
|
208
231
|
- 📡 Summoner — 5+ subagents spawned
|
|
209
232
|
- 🪖 Army of One — 10+ subagents, under 50% budget used
|
|
210
233
|
|
|
211
|
-
**Turn discipline**
|
|
234
|
+
**Turn discipline**
|
|
212
235
|
- 🤖 Agentic — 3+ Claude turns per user prompt
|
|
213
236
|
- 🐕 Obedient — Exactly one turn per prompt (≥3 prompts)
|
|
214
237
|
|
|
@@ -218,60 +241,156 @@ Roguelike mode surfaces these patterns explicitly. Flow mode lets them compound
|
|
|
218
241
|
- 🔨 Tool Happy — Died with 30+ tool calls
|
|
219
242
|
- 🪦 Silent Death — Died with ≤2 prompts
|
|
220
243
|
- 🤡 Fumble — Died with 5+ failed tool calls
|
|
244
|
+
- 🎲 Indecisive — 3+ model switches
|
|
245
|
+
- 🍷 Expensive Taste — Over $0.50 per prompt
|
|
246
|
+
|
|
247
|
+
</details>
|
|
221
248
|
|
|
222
249
|
---
|
|
223
250
|
|
|
224
251
|
## Live HUD
|
|
225
252
|
|
|
226
|
-
After `tokengolf install`, a status line appears in every Claude Code session
|
|
253
|
+
After `tokengolf install`, a status line appears in every Claude Code session showing quest, cost, efficiency, context load, and model class.
|
|
227
254
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
- **💤** instead of ⛳ if the previous session fainted (hit usage limits)
|
|
233
|
-
- Roguelike runs show floor progress; Flow runs omit budget/efficiency
|
|
255
|
+
```
|
|
256
|
+
───────────────
|
|
257
|
+
⛳ add pagination to /users | 🥈 $0.54/$1.50 36% | EFFICIENT | ⚔️ Sonnet | Floor 2/5
|
|
258
|
+
───────────────
|
|
234
259
|
|
|
235
|
-
|
|
260
|
+
───────────────
|
|
261
|
+
⛳ refactor auth middleware | 🥈 $0.82/$4.00 21% | LEGENDARY | 🪶 52% | 🧙 Opus | Floor 3/5
|
|
262
|
+
───────────────
|
|
263
|
+
```
|
|
236
264
|
|
|
237
|
-
|
|
265
|
+
Context indicators: **🪶** green (50–74%) · **🎒** yellow (75–89%) · **📦** red (90%+). **💤** replaces ⛳ if the previous session fainted.
|
|
238
266
|
|
|
239
267
|
---
|
|
240
268
|
|
|
241
269
|
## Auto Scorecard
|
|
242
270
|
|
|
243
|
-
When you `/exit
|
|
271
|
+
When you `/exit`, the scorecard appears automatically — cost, model breakdown, achievements, tool usage.
|
|
244
272
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
273
|
+
```
|
|
274
|
+
██ 🏆 SESSION COMPLETE
|
|
275
|
+
██ add pagination to /users endpoint
|
|
276
|
+
██ ──────────────────────────────────────────────────
|
|
277
|
+
██ SPENT BUDGET USED MODEL TIER
|
|
278
|
+
██ $0.2300 $1.50 15% ⚔️ Sonnet 🥇 Gold
|
|
279
|
+
██
|
|
280
|
+
██ 🌟 LEGENDARY
|
|
281
|
+
██ ──────────────────────────────────────────────────
|
|
282
|
+
██ Achievements unlocked:
|
|
283
|
+
██ 🎯 Sniper — Under 25% budget
|
|
284
|
+
██ 🥈 Silver — Completed with Sonnet
|
|
285
|
+
██ 🔥 No Rest for the Wicked — One session
|
|
286
|
+
██ ✅ Clean Run — Zero failed tool calls
|
|
287
|
+
██ 🧰 Toolbox — 5+ distinct tool types
|
|
288
|
+
██ 🤫 Silent Run — No extended thinking
|
|
289
|
+
██ ──────────────────────────────────────────────────
|
|
290
|
+
██ Model usage: 🏹 17% Haiku
|
|
291
|
+
██ Sonnet 83% $0.19 Haiku 17% $0.04
|
|
292
|
+
██ ──────────────────────────────────────────────────
|
|
293
|
+
██ Tool calls:
|
|
294
|
+
██ Read ×8 Edit ×4 Bash ×3 Grep ×2 Glob ×1
|
|
295
|
+
```
|
|
248
296
|
|
|
249
|
-
|
|
297
|
+
```
|
|
298
|
+
██ 💀 BUDGET BUSTED
|
|
299
|
+
██ migrate postgres schema to v3
|
|
300
|
+
██ ──────────────────────────────────────────────────
|
|
301
|
+
██ $3.8700 /$1.50 258% ⚔️ Sonnet 💸 Reckless
|
|
302
|
+
██ ──────────────────────────────────────────────────
|
|
303
|
+
██ 🤦 Hubris 💥 Blowout 🤡 Fumble 🔨 Tool Happy
|
|
304
|
+
██ ──────────────────────────────────────────────────
|
|
305
|
+
██ Cause of death: Budget exceeded by $2.37
|
|
306
|
+
██ Tip: Use Read with line ranges instead of full file reads.
|
|
307
|
+
```
|
|
250
308
|
|
|
251
309
|
---
|
|
252
310
|
|
|
253
|
-
|
|
311
|
+
<details>
|
|
312
|
+
<summary><strong>Ultrathink</strong></summary>
|
|
313
|
+
|
|
314
|
+
Write `ultrathink` anywhere in your prompt to trigger extended thinking mode. It's not a slash command — just say it in natural language:
|
|
315
|
+
|
|
316
|
+
> *"ultrathink: is this the right architecture before I write anything?"*
|
|
317
|
+
> *"can you ultrathink through the tradeoffs here?"*
|
|
318
|
+
|
|
319
|
+
Extended thinking tokens are billed at full output rate. A single ultrathink on Sonnet can cost $0.50–2.00 depending on problem depth. TokenGolf detects thinking blocks from your session transcripts and tracks invocations and estimated thinking tokens — both show on your scorecard.
|
|
320
|
+
|
|
321
|
+
**The skill is knowing when to ultrathink.** One expensive deep-think that prevents five wrong turns is efficient. Ultrathinking every prompt when you're at 80% budget is hubris.
|
|
322
|
+
|
|
323
|
+
</details>
|
|
324
|
+
|
|
325
|
+
<details>
|
|
326
|
+
<summary><strong>The Meta Loop</strong></summary>
|
|
327
|
+
|
|
328
|
+
The dungeon crawl framing maps directly to real session behaviors:
|
|
329
|
+
|
|
330
|
+
- **Overencumbered** = context bloat slowing you down
|
|
331
|
+
- **Made Camp** = hit usage limits, came back next session
|
|
332
|
+
- **Ghost Run** = surgical context management before the boss
|
|
333
|
+
- **Hubris** = reached for ultrathink on a tight budget and paid for it
|
|
334
|
+
- **Silent Run** = solved it with pure prompting discipline, no extended thinking needed
|
|
335
|
+
- **Lone Wolf** = didn't spawn a single subagent; held the whole problem in one context
|
|
336
|
+
- **Agentic** = gave Claude the wheel and it ran with it — 3+ turns per prompt
|
|
337
|
+
|
|
338
|
+
Roguelike mode surfaces these patterns explicitly. Flow mode lets them compound over time. The meta loop: **roguelike practice makes Flow sessions better. Better Flow = lower daily spend = better scores without even trying.**
|
|
339
|
+
|
|
340
|
+
</details>
|
|
341
|
+
|
|
342
|
+
<details>
|
|
343
|
+
<summary><strong>Budget presets (model-calibrated)</strong></summary>
|
|
344
|
+
|
|
345
|
+
The wizard shows different amounts depending on your class — same relative difficulty, different absolute cost. Anchored to the ~$0.75/task Sonnet average from Anthropic's $6/day Claude Code benchmark.
|
|
346
|
+
|
|
347
|
+
| Tier | Haiku 🏹 | Sonnet ⚔️ | Opus 🧙 | Feel |
|
|
348
|
+
|------|---------|---------|--------|------|
|
|
349
|
+
| 💎 Diamond | $0.15 | $0.50 | $2.50 | Surgical micro-task |
|
|
350
|
+
| 🥇 Gold | $0.40 | $1.50 | $7.50 | Focused small task |
|
|
351
|
+
| 🥈 Silver | $1.00 | $4.00 | $20.00 | Medium task |
|
|
352
|
+
| 🥉 Bronze | $2.50 | $10.00 | $50.00 | Heavy / complex |
|
|
353
|
+
| ✏️ Custom | any | any | any | Set your own bust threshold |
|
|
354
|
+
|
|
355
|
+
These are **bust thresholds** — your commitment. Efficiency tiers derive as percentages of whatever you commit to.
|
|
356
|
+
|
|
357
|
+
</details>
|
|
358
|
+
|
|
359
|
+
<details>
|
|
360
|
+
<summary><strong>Why "TokenGolf"?</strong></summary>
|
|
254
361
|
|
|
255
|
-
|
|
362
|
+
[Code golf](https://en.wikipedia.org/wiki/Code_golf) is the engineering practice of solving a problem in as few characters (or lines, or bytes) as possible. The constraint isn't the point — the *discipline the constraint creates* is the point. Writing the shortest possible solution forces you to understand the problem deeply and use your tools precisely.
|
|
363
|
+
|
|
364
|
+
Token golf is the same idea applied to AI sessions. Your budget is par. Every unnecessary prompt, every redundant context dump, every "can you also..." tacked onto a request is a stroke over par. The game doesn't literally resemble golf — it borrows the concept: **optimize under constraint, measure your score, improve your game.**
|
|
365
|
+
|
|
366
|
+
</details>
|
|
367
|
+
|
|
368
|
+
<details>
|
|
369
|
+
<summary><strong>Hooks (9 total)</strong></summary>
|
|
370
|
+
|
|
371
|
+
All installed via `tokengolf install`:
|
|
256
372
|
|
|
257
373
|
| Hook | When | What it does |
|
|
258
374
|
|------|------|-------------|
|
|
259
|
-
| `SessionStart` | Session opens | Injects quest/budget/floor into Claude's context. Auto-creates Flow run if none active.
|
|
375
|
+
| `SessionStart` | Session opens | Injects quest/budget/floor into Claude's context. Auto-creates Flow run if none active. |
|
|
260
376
|
| `PostToolUse` | After every tool | Tracks tool usage by type. Fires budget warning at 80%. |
|
|
261
377
|
| `PostToolUseFailure` | After a tool error | Increments `failedToolCalls` — powers Clean Run, Stubborn, Fumble. |
|
|
262
378
|
| `UserPromptSubmit` | Each prompt | Counts prompts. Injects halfway nudge at 50% budget. |
|
|
263
379
|
| `PreCompact` | Before compaction | Records manual vs auto compact + context % — powers gear achievements. |
|
|
264
|
-
| `SessionEnd` | Session closes | Scans transcripts for cost + ultrathink
|
|
380
|
+
| `SessionEnd` | Session closes | Scans transcripts for cost + ultrathink, saves run, displays scorecard. |
|
|
265
381
|
| `SubagentStart` | Subagent spawned | Increments `subagentSpawns` — powers Lone Wolf, Summoner, Army of One. |
|
|
266
382
|
| `Stop` | Claude finishes a turn | Increments `turnCount` — powers Agentic, Obedient. |
|
|
267
383
|
| `StatusLine` | Continuously | Live HUD with cost, tier, efficiency, context %, model class. |
|
|
268
384
|
|
|
269
|
-
|
|
385
|
+
</details>
|
|
270
386
|
|
|
271
|
-
|
|
387
|
+
<details>
|
|
388
|
+
<summary><strong>State</strong></summary>
|
|
272
389
|
|
|
273
390
|
All data lives in `~/.tokengolf/`:
|
|
274
391
|
- `current-run.json` — active run
|
|
275
392
|
- `runs.json` — completed run history
|
|
276
393
|
|
|
277
394
|
No database, no native deps, no compilation.
|
|
395
|
+
|
|
396
|
+
</details>
|