Agent skill

Token Budget Advisor

by affaan-m in affaan-m/ECC

在回答前,为用户提供关于消耗多少响应深度的知情选择。当用户明确希望控制响应长度、深度或令牌预算时使用此技能。触发条件:"token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed…

MITAuto-check passedAI & LLM Engineering

Install Token Budget Advisor

skills CLI
$ npx skills add affaan-m/ECC --skill token-budget-advisor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC token-budget-advisor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/zh-CN/skills/token-budget-advisor .claude/skills/token-budget-advisor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
token-budget-advisor
GitHub stars
276k
Token cost
~927 tokens
SKILL.md length
145 words
Files
1
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

在回答前,为用户提供关于消耗多少响应深度的知情选择。当用户明确希望控制响应长度、深度或令牌预算时使用此技能。触发条件:"token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed…

  • Tasks that involve LLM cost and token optimization
  • SKILL.md covers 何时使用, 工作原理, 快捷方式 — 跳过提问 and 精度说明, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Token Budget Advisor is an agent skill from affaan-m/ECC. 在回答前,为用户提供关于消耗多少响应深度的知情选择。当用户明确希望控制响应长度、深度或令牌预算时使用此技能。触发条件:"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 cuánto usas",或用户明确要求控制答案大小或深度的清晰变体。不触发条件:用户已在当前会话中指定了级别(保持该级别),请求明显是单字答案,或"token"指代认证/会话/支付令牌而非响应大小。

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM cost and token optimization. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Tasks that involve LLM cost and token optimization

Example prompts

  • “token budget”
  • “token count”
  • “token usage”
  • “/token-budget-advisor”

What it can do on your machine

Read from SKILL.md and the folder at commit 4eb71d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Token Budget Advisor loads about 927 tokens when it runs. Until then it costs about 119 tokens; SKILL.md has 145 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~119
When it runs · the whole SKILL.md, loaded when a task matches
~927

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 4eb71d9, republished under its MIT licence (© affaan-m). 145 words, ~927 tokens.

Download SKILL.mdSave it as .claude/skills/token-budget-advisor/SKILL.md (or your agent's skills folder).
name
token-budget-advisor
description
在回答前,为用户提供关于消耗多少响应深度的知情选择。当用户明确希望控制响应长度、深度或令牌预算时使用此技能。触发条件:"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 cuánto usas",或用户明确要求控制答案大小或深度的清晰变体。不触发条件:用户已在当前会话中指定了级别(保持该级别),请求明显是单字答案,或"token"指代认证/会话/支付令牌而非响应大小。
origin
community

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估算脚本,但本仓库保持技能自包含且仅使用启发式方法。

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in docs/zh-CN/skills/token-budget-advisor of affaan-m/ECC.

Open the folder on GitHubat commit 4eb71d9

Compare with similar skills

Token Budget Advisor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Token Budget Advisor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Token Budget Advisor this skillaffaan-m/ECC276k—~927Automated safety check: PassMIT
Context Compressionguanyang/open-agent-hub9772 repos~4.6kAutomated safety check: PassMIT
Bounty Hunter1sadjlk/bounty-hunter-skill2821 repos~761Automated safety check: PassMIT
Skill Shortenerluongnv89/asm955—~3.8kAutomated safety check: NotesMIT
Context Auditundefined-ui/second-brain-os1k—~802Automated safety check: PassMIT
Headroommomori777/Artemis380—~562Automated safety check: PassMIT

Similar skills

  • Context Compression

    guanyang/open-agent-hub

    This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve…

    977 GitHub starsUsed in 2 repos~4.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Bounty Hunter

    1sadjlk/bounty-hunter-skill

    A professional AI bounty hunter persona named Atlas. An agent skill from 1sadjlk/bounty-hunter-skill.

    282 GitHub starsUsed in 1 repo~761 tokens
    AI & LLM EngineeringAuto-check passed
  • Skill Shortener

    luongnv89/asm

    Refactor a too-long SKILL.md by progressive disclosure: measure token cost, classify every section KEEP/CUT/MOVE, shorten the body into references/ and scripts/, verify nothing was lost.

    955 GitHub stars~3.8k tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Context Audit

    undefined-ui/second-brain-os

    Audit an agent's context layout against the four places: system prompt, tools, history, tail.

    1k GitHub stars~802 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Headroom

    momori777/Artemis

    SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

    380 GitHub stars~562 tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check passed
  • AI

    butterbase-ai/butterbase-skills

    A skill your agent uses when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage

    534 GitHub stars~1.1k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed

More from affaan-m/ECC

All 682 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    277k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    277k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    277k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    277k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    277k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Set an ECC-specific frontend design direction for production UI work.

    277k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Questions about Token Budget Advisor

What does Token Budget Advisor do?

在回答前,为用户提供关于消耗多少响应深度的知情选择。当用户明确希望控制响应长度、深度或令牌预算时使用此技能。触发条件:"token budget", "token count", "token usage", "token limit", "response length", "answer depth", "short version", "brief answer", "detailed…. Token Budget Advisor is an agent skill from affaan-m/ECC.

When should I use Token Budget Advisor?

Token Budget Advisor fits situations like: tasks that involve LLM cost and token optimization.

How do I install Token Budget Advisor in Claude Code?

Run `npx skills add affaan-m/ECC --skill token-budget-advisor -a claude-code`. Or copy the skill folder (docs/zh-CN/skills/token-budget-advisor in affaan-m/ECC) into .claude/skills/token-budget-advisor in your project. Claude Code loads it when a task matches its description.

How do I install Token Budget Advisor in Codex?

Run `npx skills add affaan-m/ECC --skill token-budget-advisor -a codex`. Or copy the skill folder (docs/zh-CN/skills/token-budget-advisor in affaan-m/ECC) into .agents/skills/token-budget-advisor in your project. Codex loads it when a task matches its description.

Can I use Token Budget Advisor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill token-budget-advisor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/token-budget-advisor, .gemini/skills/token-budget-advisor, .github/skills/token-budget-advisor and .opencode/skills/token-budget-advisor in your project.

What does Token Budget Advisor need to run?

SKILL.md names no scripts, command-line tools or credentials: Token Budget Advisor is instructions for the agent only.

Does Token Budget Advisor access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Token Budget Advisor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Token Budget Advisor use?

Token Budget Advisor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Token Budget Advisor use?

About 927 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Token Budget Advisor?

Skills that share tags, products or a category with Token Budget Advisor: Context Compression (guanyang/open-agent-hub, 977 stars), Bounty Hunter (1sadjlk/bounty-hunter-skill, 282 stars), Skill Shortener (luongnv89/asm, 955 stars) and Context Audit (undefined-ui/second-brain-os, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Token Budget Advisor?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,111 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 10, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.