Skip to main content
skill CX Codex

cost-tracker — Claude Code skill: costs and setup

The cost-tracker skill helps you review Claude Code session costs, set budget checkpoints, and spot expensive work patterns. Use it when planning work across sessions.

MIT ★ 2,966 updated 2026-09-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow
Open on GitHub

What cost-tracker does

cost-tracker explains how to inspect session spending and identify common cost drivers, including large file reads, broad searches, repeated tool calls, and model choice. To check costs before a session ends, it points to the status bar or /cost; the session total appears when the session is over. Its budgets are planning guidance, not enforced caps.

The skill gives task-based cost and tool-call estimates, then suggests checkpoints at 50%, 80%, and 100% of a budget. At a checkpoint, decide whether to wrap up or continue in a fresh session. Other suggestions include narrowing prompts, reading large files in sections, and batching independent calls. It recommends Haiku for simple lookups, Sonnet for features, and Opus for architecture. Code quality should not be traded away to save tokens.

What it helps with

  • check the cost of an active session
  • estimate a budget for a bug fix or feature
  • spot operations that drive token spending
  • decide when to wrap up or start a fresh session

Example prompts for the agent

  • Review this session's costs and identify the main spending drivers.
  • Set a tool-call budget for implementing a large feature.
  • Suggest ways to reduce token use while searching this project.

How to install cost-tracker

1Plugin marketplace

/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow

This installs the whole pro-workflow plugin with all its skills

2Skills CLI (Vercel)

npx skills add rohitg00/pro-workflow --skill cost-tracker -a claude-code

3Manually: put the files in place

~/.claude/skills/cost-tracker/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cost-tracker/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cost-tracker

How do I install cost-tracker in Claude Code?

First add the marketplace with /plugin marketplace add rohitg00/pro-workflow, then install the plugin with /plugin install pro-workflow@pro-workflow.

What does cost-tracker do?

It helps review Claude Code session costs, identify spending drivers, and plan token and tool-call budgets. The budgets are guidance rather than hard limits.

How can I check spending before a session ends?

Check the status bar or run /cost. The final session cost is shown when the session ends.

Source text

SKILL.md · MIT
---
name: cost-tracker
description: Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
user-invocable: true
---

# 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 |

### Tool-Call Budgets

Set explicit budgets by task complexity:

| Task Type | Tool-Call Budget | Wrap-Up At |
|-----------|-----------------|------------|
| Quick fix / lookup | 20 calls | 15 |
| Bug fix | 30 calls | 25 |
| Feature (small) | 50 calls | 40 |
| Feature (large) | 80 calls | 65 |
| Refactor | 50 calls | 40 |

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

```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 work

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar skills

SKILL.md skills catalog →

From the same set83

The whole set →
replay replay finds relevant past learnings and mistakes in a local SQLite database before starting a task. Surfaces project context to reduce repeated edits. CX Codex +1 ★ 2,966repo stars insights The insights skill turns project memory and session history into analytics on corrections, saved learnings, and coding activity. Ask for a report to spot recurring patterns. CX Codex +1 ★ 2,966repo stars domain-modeling domain-modeling builds the project's shared vocabulary and context boundaries before code gets written, so the agent stops paraphrasing domain terms. Leaves a CONTEXT.md glossary behind. CX Codex +1 ★ 2,966repo stars llm-gate llm-gate configures prompt and agent hooks in Claude Code to validate commit messages, stop dangerous terminal commands, and catch secret leaks before execution. CX Codex +1 ★ 2,966repo stars reviewer reviewer — a subagent that reviews code line by line, reading actual files and citing every finding with exact quotes. Use before committing, during PR review, or after major changes. CX Codex ★ 2,966repo stars skill-conventions skill-conventions defines standards for workflow skills: separates human invocation from auto-triggers, governs state writes, and keeps the skill router in sync. CX Codex +1 ★ 2,966repo stars plan-interrogate The plan-interrogate skill probes a plan before implementation by mapping its decisions and asking about them one at a time. Use it to clarify unresolved design choices. CX Codex +1 ★ 2,966repo stars bug-capture bug-capture is a Claude Code skill that turns reported defects into GitHub issues using the project’s own terms. It activates after a conversational bug report, a QA pass, or a request to file an issue. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open