AugmentClaude

Cost Tracker

Monitor session costs, set budget alerts, and optimize token spending.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/cost-tracker-rohitg00/ — the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.

What this skill does

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

# Session cost is shown at the end of each session
# Mid-session: check the status bar or run /cost

Cost Drivers

OperationRelative CostOptimization
Large file readsHighUse offset/limit params
Broad grep searchesMediumScope to specific dirs
Subagent spawningHigh (new context)Reuse agents via SendMessage
Repeated tool callsCumulativeBatch operations
MCP tool callsVariableMinimize round-trips
Model selection3-10x differenceUse haiku for simple tasks

Token Budget by Task Type

TaskTypical CostBudget 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

Tool-Call Budgets

Set explicit budgets by task complexity:

Task TypeTool-Call BudgetWrap-Up At
Quick fix / lookup20 calls15
Bug fix30 calls25
Feature (small)50 calls40
Feature (large)80 calls65
Refactor50 calls40

At the wrap-up threshold: commit progress, assess remaining work, decide whether to continue or start fresh.

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
  7. One-pass discipline — Write complete solution, test once, stop if green
  8. No re-reads — Don't re-read unchanged files; trust cached knowledge
  9. Read before write — Never write a file without reading it first
  10. Kill output bloat — No sycophantic openers, no closing fluff, no prompt restatement

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

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 work

Related skills