cs export and cs stats give you the numbers you need.
cs export
Options
| Flag | Description | |
|---|---|---|
| `—format json | csv` | Output format (default: json) |
--limit <n> | Maximum number of sessions to include (most recent first) | |
--json | Machine-readable output (same as --format json; included for consistency with other commands) |
What’s Included
Each exported record contains:- Session ID and name
- Start and end times
- Duration
- Files changed
- Commits made
- AI tokens used
- AI cost (USD)
- Notes
cs stats
--json to pipe results into scripts or dashboards.
| Flag | Description |
|---|---|
--json | Machine-readable output |
Use Cases
Freelance Billing
Pull the exact time and AI spend for a specific piece of work before writing an invoice:Weekly Review
Scan the last twenty sessions and then check lifetime totals:Export Reports
Capture a dated snapshot of recent sessions or overall stats as plain-text files:Advanced: Shell Aliases
Add these aliases to~/.bashrc or ~/.zshrc to cut down on typing for the commands you use most: