Skip to main content
CostHQ lets you export your session history and view lifetime statistics without leaving the terminal. Whether you are generating a client invoice, doing a weekly spend review, or piping data into another tool, cs export and cs stats give you the numbers you need.

cs export

Options

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

Display aggregate metrics across every session in your history. Use --json to pipe results into scripts or dashboards.

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:

Advanced: Dynamic Session Notes

Capture git context automatically when you end a session so the notes always reflect exactly what changed: