cost-tracker
Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
Best use case
cost-tracker is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
Teams using cost-tracker should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cost-tracker/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cost-tracker Compares
| Feature / Agent | cost-tracker | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Cost Tracker
Monitor and optimize Claude Code session costs.
## Trigger
Use when:
- Checking session costs
- Setting budget alerts
- Optimizing token spend
- Planning multi-session work
## Cost Awareness
### Check Current Costs
```bash
# Session cost is shown at the end of each session
# Mid-session: check the status bar or run /cost
```
### Cost Drivers
| Operation | Relative Cost | Optimization |
|-----------|--------------|-------------|
| Large file reads | High | Use offset/limit params |
| Broad grep searches | Medium | Scope to specific dirs |
| Subagent spawning | High (new context) | Reuse agents via SendMessage |
| Repeated tool calls | Cumulative | Batch operations |
| MCP tool calls | Variable | Minimize round-trips |
| Model selection | 3-10x difference | Use haiku for simple tasks |
### Token Budget by Task Type
| Task | Typical Cost | Budget Alert |
|------|-------------|-------------|
| Bug fix | $0.10-0.50 | $1.00 |
| Feature (small) | $0.50-2.00 | $3.00 |
| Feature (large) | $2.00-8.00 | $10.00 |
| Refactor | $1.00-5.00 | $7.00 |
| Code review | $0.20-1.00 | $2.00 |
### Optimization Strategies
1. **Scope prompts tightly** — "Fix the auth bug in src/auth/login.ts" vs "Fix the auth bug"
2. **Use the right model** — Haiku for simple lookups, Sonnet for features, Opus for architecture
3. **Delegate to subagents** — Search/explore operations in subagents keep main context lean
4. **Compact proactively** — Don't wait for auto-compact; compact at task boundaries
5. **Read selectively** — Use `offset` and `limit` params for large files
6. **Batch operations** — Multiple independent tool calls in one message
## Budget Alerts
Set mental checkpoints:
- **50% budget** — Are you on track? Should you compact?
- **80% budget** — Wrap up current task, avoid new exploration
- **100% budget** — Commit what you have, start fresh session
## Output
```text
COST TRACKER
Session cost: $X.XX
Token usage: [input]K in / [output]K out
Cache hit rate: ~XX%
Top cost drivers:
1. [operation] — $X.XX
2. [operation] — $X.XX
Optimization tips:
- [specific suggestion]
```
## Rules
- Track costs as awareness, not hard limits
- Never sacrifice code quality to save tokens
- Compact at task boundaries, not mid-task
- Use subagents for exploration-heavy workRelated Skills
wrap-up
End-of-session ritual that audits changes, runs quality checks, captures learnings, and produces a session summary. Use when saying "wrap up", "done for the day", "finish coding", or ending a coding session.
thoroughness-scoring
Score every decision point with a Thoroughness Rating (1-10). AI makes the marginal cost of doing things properly near-zero — pick the higher-rated option every time. Includes scope checks to distinguish contained vs unbounded work.
sprint-status
Track parallel work sessions and prevent confusion across multiple Claude Code instances. Every major step ends with a status line. Every question re-states project, branch, and task.
smart-commit
Run quality gates, review staged changes for issues, and create a well-crafted conventional commit. Use when saying "commit", "git commit", "save my changes", or ready to commit after making changes.
session-handoff
Generate a structured handoff document capturing current progress, open tasks, key decisions, and context needed to resume work. Use when ending a session, saying "continue later", "save progress", "session summary", or "pick up where I left off".
safe-mode
Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.
replay-learnings
Surface past learnings relevant to the current task before starting work. Searches correction history, recalls past mistakes, and applies prior patterns. Use when starting a task, saying "what do I know about", "previous mistakes", "lessons learned", or "remind me about".
pro-workflow
Complete AI coding workflow system. Orchestration patterns, 18 hook events, 5 agents, cross-agent support, reference guides, and searchable learnings. Works with Claude Code, Cursor, and 32+ agents.
permission-tuner
Analyze permission denial patterns and generate optimized alwaysAllow and alwaysDeny rules. Use when permission prompts are slowing you down or after sessions with many denials.
parallel-worktrees
Create and manage git worktrees for parallel coding sessions with zero dead time. Use when blocked on tests, builds, wanting to work on multiple branches, context switching, or exploring multiple approaches simultaneously.
orchestrate
Wire Commands, Agents, and Skills together for complex features. Use when building features that need research, planning, and implementation phases.
mcp-audit
Audit connected MCP servers for token overhead, redundancy, and security. Use when sessions feel slow or before adding new MCPs.