← ClaudeAtlas

token-budgetlisted

Manages token budget estimation and tracking to prevent context overflow
amanpal3/Dr-SKILLs · ★ 3 · AI & Automation · score 69
Install: claude install-skill amanpal3/Dr-SKILLs
# 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:**