TOKENGOLF

Every token matters

claude plugin marketplace add josheche/tokengolf && claude plugin install tokengolf@tokengolf

Why "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.

🎮How It Works

Every session is automatically tracked

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.

⚔️Character Classes

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.

📸In Action

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 · early session
██ 🌟 LEGENDARY  📂 myapp   main 
██ 😎 VIBING  💎 $0.18/2.12 ▓░░░░░░░░░░ 8%
██ ⚔️ Sonnet  🪶 ▓░░░░░░░░░ 8%
Pro · mid session
██ 💪 PRO  📂 api-server   feat/auth 
██ 😤 GRINDING  🥈 $1.50/4.24 ▓▓▓▓░░░░░░░ 35%
██ ⚔️ Sonnet  📚 ▓▓▓░░░░░░░ 34%
Legendary · high effort
██ 🌟 LEGENDARY  📂 tokengolf   main 
██ 😎 VIBING  💎 $0.41/3.35 ▓░░░░░░░░░░ 12%
██ ⚔️ Sonnet·High  📚 ▓▓▓░░░░░░░ 29%
Epic · Opus run
██ 🔥 EPIC  📂 ml-pipeline   refactor/v2 
██ 🛹 CRUISING  💎 $3.80/16.00 ▓▓▓░░░░░░░░ 24%
██ 🧙 Opus  🎒 ▓▓▓▓▓░░░░░ 52%
Close Call · Haiku near bust
██ ⚠️ CLOSE CALL  📂 docs-site   fix/typos 
██ 😰 SWEATING  🥇 $0.45/0.52 ▓▓▓▓▓▓▓▓▓░░ 87%
██ 🏹 Haiku  🪨 ▓▓▓▓▓▓▓▓░░ 78%
Bust · past par, dead
██ 💥 BUST  📂 monorepo   main 
██ 🧟 ZOMBIE  🥈 $6.20/4.74 ▓▓▓▓▓▓▓▓▓▓▓ 131%
██ ⚔️ Sonnet  🎒 ▓▓▓▓▓░░░░░ 45%
Overwhelmed · high context
██ 💪 PRO  📂 kernel   dev 
██ 🤯 OVERWHELMED  💎 $5.50/13.86 ▓▓▓▓░░░░░░░ 40%
██ 🧙 Opus  🗿 ▓▓▓▓▓▓▓▓▓░ 91%
Sleeping · fainted session
██ 🔥 EPIC  📂 webapp   feat/deploy 
██ 💤 SLEEPING  💎 $0.92/3.67 ▓▓▓░░░░░░░░ 25%
██ ⚔️ Sonnet  🧱 ▓▓▓▓▓▓▓░░░ 67%
auto scorecard · won (on /exit)
██  🏆  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
Auto Scorecard (Won) appears instantly on /exit. Compact single-block format with cost, efficiency, achievements by key.
auto scorecard · died (on /exit)
██  💀  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
Auto Scorecard (Died) fires on par bust. Achievement keys, ultrathink invocations, and a nudge to review the detailed card.
tokengolf scorecard · won (detailed)
██
██  🏆  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
██
Detailed ScoreCard (Won) via tokengolf scorecard. Full achievement labels, model breakdown, and tool usage.
tokengolf scorecard · died (detailed)
██
██  💀  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
██
Detailed ScoreCard (Died) via tokengolf scorecard. Full labels, ultrathink section, model and tool breakdowns.
tokengolf stats
⛳ 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 RestClean Run   🧰 Toolbox  💎 Diamond
🥊 One Shot  🪙 Penny Pincher  ⏱️ Speedrun  🐺 Lone Wolf  🔪 SurgeonEfficient
Career Stats is your lifetime dashboard. Wins, deaths, win rate, personal best, recent runs with prompt counts and par, and achievement collection.

🔥Effort Levels & Fast Mode

Effort Levels

Auto-detected from your Claude Code settings. Higher effort = more thinking = more spend. Tracked in achievements.

  • 🪶 Low · quick and cheap
  • ⚖️ Medium · the default (omitted in UI)
  • 🔥 High · deeper reasoning
  • 💥 Max · Opus only, maximum thinking

Fast Mode

Opus fast mode is auto-detected from your Claude Code settings. Unlocks unique achievements:

  • ⛈️ Lightning Run · Opus fast mode, under par
  • 🎰 Daredevil · Opus fast mode, EPIC efficiency

💰Spend Tiers

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.

Mythic
🏹 $0.03 · ⚔️ $0.10
⚜️ $0.30 · 🧙 $0.50
💎
Diamond
🏹 $0.15 · ⚔️ $0.50
⚜️ $1.50 · 🧙 $2.50
🥇
Gold
🏹 $0.40 · ⚔️ $1.50
⚜️ $4.50 · 🧙 $7.50
🥈
Silver
🏹 $1.00 · ⚔️ $4.00
⚜️ $12 · 🧙 $20
🥉
Bronze
🏹 $2.50 · ⚔️ $10
⚜️ $30 · 🧙 $50
💸
Reckless
above Bronze

🏅Efficiency Ratings

How well you used your par budget. Same scale whether par is $0.50 or $50. Colors follow the classic loot-tier hierarchy.

🌟
LEGENDARY
under 15%
🔥
EPIC
under 30%
💪
PRO
under 50%
SOLID
under 75%
⚠️
CLOSE CALL
under 100%
💥
BUST
over 100%

💰 Spend Tier

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.

🏅 Efficiency Rating

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.

🔄Session Patterns

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.

📦 Overencumbered

Context auto-compacted mid-session. You were carrying too much history and the model paid for it in confused reasoning and wasted tokens.

🥷 Ghost Run

Proactive context management. You compacted early, stayed light, and kept your par budget clean through the whole session.

🤦 Hubris

Extended thinking on a tight par budget. The thinking tokens pushed you over par. Power has a cost.

🔪 Surgeon

Minimal edits, maximum impact. You told the model exactly what to change and it did. No exploratory rewrites, no wasted tool calls.

⚡ Agentic

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.

🐺 Lone Wolf

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.

🏆Achievements

60+ achievements across 5 categories. Every session tells a story.

Class Medals
💎

Diamond

Haiku run under $0.10

🥇

Gold

Completed with Haiku

🥈

Silver

Completed with Sonnet

🥉

Bronze

Completed with Opus

⚜️

Paladin

Completed as Paladin (Opus plan mode)

♟️

Grand Strategist

EPIC efficiency as Paladin

Par Efficiency
🎯

Sniper

Under 25% of par used

Efficient

Under 50% of par used

🪙

Penny Pincher

Total spend under $0.10

Cost per Prompt
💲

Cheap Shots

Under $0.01 per prompt (≥3 prompts)

🍷

Expensive Taste

Over $0.50 per prompt (won or died)

Effort-Based
🏎️

Speedrunner

Low effort, completed under par

🏋️

Tryhard

High/Max effort, EPIC efficiency

👑

Archmagus

Opus at max effort, completed

Fast Mode
⛈️

Lightning Run

Opus fast mode, completed under par

🎰

Daredevil

Opus fast mode, EPIC efficiency

Prompting Skill
🥊

One Shot

Completed in a single prompt

💬

Conversationalist

20+ prompts in one run

🤐

Terse

≤3 prompts, ≥10 tool calls

🪑

Backseat Driver

15+ prompts, less than 1 tool call per prompt

🏗️

High Leverage

5+ tool calls per prompt (≥2 prompts)

Tool Mastery
👁️

Read Only

Won with no Edit or Write calls

✏️

Editor

10+ Edit calls in one run

🐚

Bash Warrior

10+ Bash calls comprising ≥50% of tools

🔍

Scout

≥60% of tool calls were Reads (≥5 total)

🔪

Surgeon

1–3 Edit calls, completed under par

🧰

Toolbox

5+ distinct tools used in one run

Tool Reliability

Clean Run

Zero failed tool calls (≥5 tool calls total)

🐂

Stubborn

10+ failed tool calls and still won

Turn Discipline
🤖

Agentic

3+ Claude turns per user prompt

🐕

Obedient

Exactly one turn per prompt (≥3 prompts)

Time
⏱️

Speedrun

Completed in under 5 minutes

🏃

Marathon

Session 60–180 minutes

🫠

Endurance

Session over 3 hours

Rest & Recovery
🔥

No Rest for the Wicked

Completed in one session

🏕️

Made Camp

Completed across multiple sessions

🧟

Came Back

Fainted (hit usage limits) and finished anyway

Context Management
📦

Overencumbered

Context auto-compacted during a won run

🎒

Traveling Light

Manual compact at 41–50% context

🪶

Ultralight

Manual compact at 31–40% context

🥷

Ghost Run

Manual compact at ≤30% context

Extended Thinking
🔮

Spell Cast

Used extended thinking in a won run

🧮

Calculated Risk

Extended thinking + EPIC efficiency

🌀

Deep Thinker

3+ thinking invocations, completed under par

🤫

Silent Run

No extended thinking, SOLID or better

Multi-Model
🏹

Frugal

Haiku handled ≥50% of session cost

🎲

Rogue Run

Haiku handled ≥75% of session cost

Paladin Planning Ratio
🏛️

Architect

Opus handled >60% of cost (heavy planner)

💨

Blitz

Opus handled <25% of cost (light plan, fast execution)

⚖️

Equilibrium

Opus/Sonnet balanced at 40–60%

Model Loyalty
🔷

Purist

Single model family throughout

🦎

Chameleon

Multiple model families used, under par

🔀

Tactical Switch

Exactly 1 model switch, under par

🔒

Committed

No switches, one model family

⚠️

Class Defection

Declared one class but cost skewed to another

Subagents
🐺

Lone Wolf

Completed with no subagents spawned

📡

Summoner

5+ subagents spawned in one run

🪖

Army of One

10+ subagents spawned, under 50% par used

🤦

Hubris

Used extended thinking, busted anyway

💥

Blowout

Spent 2× your par

😭

So Close

Died within 10% of par

🔨

Tool Happy

Died with 30+ tool calls

🪦

Silent Death

Died with ≤2 prompts

🤡

Fumble

Died with 5+ failed tool calls

🎲

Indecisive

3+ model switches (won or died)

⌨️CLI Commands

terminal
# 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)