[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-5bad0fbd-d36a-40de-b695-7e9907e741a9":3,"$f7iJNeFPsSXcehIf058m96_B3yy5E-hfW2Cx5WUp6wic":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"5bad0fbd-d36a-40de-b695-7e9907e741a9","tokenwise","基于测量的模型路由器，用于Claude代码。根据任务类别路由Haiku\u002FSonnet\u002FOpus，以真实数字记录每个路由的任务，并在您信任节省之前对更便宜的层级进行A\u002FB测试。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: tokenwise\ndescription: \"Measurement-driven model router for Claude Code. Routes Haiku\u002FSonnet\u002FOpus per task class, logs every routed task with real $ numbers, and A\u002FB tests cheaper tiers before you trust the savings.\"\ncategory: developer-tools\nrisk: safe\nsource: community\nsource_repo: CodeShuX\u002Ftokenwise\nsource_type: community\ndate_added: \"2026-05-12\"\nauthor: CodeShuX\ntags: [model-routing, token-optimization, cost-reduction, anthropic, haiku, sonnet, opus, claude-code, ab-testing, measurement]\ntools: [claude]\nlicense: \"MIT\"\nlicense_source: \"https:\u002F\u002Fgithub.com\u002FCodeShuX\u002Ftokenwise\u002Fblob\u002Fmain\u002FLICENSE\"\n---\n\n# 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\u002FB 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\u002FSonnet 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- `\u002Ftokenwise:install` — guided installer with diff preview, automatic backups, and `--dry-run` mode\n- `\u002Ftokenwise:report` — per-session token + cost summary vs all-Opus baseline\n- `\u002Ftokenwise:summary [--week|--month|--all]` — historical aggregate with trend\n- `\u002Ftokenwise:ab \"\u003Ctask>\"` — A\u002FB test the same task at multiple tiers, generates a markdown comparison\n- `\u002Ftokenwise:undo` — restore CLAUDE.md \u002F 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\u002Flog.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\u002Fplugin marketplace add CodeShuX\u002Ftokenwise\n\u002Fplugin install tokenwise@tokenwise\n```\n\nThen run `\u002Ftokenwise:install` and follow the guided prompts.\n\n## Limitations\n\n- Token counts approximate to ±2% vs Anthropic billing\n- A\u002FB 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:\u002F\u002Fgithub.com\u002FCodeShuX\u002Ftokenwise\n- License: MIT\n- Author: CodeShuX\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,214,607,"2026-05-16 13:44:34",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"1d177675-bf0c-4ade-b3b7-f42486a9276f","1.0.0","tokenwise.zip",1963,"uploads\u002Fskills\u002F5bad0fbd-d36a-40de-b695-7e9907e741a9\u002Ftokenwise.zip","3c5d504aee84c821235a0767ca7195f491a3855fbd417219129c9c0b657495df","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":3688}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]