Agent skill
token-cost-estimation
Estimate and track token costs before work sessions - complexity, duration, resources
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/token-cost-estimation
SKILL.md
Skill: token-cost-estimation
What I do
I estimate token costs BEFORE work sessions begin, enabling informed decisions about workflow optimisation. I provide structured cost breakdowns, identify savings opportunities, and track actual vs estimated usage via memory-keeper for continuous improvement.
When to use me
- Always-active: Load with every session automatically
- At the START of any work session before executing tasks
- When planning complex multi-step tasks
- When token budget is constrained
- During retrospectives to compare estimates vs actuals
Core principles
- Estimate upfront - Never start work without understanding expected cost
- Break down costs - Show components: investigation, implementation, verification
- Identify savings - Recommend optimisations before starting
- Track accuracy - Store estimates and actuals to improve over time
- Integrate with workflow - Use parallel-execution, scope-management to reduce costs
Estimation Framework
Task Complexity Tiers
| Tier | Description | Token Range | Examples |
|---|---|---|---|
| Simple | Single-file, well-defined task | 100-500 | Fix typo, add config, simple refactor |
| Moderate | Multi-file, clear scope | 500-2000 | Add feature, fix bug, update tests |
| Complex | Cross-cutting, investigation needed | 2000-5000 | Architecture change, new system |
| Major | Large scope, uncertain requirements | 5000+ | Full feature, migration, major refactor |
Duration Multipliers
| Duration | Multiplier | Impact |
|---|---|---|
| Short (<30min) | 1.0x | Focused, minimal context switching |
| Medium (30-90min) | 1.5x | Some iteration, context rebuilding |
| Long (90min+) | 2.0x | Multiple iterations, fatigue overhead |
Resource Factors
- Files involved: +100 tokens per file read/modified
- Codebase familiarity: New (2x), Familiar (1x), Expert (0.7x)
- Tool usage: Each tool call ~50-100 tokens overhead
- Verification: Tests add 30-50% to implementation cost
Cost Breakdown Template
## Token Cost Estimate
**Session Goal**: [state objective]
**Complexity Tier**: [Simple/Moderate/Complex/Major]
**Estimated Duration**: [time]
### Breakdown
| Phase | Estimated Tokens | Notes |
|-------|------------------|-------|
| Investigation | X | File reads, search, context |
| Implementation | Y | Edits, writes, iterations |
| Verification | Z | Tests, checks, validation |
| **Total** | **X+Y+Z** | |
### Optimisation Opportunities
- [ ] Parallel investigation (save ~X tokens)
- [ ] Scope reduction (save ~Y tokens)
- [ ] Efficient prompting (save ~Z tokens)
### Estimated vs Budget
- Estimate: X tokens
- Budget: Y tokens (if applicable)
- Difference: +/- Z
Savings Strategies
From parallel-execution
- Fan-out investigation: Read multiple files simultaneously
- Parallel verification: Run lint/test/check in parallel
- Estimated savings: 20-40% on investigation phase
From scope-management
- Reduce scope to essential deliverables
- Defer nice-to-haves to separate sessions
- Estimated savings: Variable (scope-dependent)
From token-efficiency
- Structure prompts clearly
- Provide focused context
- Use examples over descriptions
- Estimated savings: 10-30%
Post-Session Tracking
After session completion:
- Record actual token usage
- Compare to estimate
- Store in memory-keeper:
ESTIMATE: [prediction] ACTUAL: [result] VARIANCE: [difference] FACTORS: [what caused variance] → Update estimation heuristics
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Workflow-Orchestration/Token Cost Estimation.md
Related skills
pre-action- Clarify scope before estimatingmemory-keeper- Store estimates and actualsestimation- Task complexity evaluationtime-management- Duration estimationtask-tracker- Progress and complexity trackingscope-management- Resource identificationtoken-efficiency- Cost reduction techniquesparallel-execution- Efficiency through parallelism
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?