Communitygithub.com

토큰 예산 어드바이저

응답 흐름을 가로채어 Claude가 답변하기 전에 사용자에게 응답 깊이(depth)에 대한 선택권을 제공합니다.

토큰 예산 어드바이저란 무엇인가요?

토큰 예산 어드바이저(Token Budget Advisor, TBA)는 사용자가 응답의 깊이와 길이를 사전에 제어할 수 있도록 도와주는 AI 에이전트 스킬입니다. 응답 흐름을 가로채 입력 토큰 수를 추정하고, 프롬프트의 복잡도에 따라 예상 응답 크기를 계산한 후, 사용자에게 4단계(25%~100%)의 깊이 옵션을 제시합니다. 사용자가 '짧게', 'TLDR', '50% 깊이' 등의 키워드를 입력하면 자동으로 해당 수준에 맞춰 응답하며, 세션 내에서 한 번 깊이를 설정하면 이후 질문에는 질문 없이 해당 수준을 유지합니다. 이 스킬은 Claude Code, Cursor, Codex 등 다양한 AI 코딩 에이전트에서 사용할 수 있도록 설계되었으며, 휴리스틱 추정을 기반으로 약 85~90%의 정확도를 제공합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/token-budget-advisor

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

토큰 예산 어드바이저 (TBA)

Claude가 답변하기 전에 응답 흐름을 가로채어 사용자에게 응답 깊이(depth)에 대한 선택권을 제공합니다.

사용 시기

  • 사용자가 응답의 길이나 상세도를 제어하려는 경우
  • 사용자가 토큰, 예산, 깊이, 응답 길이를 언급하는 경우
  • 사용자가 "짧은 버전", "tldr", "간략히", "25% 깊이", "모든 것" 등을 말하는 경우
  • 사용자가 사전에 깊이/상세도 수준을 선택하려는 경우

트리거하지 않음: 사용자가 이미 이번 세션에서 수준을 설정한 경우(조용히 유지), 또는 답변이 한 줄로 끝나는 간단한 경우.

작동 방식

1단계 — 입력 토큰 추정

리포지토리의 표준 컨텍스트 예산 휴리스틱을 사용하여 프롬프트의 토큰 수를 대략적으로 추정합니다.

context-budget과 동일한 보정 지침을 사용합니다:

  • 산문: 단어 수 × 1.3
  • 코드 위주 또는 혼합/코드 블록: 문자 수 / 4

혼합 콘텐츠의 경우 지배적인 콘텐츠 유형을 사용하고 추정 휴리스틱을 유지합니다.

2단계 — 복잡도별 예상 응답 크기 추정

프롬프트를 분류한 후, 다음 배수 범위를 적용하여 전체 응답 범위를 구합니다:

복잡도배수 범위예시 프롬프트
단순3× – 8×"X가 무엇인가요?", 예/아니오, 단일 사실
중간8× – 20×"X는 어떻게 작동하나요?"
중간-높음10× – 25×컨텍스트가 포함된 코드 요청
복잡15× – 40×다중 부분 분석, 비교, 아키텍처
창의10× – 30×이야기, 에세이, 서술형 글쓰기

응답 범위 = input_tokens × mult_min ~ input_tokens × mult_max (단, 모델의 설정된 출력 토큰 한도를 초과하지 않음)

3단계 — 깊이 옵션 제시

답변하기 전에 실제 추정 숫자를 사용하여 다음 블록을 표시합니다:

프롬프트 분석 중...

입력: ~[N] 토큰  |  유형: [type]  |  복잡도: [level]  |  언어: [lang]

깊이 수준을 선택하세요:

[1] 필수      (25%)  ->  ~[tokens]   직접 답변, 서두 없음
[2] 보통      (50%)  ->  ~[tokens]   답변 + 컨텍스트 + 예제 1개
[3] 상세      (75%)  ->  ~[tokens]   대안과 함께 전체 답변
[4] 완전     (100%)  ->  ~[tokens]   모든 것, 제한 없음

어느 수준으로 할까요? (1-4 또는 "25% 깊이", "50% 깊이", "75% 깊이", "100% 깊이")

정밀도: 휴리스틱 추정 ~85-90% 정확도 (±15% 오차).

수준별 토큰 추정치 (응답 범위 내):

  • 25% → min + (max - min) × 0.25
  • 50% → min + (max - min) × 0.50
  • 75% → min + (max - min) × 0.75
  • 100% → max

4단계 — 선택된 수준으로 응답

수준대상 길이포함 항목생략 항목
25% 필수최대 2-4문장직접 답변, 핵심 결론컨텍스트, 예제, 뉘앙스, 대안
50% 보통1-3개 문단답변 + 필요한 컨텍스트 + 예제 1개심층 분석, 경계 사례, 참고 자료
75% 상세구조화된 응답여러 예제, 장단점, 대안극단적인 경계 사례, 모든 참고 자료
100% 완전제한 없음모든 것 — 전체 분석, 모든 코드, 모든 관점없음

바로가기 — 질문 건너뛰기

사용자가 이미 수준을 명시한 경우, 묻지 않고 즉시 해당 수준으로 응답합니다:

사용자가 말한 내용수준
"1" / "25% 깊이" / "짧은 버전" / "간단히" / "tldr"25%
"2" / "50% 깊이" / "보통 깊이" / "균형 잡힌 답변"50%
"3" / "75% 깊이" / "상세한 답변" / "철저한 답변"75%
"4" / "100% 깊이" / "모든 것을 다룬 답변" / "완전 심층 분석"100%

사용자가 이전에 세션에서 수준을 설정한 경우, 변경하지 않는 한 이후 응답에서 조용히 유지합니다.

정밀도 참고

이 스킬은 휴리스틱 추정을 사용합니다 — 실제 토크나이저가 아닙니다. 정확도 ~85-90%, 변동 ±15%. 항상 면책 조항을 표시하세요.

예시

트리거 예시

  • "먼저 짧은 버전을 줘."
  • "네 답변에 토큰이 얼마나 사용될 거야?"
  • "50% 깊이로 응답해줘."
  • "요약 말고 완전한 답변을 원해."
  • "Dame la version corta y luego la detallada."

트리거되지 않는 예시

  • "JWT 토큰이 뭐야?"
  • "체크아웃 플로우에 결제 토큰을 사용해."
  • "이거 정상이야?"
  • "리팩터를 완료해."
  • 사용자가 이미 이번 세션의 깊이를 선택한 후의 후속 질문

출처

TBA — Token Budget Advisor for Claude Code의 독립형 스킬입니다. 원본 프로젝트에는 Python 추정 스크립트도 포함되어 있지만, 이 리포지토리는 스킬을 독립적이고 휴리스틱 전용으로 유지합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

관련 스킬