From specialist-agent
Estimates token usage, costs across Haiku/Sonnet/Opus, complexity levels, and time for features by analyzing codebase files/lines via Glob/Read/Grep. Use for pre-implementation planning.
npx claudepluginhub herbertjulio/specialist-agent --plugin specialist-agentThis skill is limited to using the following tools:
Estimate token usage and cost before implementing a feature.
Estimates cost of coding tasks by analyzing complexity, predicting token usage via file counts and tool calls, and comparing prices across Claude models.
Routes Claude Code tasks to optimal models (Haiku, Sonnet, Opus) using decision matrices, cost tables, complexity signals, and subagent assignments for cost/quality tradeoffs.
Enforces cost-conscious mode in Claude Code, reducing tokens 40-70% and costs 30-60% via concise rules, model routing to Haiku/Sonnet, and efficient workflows. Activates with /cost-mode or cost mentions.
Share bugs, ideas, or general feedback.
Estimate token usage and cost before implementing a feature.
Target: $ARGUMENTS
Search codebase to understand scope:
# Find affected files
# Count existing lines
# Identify patterns
| Level | Files | Lines | Tokens (est.) | Cost (est.) |
|---|---|---|---|---|
| TRIVIAL | 1-2 | <50 | ~2,000 | ~$0.03 |
| SIMPLE | 3-5 | <200 | ~5,000 | ~$0.08 |
| MEDIUM | 6-15 | <1,000 | ~15,000 | ~$0.23 |
| COMPLEX | 15+ | 1,000+ | ~40,000 | ~$0.60 |
## Cost Breakdown
### Planning
- @planner: ~2,000 tokens
- Design doc (if complex): ~3,000 tokens
### Implementation
- File 1 (service.ts): ~1,500 tokens
- File 2 (adapter.ts): ~1,000 tokens
- File 3 (component.tsx): ~2,500 tokens
- File 4 (tests): ~1,500 tokens
### Review
- @reviewer: ~2,000 tokens
### Total
- Estimated: ~13,500 tokens
- Cost: ~$0.20
| Model | Tokens | Cost | Best For |
|---|---|---|---|
| Haiku | ~13,500 | ~$0.01 | Simple tasks |
| Sonnet | ~13,500 | ~$0.20 | Standard work |
| Opus | ~13,500 | ~$0.60 | Complex logic |
## Recommendations
**Full Mode (Sonnet):**
- Total: ~$0.20
- Best for: Production code, complex features
**Lite Mode (Haiku):**
- Total: ~$0.01
- Best for: Prototyping, simple changes
**Hybrid Approach:**
- Use Haiku for boilerplate (~$0.005)
- Use Sonnet for logic (~$0.10)
- Total: ~$0.105 (47% savings)
──── /estimate ────
Feature: [name]
Complexity: [TRIVIAL | SIMPLE | MEDIUM | COMPLEX]
Scope:
- Files: ~N
- Lines: ~N
- New code: ~N lines
- Modified: ~N lines
Token Estimate:
- Planning: ~N tokens
- Implementation: ~N tokens
- Review: ~N tokens
- Total: ~N tokens
Cost Estimate:
| Mode | Cost |
|------|------|
| Lite (Haiku) | ~$X.XX |
| Full (Sonnet) | ~$X.XX |
| Hybrid | ~$X.XX |
Recommendation: [which mode to use]
Comparison:
- Superpowers estimate for similar task: ~$X.XX
- Specialist Agent estimate: ~$X.XX
- Savings: ~X%
| Model | Input | Output |
|---|---|---|
| Haiku | $0.25 | $1.25 |
| Sonnet | $3.00 | $15.00 |
| Opus | $15.00 | $75.00 |
| Task | Tokens | Sonnet Cost |
|---|---|---|
| Fix typo | ~500 | ~$0.01 |
| Add field | ~2,000 | ~$0.03 |
| New component | ~5,000 | ~$0.08 |
| New module | ~15,000 | ~$0.23 |
| Full feature | ~40,000 | ~$0.60 |
| Excuse | Reality |
|---|---|
| "Estimating wastes time, just start building" | Building without estimates wastes 10x more when you pick the wrong model or approach. |
| "I can eyeball the complexity" | Eyeballing misses hidden dependencies. A structured estimate catches them. |
| "Cost doesn't matter for this task" | Every token has a cost. Knowing the cost helps choose Haiku vs Sonnet vs Opus. |
| "Estimates are always wrong anyway" | Rough estimates beat no estimates. Even ±50% accuracy saves money. |