Skillpedia
الوكلاء48k · #6303

tokenwise

ما الذي تفعله

يساعد TokenWise على توفير المال عند استخدام الذكاء الاصطناعي، باختيار أرخص نموذج يستطيع إنجاز المهمة. يسجل تكلفة كل مهمة، ويتيح لك تجربة النماذج لمعرفة أيها يناسبك أكثر.

متى تستخدمها

  • ✓لخفض التكاليف دون خسارة جودة الردود.
  • ✓للتحقق مما إذا كان نموذج أبسط يكفي لمهامك.
  • ✓لفهم المكان الذي تُنفق فيه أموال الذكاء الاصطناعي.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/tokenwise/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أريد أن أختبر ما إذا كان نموذج Haiku يستطيع إعادة كتابة هذه الفقرة لتصبح أبسط.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يحلل TokenWise مهمتك ويرسلها إلى النموذج الأنسب والأكثر فعالية من حيث التكلفة. يسجل التكلفة الدقيقة لكل مهمة، ويتيح لك مقارنة النماذج المختلفة للتأكد من أنك تستخدم الخيار الأفضل.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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

الأسئلة الشائعة

كيف يختار TokenWise النموذج المناسب؟

يستخدم قائمة محددة مسبقًا: المهام البسيطة والسريعة تذهب إلى Haiku، والمهام التي تحتاج إلى بعض الاستدلال تذهب إلى Sonnet، والمهام المعقدة مثل تخطيط بنية البرمجيات تذهب إلى Opus. ويمكنه أيضًا الترقية إلى نموذج أقوى إذا تبين أن المهمة أعقد مما توقع.

هل يرسل TokenWise بياناتي إلى أي جهة؟

لا، فهو خاص تمامًا. تُحفظ معلومات التكلفة والمهام على حاسوبك فقط، والبيانات الحساسة محمية.

ما هو اختبار A/B؟

هو ميزة تتيح لك تشغيل المهمة نفسها على نماذج مختلفة في الوقت ذاته. يساعدك ذلك على معرفة النموذج الذي يقدم أفضل جودة لاستخدامك، فتتأكد أن التوفير لا يضر بالنتيجة.

التفاصيل

الوصف الأصلي من المؤلف

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

الشعبية

نجوم GitHub
48k
الترتيب
#6303
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة