{"id":"d5864c89-713c-4e77-8309-478728117f28","shortId":"bzbHjn","kind":"skill","title":"tokenwise","tagline":"Measurement-driven model router for Claude Code. Routes Haiku/Sonnet/Opus per task class, logs every routed task with real $ numbers, and A/B tests cheaper tiers before you trust the savings.","description":"# TokenWise — Measurement-Driven Model Router\n\n## Overview\n\nA Claude Code skill that auto-routes subtasks to the cheapest model that can handle them (Haiku for grunt work, Sonnet for scoped reasoning, Opus only for synthesis), then logs every routed task to a local NDJSON with real token + cost numbers. Includes an A/B test subcommand that runs the same task across multiple tiers and scores quality, so the routing decisions are verified against the user's real workload — not estimated.\n\nAnthropic's own bug tracker (Issue #27665) reports 93.8% of Max-subscriber Claude Code tokens flow to Opus. Existing routers (claude-router, wshobson, VoltAgent) either pin models statically or route by vibes-based heuristics with no measurement. TokenWise fills the measurement gap.\n\n## When to use\n\n- Cutting Claude Code token spend without sacrificing output quality\n- Validating whether Haiku/Sonnet is \"good enough\" for a specific task class before trusting auto-routing\n- Auditing where Opus tokens are actually being burned\n- Logging per-session cost data for finance or chargeback\n\n## Subcommands\n\n- `/tokenwise:install` — guided installer with diff preview, automatic backups, and `--dry-run` mode\n- `/tokenwise:report` — per-session token + cost summary vs all-Opus baseline\n- `/tokenwise:summary [--week|--month|--all]` — historical aggregate with trend\n- `/tokenwise:ab \"<task>\"` — A/B test the same task at multiple tiers, generates a markdown comparison\n- `/tokenwise:undo` — restore CLAUDE.md / settings.json from backup\n\n## Routing taxonomy\n\n| Tier | Model | Task class |\n|---|---|---|\n| Mechanical | Haiku 4.5 | file reads, grep, format, rename, simple edits, doc lookups |\n| Scoped reasoning | Sonnet 4.6 | single-file refactor, scoped research, test writing |\n| Synthesis | Opus 4.7 | architecture decisions, multi-file refactor, security review |\n\nSafety caps:\n- Haiku never spawns further subagents\n- Max spawn depth = 2\n- Subagents that need a smarter model return to parent — they never escalate on their own\n- Tasks under 100 chars with no file context run inline (subagent overhead > savings)\n- Subagent context >30k tokens bumps a tier\n\n## Privacy\n\nZero telemetry. All logs in `.tokenwise/log.ndjson` local to the project. Task descriptions truncated to 80 chars and stripped of file contents before logging. No analytics endpoint exists in the source.\n\n## Install\n\nIn any Claude Code session:\n\n```\n/plugin marketplace add CodeShuX/tokenwise\n/plugin install tokenwise@tokenwise\n```\n\nThen run `/tokenwise:install` and follow the guided prompts.\n\n## Limitations\n\n- Token counts approximate to ±2% vs Anthropic billing\n- A/B test mode costs extra tokens (one task × N tiers) — intentional one-time validation\n- Anthropic-only by design (use LiteLLM or OpenRouter for cross-vendor)\n- Subagent `model:` param has known silent-fail bugs on some Claude Code builds — skill probes for this at install and refuses to configure if routing is broken\n\n## Source\n\n- Repo: https://github.com/CodeShuX/tokenwise\n- License: MIT\n- Author: CodeShuX","tags":["tokenwise","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity-skills"],"capabilities":["skill","source-sickn33","skill-tokenwise","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/tokenwise","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 37911 github stars · SKILL.md body (3,048 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:51:54.810Z","embedding":null,"createdAt":"2026-05-13T18:52:18.644Z","updatedAt":"2026-05-18T18:51:54.810Z","lastSeenAt":"2026-05-18T18:51:54.810Z","tsv":"'/codeshux/tokenwise':471 '/plugin':385,389 '/tokenwise':204,218,231,240,254,395 '100':330 '2':312,407 '27665':118 '30k':343 '4.5':269 '4.6':282 '4.7':293 '80':363 '93.8':120 'a/b':23,84,242,411 'ab':241 'across':92 'actual':190 'add':387 'aggreg':237 'all-opus':227 'analyt':373 'anthrop':112,409,427 'anthropic-on':426 'approxim':405 'architectur':294 'audit':185 'author':474 'auto':45,183 'auto-rout':44,182 'automat':211 'backup':212,260 'base':147 'baselin':230 'bill':410 'broken':466 'bug':115,447 'build':452 'bump':345 'burn':192 'cap':303 'char':331,364 'chargeback':202 'cheaper':25 'cheapest':50 'class':14,179,266 'claud':8,40,125,134,161,382,450 'claude-rout':133 'claude.md':257 'code':9,41,126,162,383,451 'codeshux':475 'codeshux/tokenwise':388 'comparison':253 'configur':462 'content':369 'context':335,342 'cost':80,197,224,414 'count':404 'cross':437 'cross-vendor':436 'cut':160 'data':198 'decis':101,295 'depth':311 'descript':360 'design':430 'diff':209 'doc':277 'dri':215 'driven':4,35 'dry-run':214 'edit':276 'either':138 'endpoint':374 'enough':174 'escal':324 'estim':111 'everi':16,70 'exist':131,375 'extra':415 'fail':446 'file':270,285,298,334,368 'fill':153 'financ':200 'flow':128 'follow':398 'format':273 'gap':156 'generat':250 'github.com':470 'github.com/codeshux/tokenwise':469 'good':173 'grep':272 'grunt':58 'guid':206,400 'haiku':56,268,304 'haiku/sonnet':171 'haiku/sonnet/opus':11 'handl':54 'heurist':148 'histor':236 'includ':82 'inlin':337 'instal':205,207,379,390,396,458 'intent':421 'issu':117 'known':443 'licens':472 'limit':402 'litellm':432 'local':75,355 'log':15,69,193,352,371 'lookup':278 'markdown':252 'marketplac':386 'max':123,309 'max-subscrib':122 'measur':3,34,151,155 'measurement-driven':2,33 'mechan':267 'mit':473 'mode':217,413 'model':5,36,51,140,264,318,440 'month':234 'multi':297 'multi-fil':296 'multipl':93,248 'n':419 'ndjson':76 'need':315 'never':305,323 'number':21,81 'one':417,423 'one-tim':422 'openrout':434 'opus':64,130,187,229,292 'output':167 'overhead':339 'overview':38 'param':441 'parent':321 'per':12,195,221 'per-sess':194,220 'pin':139 'preview':210 'privaci':348 'probe':454 'project':358 'prompt':401 'qualiti':97,168 'read':271 'real':20,78,108 'reason':63,280 'refactor':286,299 'refus':460 'renam':274 'repo':468 'report':119,219 'research':288 'restor':256 'return':319 'review':301 'rout':10,17,46,71,100,143,184,261,464 'router':6,37,132,135 'run':88,216,336,394 'sacrif':166 'safeti':302 'save':31,340 'scope':62,279,287 'score':96 'secur':300 'session':196,222,384 'settings.json':258 'silent':445 'silent-fail':444 'simpl':275 'singl':284 'single-fil':283 'skill':42,453 'skill-tokenwise' 'smarter':317 'sonnet':60,281 'sourc':378,467 'source-sickn33' 'spawn':306,310 'specif':177 'spend':164 'static':141 'strip':366 'subag':308,313,338,341,439 'subcommand':86,203 'subscrib':124 'subtask':47 'summari':225,232 'synthesi':67,291 'task':13,18,72,91,178,246,265,328,359,418 'taxonomi':262 'telemetri':350 'test':24,85,243,289,412 'tier':26,94,249,263,347,420 'time':424 'token':79,127,163,188,223,344,403,416 'tokenwis':1,32,152,391,392 'tokenwise/log.ndjson':354 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'tracker':116 'trend':239 'truncat':361 'trust':29,181 'undo':255 'use':159,431 'user':106 'valid':169,425 'vendor':438 'verifi':103 'vibe':146 'vibes-bas':145 'voltag':137 'vs':226,408 'week':233 'whether':170 'without':165 'work':59 'workload':109 'write':290 'wshobson':136 'zero':349","prices":[{"id":"37cffedb-612c-4501-abd7-e11e728b1088","listingId":"d5864c89-713c-4e77-8309-478728117f28","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-05-13T18:52:18.644Z"}],"sources":[{"listingId":"d5864c89-713c-4e77-8309-478728117f28","source":"github","sourceId":"sickn33/antigravity-awesome-skills/tokenwise","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/tokenwise","isPrimary":false,"firstSeenAt":"2026-05-13T18:52:18.644Z","lastSeenAt":"2026-05-18T18:51:54.810Z"}],"details":{"listingId":"d5864c89-713c-4e77-8309-478728117f28","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"tokenwise","github":{"repo":"sickn33/antigravity-awesome-skills","stars":37911,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-05-18T08:24:49Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"3589e46f326d93e702325048dd77484412c84af8","skill_md_path":"skills/tokenwise/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/tokenwise"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"tokenwise","license":"MIT","description":"Measurement-driven model router for Claude Code. Routes Haiku/Sonnet/Opus per task class, logs every routed task with real $ numbers, and A/B tests cheaper tiers before you trust the savings."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/tokenwise"},"updatedAt":"2026-05-18T18:51:54.810Z"}}