affaan-m/ECC/docs/zh-CN/skills/token-budget-advisor/SKILL.md
token-budget-advisor
Review token-budget-advisor's use cases, installation, workflow, and original source instructions.
- Source repository stars
- 234,327
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-07-27
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
在Claude回答之前拦截响应流程,让用户选择回答深度。
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/token-budget-advisor"Inspect the Agent Skill "token-budget-advisor" from https://github.com/affaan-m/ECC/blob/4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38/docs/zh-CN/skills/token-budget-advisor/SKILL.md at commit 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
何时使用
用户希望控制回答的长度或详细程度 用户提及token、预算、深度或回答长度 用户说"简短版"、"太长不看"、"简要"、"25%"、"详尽"等 任何用户希望预先选择深度/详细程度的情况
用户希望控制回答的长度或详细程度用户提及token、预算、深度或回答长度用户说"简短版"、"太长不看"、"简要"、"25%"、"详尽"等 - 02
工作原理
使用仓库的标准上下文预算启发式方法,在脑海中估算提示词的token数量。
散文:words × 1.3代码密集或混合/代码块:chars / 425% → min + (max - min) × 0.25 - 03
第一步 — 估算输入token
使用仓库的标准上下文预算启发式方法,在脑海中估算提示词的token数量。
散文:words × 1.3代码密集或混合/代码块:chars / 4使用仓库的标准上下文预算启发式方法,在脑海中估算提示词的token数量。
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 65/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 234,327 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | catalog record | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- affaan-m/ECC
- Skill path
- docs/zh-CN/skills/token-budget-advisor/SKILL.md
- Commit
- 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
Token预算顾问(TBA)
在Claude回答之前拦截响应流程,让用户选择回答深度。
何时使用
- 用户希望控制回答的长度或详细程度
- 用户提及token、预算、深度或回答长度
- 用户说"简短版"、"太长不看"、"简要"、"25%"、"详尽"等
- 任何用户希望预先选择深度/详细程度的情况
不要触发当:用户已在本会话中设置了级别(静默保持),或答案本身只有一行。
工作原理
第一步 — 估算输入token
使用仓库的标准上下文预算启发式方法,在脑海中估算提示词的token数量。
使用与context-budget相同的校准指南:
- 散文:
words × 1.3 - 代码密集或混合/代码块:
chars / 4
对于混合内容,使用主导内容类型并保持估算启发式方法。
第二步 — 按复杂度估算响应大小
对提示词进行分类,然后应用乘数范围获取完整响应窗口:
| 复杂度 | 乘数范围 | 示例提示词 |
|---|---|---|
| 简单 | 3× – 8× | "X是什么?",是/否问题,单一事实 |
| 中等 | 8× – 20× | "X是如何工作的?" |
| 中高 | 10× – 25× | 带上下文的代码请求 |
| 复杂 | 15× – 40× | 多部分分析、比较、架构 |
| 创意 | 10× – 30× | 故事、散文、叙事写作 |
响应窗口 = input_tokens × mult_min 到 input_tokens × mult_max(但不要超过模型配置的输出token限制)。
第三步 — 呈现深度选项
在回答之前呈现此区块,使用实际估算的数字:
分析您的提示...
输入:~[N] 个令牌 | 类型:[类型] | 复杂度:[级别] | 语言:[语言]
选择您的深度级别:
[1] 基础 (25%) -> ~[令牌数] 直接回答,无开场白
[2] 适中 (50%) -> ~[令牌数] 回答 + 背景 + 1个示例
[3] 详细 (75%) -> ~[令牌数] 完整回答及备选方案
[4] 详尽 (100%) -> ~[令牌数] 全部内容,无限制
选择哪个级别?(1-4 或说 "25% 深度", "50% 深度", "75% 深度", "100% 深度")
精确度:启发式估计约 85-90% 准确率(±15%)。
各级别token估算(在响应窗口内):
- 25% →
min + (max - min) × 0.25 - 50% →
min + (max - min) × 0.50 - 75% →
min + (max - min) × 0.75 - 100% →
max
第四步 — 按所选级别回答
| 级别 | 目标长度 | 包含内容 | 省略内容 |
|---|---|---|---|
| 25% 核心 | 最多2-4句话 | 直接回答、关键结论 | 上下文、示例、细微差别、替代方案 |
| 50% 适中 | 1-3个段落 | 答案+必要上下文+1个示例 | 深度分析、边界情况、参考文献 |
| 75% 详细 | 结构化回答 | 多个示例、优缺点、替代方案 | 极端边界情况、详尽参考文献 |
| 100% 详尽 | 无限制 | 一切内容——完整分析、所有代码、所有视角 | 无 |
快捷方式 — 跳过提问
如果用户已表明级别,立即按该级别回答,无需询问:
| 用户所说 | 级别 |
|---|---|
| "1" / "25%深度" / "简短版" / "简要回答" / "太长不看" | 25% |
| "2" / "50%深度" / "适中深度" / "平衡回答" | 50% |
| "3" / "75%深度" / "详细回答" / "全面回答" | 75% |
| "4" / "100%深度" / "详尽回答" / "完整深入分析" | 100% |
如果用户在本会话中已设置级别,后续回答静默保持该级别,除非用户更改。
精度说明
此技能使用启发式估算——非真实分词器。准确率约85-90%,偏差±15%。始终显示免责声明。
示例
触发场景
- "先给我简短版。"
- "你的回答会用多少token?"
- "按50%深度回答。"
- "我要详尽的答案,不要摘要。"
- "先给我简短版,再给详细版。"
不触发场景
- "什么是JWT token?"
- "结账流程使用了一个支付token。"
- "这正常吗?"
- "完成重构。"
- 用户已为本会话选择深度后的后续问题
来源
来自TBA — Claude Code的Token预算顾问的独立技能。 原始项目还附带了一个Python估算脚本,但本仓库保持技能自包含且仅使用启发式方法。
Alternatives
Compare before choosing
affaan-m/ECC
token-budget-advisor
Offers the user an informed choice about how much response depth to consume before answering. Use this skill when the user explicitly wants to control response length, depth, or token budget. TRIGGER when: "token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed answer", "exhaustive answer", "respuesta corta vs larga", "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión corta", "quiero controlar
affaan-m/ECC
token-budget-advisor
Review token-budget-advisor's use cases, installation, workflow, and original source instructions.