Skip to content
Agentmart
Submit a tool

token-budget

Manages token budget estimation and tracking to prevent context overflow

Skill by Ashish-Dhankecha

IndexedAGPL-3.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ashish-dhankecha-token-budget

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Manages token budget estimation and tracking to prevent context overflow

Use cases: finance

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/token-budget

What's inside

Skill name
token-budget
Description
Manages token budget estimation and tracking to prevent context overflow
License
AGPL-3.0
Instructions
163 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Token Budget Skill

<role>
You are a token-efficient agent. Your job is to maximize output quality while minimizing token consumption.

**Core principle:** Every token counts. Load only what you need, when you need it.
</role>

---

## Token Estimation

### Quick Estimates

| Content Type | Tokens/Line | Notes |
|--------------|-------------|-------|
| Code | ~4-6 | Depends on verbosity |
| Markdown | ~3-4 | Less dense than code |
| JSON/YAML | ~5-7 | Structured, repetitive |
| Comments | ~3-4 | Natural language |

**Rule of thumb:** `tokens ≈ lines × 4`

### File Size Categories

| Category | Lines | Est. Tokens | Action |
|----------|-------|-------------|--------|
| Small | <50 | <200 | Load freely |
| Medium | 50-200 | 200-800 | Consider outline first |
| Large | 200-500 | 800-2000 | Use search + snippets |
| Huge | 500+ | 2000+ | Never load fully |

---

## Budget Thresholds

Based on PROJECT_RULES.md context quality thresholds:

| Usage | Quality | Budget Status |
|-------|---------|---------------|
| 0-30% | PEAK | ✅ Proceed freely |
| 30-50% | GOOD | ⚠️ Be selective |
| 50-70% | DEGRADING | 🔶 Compress & summarize |
| 70%+ | POOR | 🛑 State dump required |

---

## Budget Tracking Protocol

### Before Each Task

1. **Estimate current usage:**
   - Count files in context
   - Estimate tokens per file
   - Calculate approximate %

2. **Check budget status:**
   ```
   Current: ~X,000 tokens (~Y%)
   Budget: [PEAK|GOOD|DEGRADING|POOR]
   ```

3. **Adjust strategy:**
   - PEAK: Proceed normally
   - GOOD: Prefer search-first
   - DEGRADING: Use outlines only
   - POOR: Trigger state dump

### During Execution

Track cumulative context:

```markdown
## Token Tracker

| Phase | Files Loaded | Est. Tokens | Cumulative |
|-------|--------------|-------------|------------|
| Start | 0 | 0 | 0 |
| Task 1 | 2 | ~400 | ~400 |
| Task 2 | 3 | ~600 | ~1000 |
```

---

## Optimization Strategies

### 1. Progressive Loading

```
Level 1: Outline only (function signatures)
Level 2: + Key functions (based on task)
Level 3: + Related code (if needed)
Level 4: Full file (only if essential)
```

### 2. Just-In-Time Loading

- Load file only when task requires it
- Unload mentally after task complete
- Don't preload "just in case"

### 3. Search Before Load

Always use context-fetch skill first:
1. Search for relevant terms
2. Identify candidate files
3. Load only needed sections

### 4. Summarize & Compress

After understanding a file:
- Document key insights in STATE.md
- Reference summary instead of re-reading
- Use "I've analyzed X, it does Y" pattern

---

## Budget Alerts

From Ashish-Dhankecha/Leo, AGPL-3.0.

More from Ashish-Dhankecha/Leo

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jun 28, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
AGPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Ashish-Dhankecha

Cite this page

token-budget skill. Agent Mart. https://agentmart.dev/skills/ashish-dhankecha-token-budget (last updated 2026-10-24)