Chuyển đến nội dung
Skillpedia
Agent48k · #6303

tokenwise

Skill này làm gì

TokenWise giúp tiết kiệm chi phí sử dụng AI bằng cách chọn mô hình AI rẻ nhất có thể hoàn thành công việc. Nó ghi lại chi phí của từng tác vụ và cho phép bạn thử xem mô hình nào phù hợp nhất với mình.

Khi nào nên dùng

  • ✓Khi bạn muốn cắt giảm chi phí mà không làm giảm chất lượng phản hồi.
  • ✓Khi bạn muốn kiểm tra xem một mô hình đơn giản hơn có đủ tốt cho các tác vụ của bạn không.
  • ✓Khi bạn muốn hiểu tiền dùng cho AI đang được chi vào đâu.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/tokenwise/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/tokenwise/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn kiểm tra xem mô hình Haiku có thể viết lại đoạn văn này cho đơn giản hơn không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

TokenWise phân tích tác vụ của bạn và gửi nó đến mô hình AI phù hợp và tiết kiệm nhất. Nó ghi lại chi phí chính xác của từng tác vụ và cho phép bạn so sánh các mô hình khác nhau để chắc chắn bạn đang chọn phương án tốt nhất.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

TokenWise — Measurement-Driven Model Router

Overview

A 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.

Anthropic'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.

When to use

  • Cutting Claude Code token spend without sacrificing output quality
  • Validating whether Haiku/Sonnet is "good enough" for a specific task class before trusting auto-routing
  • Auditing where Opus tokens are actually being burned
  • Logging per-session cost data for finance or chargeback

Subcommands

  • /tokenwise:install — guided installer with diff preview, automatic backups, and --dry-run mode
  • /tokenwise:report — per-session token + cost summary vs all-Opus baseline
  • /tokenwise:summary [--week|--month|--all] — historical aggregate with trend
  • /tokenwise:ab "<task>" — A/B test the same task at multiple tiers, generates a markdown comparison
  • /tokenwise:undo — restore CLAUDE.md / settings.json from backup

Routing taxonomy

Tier Model Task class
Mechanical Haiku 4.5 file reads, grep, format, rename, simple edits, doc lookups
Scoped reasoning Sonnet 4.6 single-file refactor, scoped research, test writing
Synthesis Opus 4.7 architecture decisions, multi-file refactor, security review

Safety caps:

  • Haiku never spawns further subagents
  • Max spawn depth = 2
  • Subagents that need a smarter model return to parent — they never escalate on their own
  • Tasks under 100 chars with no file context run inline (subagent overhead > savings)
  • Subagent context >30k tokens bumps a tier

Privacy

Zero 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.

Install

In any Claude Code session:

/plugin marketplace add CodeShuX/tokenwise
/plugin install tokenwise@tokenwise

Then run /tokenwise:install and follow the guided prompts.

Limitations

  • Token counts approximate to ±2% vs Anthropic billing
  • A/B test mode costs extra tokens (one task × N tiers) — intentional one-time validation
  • Anthropic-only by design (use LiteLLM or OpenRouter for cross-vendor)
  • 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

Source

Câu hỏi thường gặp

TokenWise chọn mô hình phù hợp như thế nào?

Nó dùng một danh sách định sẵn: tác vụ đơn giản, nhanh đi đến Haiku, tác vụ cần suy luận nhiều hơn đi đến Sonnet, còn tác vụ phức tạp như lập kế hoạch kiến trúc phần mềm đi đến Opus. Nó cũng có thể nâng cấp mô hình nếu tác vụ phức tạp hơn dự kiến.

TokenWise có gửi dữ liệu của tôi đi đâu không?

Không, nó hoàn toàn riêng tư. Mọi thông tin chi phí và tác vụ chỉ được lưu trên máy tính của bạn, và dữ liệu nhạy cảm được bảo vệ.

A/B test là gì?

Đây là tính năng cho phép bạn chạy cùng một tác vụ trên các mô hình AI khác nhau cùng lúc. Điều này giúp bạn xem mô hình nào cho chất lượng tốt nhất cho nhu cầu cụ thể của mình, đảm bảo việc tiết kiệm không làm ảnh hưởng đến kết quả.

Chi tiết

Mô tả gốc của tác giả

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.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#6303
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự