Every token matters
claude plugin marketplace add josheche/tokengolf && claude plugin install tokengolf@tokengolf
Code golf is the engineering practice of solving a problem in as few characters as possible. The constraint isn't the point. The discipline the constraint creates is the point. Writing the shortest solution forces you to understand the problem deeply and use your tools precisely.
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.
No setup, no pre-configuration. TOKENGOLF measures your efficiency against a par budget that scales with your session:
par = max(rate × √prompts, model_floor)
efficiency = actual_cost / par
Par grows with your session, but sublinearly. Early prompts give you room to explore. Pressure builds as the session goes on. Spend more than par and the run busts, logged as a death with red accents and death achievements.
/exit| Class | Model | Difficulty | Feel |
|---|---|---|---|
| 🏹 Rogue | Haiku | Nightmare | Glass cannon. Must prompt precisely. |
| ⚔️ Fighter | Sonnet | Standard | Balanced. The default run. |
| ⚜️ Paladin | Opus (plan mode) | Tactical | Strategic planner. Opus plans, Sonnet executes. |
| 🧙 Warlock | Opus | Casual | Powerful but expensive. |
Every screen TOKENGOLF renders in your terminal. Pick a tab to explore, or run tokengolf demo to see them all live.
Live HUD appears in every Claude Code session. 3-line display: efficiency rating with project/git info, emotion with cost vs par, model class with context load. Accent color matches your efficiency tier.
██ 🌟 LEGENDARY 📂 myapp ⎇ main ✓ ██ 😎 VIBING 💎 $0.18/2.12 ▓░░░░░░░░░░ 8% ██ ⚔️ Sonnet 🪶 ▓░░░░░░░░░ 8%
██ 💪 PRO 📂 api-server ⎇ feat/auth ● ██ 😤 GRINDING 🥈 $1.50/4.24 ▓▓▓▓░░░░░░░ 35% ██ ⚔️ Sonnet 📚 ▓▓▓░░░░░░░ 34%
██ 🌟 LEGENDARY 📂 tokengolf ⎇ main ✓ ██ 😎 VIBING 💎 $0.41/3.35 ▓░░░░░░░░░░ 12% ██ ⚔️ Sonnet·High 📚 ▓▓▓░░░░░░░ 29%
██ 🔥 EPIC 📂 ml-pipeline ⎇ refactor/v2 ✓ ██ 🛹 CRUISING 💎 $3.80/16.00 ▓▓▓░░░░░░░░ 24% ██ 🧙 Opus 🎒 ▓▓▓▓▓░░░░░ 52%
██ ⚠️ CLOSE CALL 📂 docs-site ⎇ fix/typos ● ██ 😰 SWEATING 🥇 $0.45/0.52 ▓▓▓▓▓▓▓▓▓░░ 87% ██ 🏹 Haiku 🪨 ▓▓▓▓▓▓▓▓░░ 78%
██ 💥 BUST 📂 monorepo ⎇ main ● ██ 🧟 ZOMBIE 🥈 $6.20/4.74 ▓▓▓▓▓▓▓▓▓▓▓ 131% ██ ⚔️ Sonnet 🎒 ▓▓▓▓▓░░░░░ 45%
██ 💪 PRO 📂 kernel ⎇ dev ✓ ██ 🤯 OVERWHELMED 💎 $5.50/13.86 ▓▓▓▓░░░░░░░ 40% ██ 🧙 Opus 🗿 ▓▓▓▓▓▓▓▓▓░ 91%
██ 🔥 EPIC 📂 webapp ⎇ feat/deploy ✓ ██ 💤 SLEEPING 💎 $0.92/3.67 ▓▓▓░░░░░░░░ 25% ██ ⚔️ Sonnet 🧱 ▓▓▓▓▓▓▓░░░ 67%
██ 🏆 SESSION COMPLETE ██ 6 prompts · par $3.67 ██ ──────────────────────────────────────────────── ██ $0.23 /$3.67 6% 🌟 LEGENDARY ⚔️ Sonnet·High 💎 Diamond ██ ──────────────────────────────────────────────── ██ 🎯 sniper 🥈 silver 🔥 no_rest ✅ clean_run 🧰 toolbox 🤫 silent_run ██ ──────────────────────────────────────────────── ██ tokengolf scorecard · tokengolf stats
/exit. Compact single-block format with cost, efficiency, achievements by key.
██ 💀 PAR BUST ██ 10 prompts · par $4.74 ██ ──────────────────────────────────────────────── ██ $10.00 /$4.74 211% 💥 BUST ⚔️ Sonnet·High 💸 Reckless ██ ──────────────────────────────────────────────── ██ 🔮 2 ultrathink invocations ██ ──────────────────────────────────────────────── ██ 🤦 hubris 💥 blowout 🤡 fumble 🔨 tool_happy 🍷 expensive_taste ██ ──────────────────────────────────────────────── ██ tokengolf scorecard · tokengolf stats
██ ██ 🏆 SESSION COMPLETE ██ ██ 6 prompts · par $3.67 ██ ██ ██ SPENT PAR USED MODEL EFFORT TIER ██ $0.23 $3.67 6% ⚔️ Sonnet·High 🔥 High 💎 Diamond ██ ██ 🌟 LEGENDARY ██ ██ ██ Achievements unlocked: ██ 🎯 Sniper — Under 25% of par ██ 🥈 Silver — Completed with Sonnet ██ 🔥 No Rest for the Wicked — One session ██ ✅ Clean Run — Zero failed tool calls ██ 🧰 Toolbox — 5+ distinct tool types ██ 🤫 Silent Run — No extended thinking ██ ██ ██ Model usage: 🏹 17% Haiku ██ Sonnet 83% $0.19 Haiku 17% $0.04 ██ ██ ██ Tool calls: ██ Read ×8 Edit ×4 Bash ×3 Grep ×2 Glob ×1 ██
tokengolf scorecard. Full achievement labels, model breakdown, and tool usage.
██ ██ 💀 PAR BUST ██ ██ 10 prompts · par $4.74 ██ ██ ██ SPENT PAR USED MODEL EFFORT TIER ██ $10.00 $4.74 211% ⚔️ Sonnet·High 🔥 High 💸 Reckless ██ ██ 💥 BUST ██ ██ ██ Achievements unlocked: ██ 🤦 Hubris — Ultrathink, busted anyway ██ 💥 Blowout — Spent 2× par ██ 🤡 Fumble — 5+ failed tool calls ██ 🔨 Tool Happy — 30+ tool calls, died ██ 🍷 Expensive Taste — $0.50+/prompt ██ ██ ██ Extended thinking: 🔮 2× invoked ██ ██ ██ Model usage: 🏹 9% Haiku ██ Sonnet 91% $43.68 Haiku 9% $4.32 ██ ██ ██ Tool calls: ██ Read ×18 Edit ×12 Bash ×10 Grep ×5 Write ×3 ██
tokengolf scorecard. Full labels, ultrathink section, model and tool breakdowns.
⛳ TOKENGOLF Career Stats ██ ██ RUNS WINS DEATHS WIN RATE AVG SPEND ██ 24 18 6 75% $1.42 ██ 🏆 Personal Best ██ ██ 1 prompts ██ ██ $0.00890 🏹 ✨ Mythic ██ Recent runs: ✓ 6p $0.23 /$3.67 ⚔️ 💎 6% ✓ 8p $3.41 /$22.63 🧙 🥇 15% ✗ 10p $10.00 /$4.74 ⚔️ 💸 211% ✓ 4p $0.08 /$0.30 🏹 💎 27% ✓ 2p $0.00340 /$2.12 ⚔️ ✨ 0% ✓ 10p $2.18 /$14.23 ⚜️ 🥇 15% ✗ 3p $15.00 /$13.86 🧙 💸 108% ✓ 3p $0.41 /$2.60 ⚔️ 💎 16% Recent achievements: 🎯 Sniper 🥈 Silver 🔥 No Rest ✅ Clean Run 🧰 Toolbox 💎 Diamond 🥊 One Shot 🪙 Penny Pincher ⏱️ Speedrun 🐺 Lone Wolf 🔪 Surgeon ⚡ Efficient
Auto-detected from your Claude Code settings. Higher effort = more thinking = more spend. Tracked in achievements.
Opus fast mode is auto-detected from your Claude Code settings. Unlocks unique achievements:
Absolute dollar thresholds, calibrated per model. Hitting Gold on Opus is the same relative achievement as Gold on Haiku. Your tier shows up on every scorecard alongside your efficiency rating.
How well you used your par budget. Same scale whether par is $0.50 or $50. Colors follow the classic loot-tier hierarchy.
How much you actually spent in dollars. An absolute measure, calibrated per model so Gold on Opus is the same relative achievement as Gold on Haiku.
What percentage of your par budget you used. A relative measure. Par grows sublinearly (sqrt) with each prompt, so pressure builds over time.
These are two independent axes. A 100-prompt Opus session has a par of $80. Spending $55 on that session is 💸 Reckless (absolute spend above Bronze) but ✅ SOLID (69% of par used). High spend doesn't mean low efficiency. The scorecard shows both so you can see where you stand from each angle.
Real behaviors that show up in your scores. Not flavor. These are the habits that separate LEGENDARY from BUST. TOKENGOLF names them so you can recognize and improve.
Context auto-compacted mid-session. You were carrying too much history and the model paid for it in confused reasoning and wasted tokens.
Proactive context management. You compacted early, stayed light, and kept your par budget clean through the whole session.
Extended thinking on a tight par budget. The thinking tokens pushed you over par. Power has a cost.
Minimal edits, maximum impact. You told the model exactly what to change and it did. No exploratory rewrites, no wasted tool calls.
High turns-per-prompt. You gave a clear goal and let the model run autonomously. Fewer prompts means a tighter par budget. Efficiency through trust.
No subagents. One context, one thread, under par. You held the whole problem in your head and executed.
These patterns compound over time. Better prompting habits → lower par usage → better scores without even trying.
60+ achievements across 5 categories. Every session tells a story.
Haiku run under $0.10
Completed with Haiku
Completed with Sonnet
Completed with Opus
Completed as Paladin (Opus plan mode)
EPIC efficiency as Paladin
Under 25% of par used
Under 50% of par used
Total spend under $0.10
Under $0.01 per prompt (≥3 prompts)
Over $0.50 per prompt (won or died)
Low effort, completed under par
High/Max effort, EPIC efficiency
Opus at max effort, completed
Opus fast mode, completed under par
Opus fast mode, EPIC efficiency
Completed in a single prompt
20+ prompts in one run
≤3 prompts, ≥10 tool calls
15+ prompts, less than 1 tool call per prompt
5+ tool calls per prompt (≥2 prompts)
Won with no Edit or Write calls
10+ Edit calls in one run
10+ Bash calls comprising ≥50% of tools
≥60% of tool calls were Reads (≥5 total)
1–3 Edit calls, completed under par
5+ distinct tools used in one run
Zero failed tool calls (≥5 tool calls total)
10+ failed tool calls and still won
3+ Claude turns per user prompt
Exactly one turn per prompt (≥3 prompts)
Completed in under 5 minutes
Session 60–180 minutes
Session over 3 hours
Completed in one session
Completed across multiple sessions
Fainted (hit usage limits) and finished anyway
Context auto-compacted during a won run
Manual compact at 41–50% context
Manual compact at 31–40% context
Manual compact at ≤30% context
Used extended thinking in a won run
Extended thinking + EPIC efficiency
3+ thinking invocations, completed under par
No extended thinking, SOLID or better
Haiku handled ≥50% of session cost
Haiku handled ≥75% of session cost
Opus handled >60% of cost (heavy planner)
Opus handled <25% of cost (light plan, fast execution)
Opus/Sonnet balanced at 40–60%
Single model family throughout
Multiple model families used, under par
Exactly 1 model switch, under par
No switches, one model family
Declared one class but cost skewed to another
Completed with no subagents spawned
5+ subagents spawned in one run
10+ subagents spawned, under 50% par used
Used extended thinking, busted anyway
Spent 2× your par
Died within 10% of par
Died with 30+ tool calls
Died with ≤2 prompts
Died with 5+ failed tool calls
3+ model switches (won or died)
# Install (pick one) $ claude plugin marketplace add josheche/tokengolf $ claude plugin install tokengolf@tokengolf # recommended — auto-updates $ npm install -g tokengolf $ brew tap josheche/tokengolf && brew install tokengolf $ curl -fsSL https://raw.githubusercontent.com/josheche/tokengolf/main/install.sh | bash $ tokengolf install # npm/brew/curl only — patches hooks # Just /exit Claude Code — scorecard auto-appears $ tokengolf scorecard # show last run's results $ tokengolf stats # career dashboard $ tokengolf config # view or set config values $ tokengolf demo # show all UI states (hud, scorecard, stats)