Skip to content
Back to skills

Token Budget Analyzer

ASecurity

Analyze static code for token usage patterns, waste, and budget risks. Trigger: /token-budget

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 8, 2026
ai-agentsshell

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill token-budget-analyzer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Budget Analyzer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Token Budget Analyzer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-token-budget-analyzer/badge)](https://www.skillsdirectory.com/skills/majiayu000-token-budget-analyzer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: token-budget-analyzer
description: "Analyze static code for token usage patterns, waste, and budget risks. Trigger: /token-budget"
trigger: /token-budget
---
# /token-budget

LLM costs are dominated by token consumption. This skill finds excessive token waste and missing budgets before deployment.

## What this is for

- Unnecessarily long system prompts
- Context larger than max_tokens (truncation risk)
- Repetitive instructions across messages
- **Read-only skill.** No code changes.


## PROTECTION RULE - never ~/.claude/

Read-only skill. Guard required if write mode added later.

## What You Must Do When Invoked
During analysis, assign a confidence level to each finding: proven (confirmed by evidence), likely (strong signal, needs review), or suspected (weak signal).

If `/token-budget -help` or `/token-budget -h` (without further arguments)
is invoked: output the `## Usage` section unchanged and stop.

Otherwise follow these steps in order, skipping none.

### Step 1 - Help check
If invoked with `-help` or `-h`, output the `## Usage` section unchanged and stop.

### Step 2 - Clarify target

Clarify `-ProjectDir`. Get confirmation.

### Step 3 - Scan

```powershell
& "<SKILL_DIR>/scripts/token-scan.ps1" -ProjectDir "<path>"
```

### Step 4 - Classification

For each call site:

- **Efficient**: appropriate sizing for the task
- **Wasteful**: could be optimized without quality loss
- **Critical**: context window exceeded, truncation guaranteed

### Step 5 - Write report

File `token-budget-report.md` in current working directory:

1. **Summary** - call sites by efficiency.
2. **Call site table** - critical first. Per site: file, line, estimated input tokens, estimated output tokens, max tokens, truncation risk, recommendation.
3. **Open questions**.

### Step 6 - Summarize

State report path, highlight critical sites that will truncate or waste tokens.

## Usage

```
/token-budget               # interactive
/token-budget <dir>         # scan project
/token-budget -help
```


Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.