Learn Claude Code: Cost & Context Mastery Reading the Signals: /usage, /context, and the Status Line

Reading the Signals: /usage, /context, and the Status Line

Intermediate 🕐 10 min Lesson 2 of 11
What you'll learn
  • Interpret the /usage output including the Session block, prompt cache stats, and plan usage breakdown
  • Use /context to identify what is consuming the most context window space in an active session
  • Configure the status line to display cost and context percentage continuously

Visibility Is the First Step to Control

You cannot manage what you cannot see. Claude Code gives you three tools for real-time cost and context visibility: the /usage command, the /context command, and the configurable status line. Together they tell you where you are, how fast you are spending, and where the tokens are going.

/usage: Your Session Dashboard

Run /usage at any point in a session to see a detailed breakdown. The Session block at the top covers the current session:

Total cost:            $0.55
Total duration (API):  6m 20s
Total duration (wall): 6h 33m 10s
Total code changes:    0 lines added, 0 lines removed
Usage by model:
   claude-sonnet-4-6:  1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)

The cost figure is computed locally from token counts at list price — it resets every time you run /clear. For authoritative billing, check the Usage page in the Claude Console. Subscription users (Pro, Max, Team, Enterprise) see plan usage bars and attribution breakdowns rather than a dollar figure that matters for billing.

The Prompt Cache Stats Block

After your first API response, /usage adds a prompt cache summary:

Prompt cache (main): 14 requests · 91% of input tokens from cache · 2 misses (last 6m 10s ago) · warm (1h TTL)

This tells you how well your session is benefiting from caching. A high cache-read percentage (90%+) means you are paying much less per turn than a cold session would cost. Misses show you when the cache was invalidated and had to be rebuilt. We cover caching in depth in lesson 4.

The Attribution Breakdown

On subscription plans, /usage also shows what is consuming your plan limits. Press d or w to switch between the last 24 hours and 7 days. Look for:

  • Behavior flags: behaviors that account for 10%+ of recent usage (long context, cache misses) flagged with tips to reduce them
  • Attribution: share consumed by skills, subagents, and individual MCP servers
  • Loops: per-task token costs for scheduled /loop tasks, ordered by total consumption

/context: What Is in the Window Right Now

Run /context to see a breakdown of what is currently consuming context window space. This is most useful mid-session when you want to understand why a session has grown large before deciding whether to /compact or /clear.

/insights: Pattern Analysis

Run /insights for a deeper analysis of your recent sessions. It reads up to 200 sessions stored locally and generates an HTML report covering what you work on, friction patterns (misunderstood requests, repeated corrections), and suggestions. Useful for identifying systemic habits — not session-level monitoring.

The Status Line

For continuous visibility without running commands, configure your status line to show cost and context percentage. The status line is a terminal prompt component that Claude Code updates after each turn. Common fields you can add: current session cost, context window percentage used, current model, and cache warm/cold state. Check /config to enable and customize it — you want to see the context fill before it becomes a problem, not after.

Key takeaways
  • The /usage Session block resets on /clear — costs shown are per-session estimates computed locally, not authoritative billing figures; check the Console for that.
  • The prompt cache stats line tells you your cache hit rate — 90%+ means you are paying a fraction of what uncached turns would cost; misses show when you lost that benefit.
  • On subscription plans, /usage behavior flags identify your biggest usage drivers (long context, cache misses) with specific tips — check it when a session feels expensive.
  • /context shows what is in the window right now and is most useful before deciding to /compact vs /clear; /insights shows patterns across sessions.
  • Configure the status line to show context percentage continuously — seeing the window fill in real time prevents surprises.