codingBy HowDoIUseAI Team

What Does /cost Do in Claude Code? (Token Usage Tracking)

The /cost command shows your current session's token usage and estimated spend. Here's how to read it, what the numbers mean, and how to stay on budget.

Wondering how much your Claude Code session is costing? The /cost command shows you exactly how many tokens you've used and an estimated dollar amount for your current session.

What does /cost show you?

Type /cost and you'll see a breakdown of:

  • Input tokens — everything Claude has read (your messages, file contents, tool results)
  • Output tokens — everything Claude has written back (responses, code, explanations)
  • Total tokens — combined usage for the session
  • Estimated cost — a dollar figure based on current model pricing

The dollar estimate is calculated locally from your token counts and the model's published rates. It may differ slightly from your actual bill — for authoritative billing, check the Usage page in the Claude Console.

How much does a typical session cost?

Real-world usage data shows the average is around $13 per developer per active day across enterprise deployments, with 90% of users staying below $30 per day. But individual sessions vary wildly:

Session TypeTypical TokensEstimated Cost (Sonnet)
Quick bug fix20K–50K$0.10–$0.50
Feature implementation50K–150K$0.50–$2.00
Large refactor150K–300K$2.00–$5.00
Full-day coding300K–500K+$5.00–$15.00

On API pricing (Sonnet 4.6: $3/1M input, $15/1M output), a session that reads 100K tokens of code and generates 20K tokens of output costs roughly $0.60.

On Pro ($20/month) or Max plans, you're paying a flat rate — /cost still shows tokens consumed, which helps you understand your usage relative to your plan limits.

When should you check /cost?

Check /cost when:

  • Before compacting — to see how much context you've accumulated
  • After a large operation — reading big files or running many tool calls can spike usage
  • Planning your day — if you're on API credits, knowing your burn rate helps you budget
  • Hitting rate limits — high token usage per window is usually why you're being throttled

How do you keep costs down?

  1. Use /compact proactively — compressing at 60% context saves tokens on every subsequent message
  2. Switch models with /model — use Haiku for simple tasks, Sonnet for most work, Opus only for complex reasoning
  3. Use /btw for quick questions — side questions don't accumulate in your main context
  4. Be specific in prompts — vague requests cause Claude to read more files and explore more options
  5. Use .claudeignore — exclude large directories (node_modules, build artifacts) from Claude's file scanning

/cost vs external monitoring tools

/cost is built-in and shows your current session. For historical tracking across sessions, the community has built tools like:

  • ccusage — CLI tool that reads Claude's local JSONL logs to show usage by date, session, or project
  • Claude-Code-Usage-Monitor — real-time dashboard with token consumption charts and limit predictions

These complement /cost by giving you the bigger picture of your spending patterns over time.