TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ryoppippi/ccusage/llms.txt
Use this file to discover all available pages before exploring further.
session command groups your Claude Code usage by conversation sessions, showing token consumption and costs for each session.
Basic Usage
- Session ID (last two parts displayed)
- Input and output tokens
- Cache creation and read tokens
- Total tokens consumed
- Total cost in USD
- Last activity timestamp
- Models used
Command Options
View Specific Session
Load detailed usage data for a specific session ID:Filter by Date Range
View sessions within a specific date range:Dates must be in
YYYYMMDD format. Only sessions with activity in the specified range are shown.Model Breakdown
See per-model costs within each session:JSON Output
Export data in JSON format:jq Integration
Process JSON output with jq for advanced filtering:Common Flags
Load usage data for a specific session ID
Filter from date (YYYYMMDD format)
Filter until date (YYYYMMDD format)
Show per-model cost breakdown (default: false)
Output in JSON format (default: false)
Process JSON output with jq command (requires jq binary, implies —json)
Cost calculation mode:
auto (use pre-calculated if available), calculate (always calculate from tokens), display (always use pre-calculated)Timezone for date/time formatting (e.g., UTC, America/New_York, Asia/Tokyo). Default: system timezone
Locale for date/time formatting (e.g., en-US, ja-JP, de-DE). Default: en-US
Force compact mode for narrow displays
Use cached pricing data instead of fetching from API (default: false)
Show pricing mismatch information for debugging (default: false)
Examples
Most Recent Sessions
Expensive Sessions
Session with Full Breakdown
Sessions This Week
Understanding Sessions
Session ID Format
Sessions are identified by their Claude Code session ID, which appears in the format:abc123-def456).
Project Path
Each session includes aprojectPath field in JSON output, showing the full path to the project directory where the session took place.
Last Activity
ThelastActivity timestamp shows when the session was last used, helping you identify recent vs. old sessions.