본문으로 건너뛰기
cccskills
무료GitHub에 공개

token-budget-advisor

Analyze prompts and offer depth / token-budget options BEFORE answering. Use this skill when the user wants to control token usage, tune response depth, choose between short and long answers, or optimize their prompt. Triggers on: "tokens", "token budget", "depth", "consumption", "short vs long answer", "how many tokens", "save tokens", "answer at 50%", "give me the short version", "I want to control how much you use", "tune your response", "presupuesto de tokens", "profundidad", "responde al 50%", "dame la versión corta", or any equivalent phrasing in English or Spanish. If the user wants to control length, detail or depth -- even without mentioning tokens explicitly -- this skill applies.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(18)

  • SKILL.md3.5 KB
  • .github/workflows/ci.yml1.1 KB
  • .gitignore234 B
  • assets/banner.svg6.5 KB
  • assets/depth-levels.svg12.2 KB
  • assets/flow.svg10.4 KB
  • assets/logo.svg3.4 KB
  • bin/install.js3.0 KB
  • examples/sample_prompts.json2.4 KB
  • LICENSE1.1 KB
  • package.json806 B
  • README.md8.9 KB
  • references/calibration.md2.9 KB
  • scripts/token_estimator.py12.1 KB
  • tests/__init__.py0 B
  • tests/conftest.py330 B
  • tests/test_benchmark.py2.2 KB
  • tests/test_token_estimator.py6.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Token Budget Advisor

A skill that intercepts the response flow so the user can make an informed choice about how much depth / how many tokens to spend BEFORE the answer is generated.

Workflow

Step 1: Analyze the prompt

Run the estimator on the user's prompt. The script lives at scripts/token_estimator.py inside this skill's directory.

python3 <SKILL_DIR>/scripts/token_estimator.py --text "USER_PROMPT"

For long prompts or prompts containing quotes, use a temp file:

cat > /tmp/_tba_prompt.txt << 'PROMPT_EOF'
USER_PROMPT
PROMPT_EOF
python3 <SKILL_DIR>/scripts/token_estimator.py --file /tmp/_tba_prompt.txt

Replace <SKILL_DIR> with the real install path (usually .claude/skills/token-budget-advisor or whatever appears in your config).

The script returns JSON with: input_tokens, detected_language, detected_type, complexity, response_estimates (per level 25/50/75/100), and total_estimates.

Step 2: Present the options to the user

Show the information clearly BEFORE answering the real prompt. See references/calibration.md for what each level includes and omits.

Recommended format:

Prompt analysis
---------------
Input: ~X tokens | Type: [type] | Complexity: [level]

Choose your depth level:

[1] Essential   (25%)  -> ~Y tokens   Direct answer only
[2] Moderate    (50%)  -> ~Z tokens   Answer + context + 1 example
[3] Detailed    (75%)  -> ~W tokens   Full answer with alternatives
[4] Exhaustive (100%)  -> ~V tokens   Everything, no limits

Heuristic estimate (~85-90% accuracy, +/- 15%).

Step 3: Wait for the choice

Ask the user which level they prefer. In Claude Code's terminal, render the options as plain text and wait for their reply.

Step 4: Respond at the chosen level

LevelLengthWhat to include
25% Essential2-4 sentences maxJust the direct answer. No preamble.
50% Moderate1-3 paragraphsAnswer + minimal context + 1 example if relevant.
75% DetailedStructured responseMultiple examples, pros/cons, alternatives.
100% ExhaustiveNo limitEverything: full analysis, complete code, every perspective.

Shortcuts

If the user already states a level, do not ask -- just answer at that level:

  • "at 25%" / "al 25%" / "short version" / "tldr" / "summary" -> 25%
  • "at 50%" / "al 50%" / "moderate" / "normal" -> 50%
  • "at 75%" / "al 75%" / "detailed" / "complete" -> 75%
  • "at 100%" / "al 100%" / "exhaustive" / "everything" / "no limit" -> 100%

If the user picked a level in a previous message of the same session, keep that level for subsequent responses without asking again -- unless they ask to change it.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

이 스킬의 문제 신고