@ccusage/amp
Analyze Amp session usage with the same reporting experience as ccusage. Track token usage, costs, and credits from your Amp CLI sessions with daily, monthly, and session-based reports.What is Amp?
Amp is a modern AI coding assistant CLI that uses Claude models. It features a unique credits-based billing system in addition to standard token tracking.Quick Start
Installation
Shell Alias (Recommended)
Sincenpx @ccusage/amp@latest is quite long to type repeatedly, set up a shell alias:
Data Source
The CLI reads Amp thread data from:- Default:
~/.local/share/amp/threads/ - Custom: Set
AMP_DATA_DIRenvironment variable
T-{uuid}.json containing:
- Thread metadata (title, created timestamp)
- Messages with usage information
- Usage ledger with billing events
- Credits consumed per operation
Common Commands
Daily Usage Report
View token usage, costs, and credits grouped by date:Monthly Report
View usage aggregated by month:Session Report (Threads)
Detailed breakdown by individual threads:JSON Output
Export structured data for scripting:Compact Mode
Optimized for screenshots and narrow terminals:Token Fields
Amp tracks detailed token usage:| Field | Description | Billing |
|---|---|---|
inputTokens | Total input tokens sent to model | Standard input billing |
outputTokens | Completion tokens | Output billing |
cacheCreationInputTokens | Tokens used for cache creation | Cache creation cost |
cacheReadInputTokens | Tokens read from cache | Cheaper cached billing |
totalTokens | Sum of input and output | Total token count |
Credits System
Amp uses a credits-based billing system in addition to token counts:- Each usage event includes a
creditsfield - Credits represent the billing cost in Amp’s credit system
- Credits are displayed alongside USD cost estimates in reports
- Useful for tracking Amp subscription usage
Credits in Reports
Both table and JSON outputs include:- Token counts - Standard input/output/cache tokens
- USD estimates - Calculated from LiteLLM pricing
- Credits consumed - Amp’s billing credits
Features
Daily Reports
View token usage, costs, and credits aggregated by date
Monthly Reports
Aggregate usage by month for budget tracking
Thread Reports
Detailed breakdown by individual threads (sessions)
Credits Tracking
Track Amp’s credits-based billing alongside USD costs
Accurate Costs
Uses LiteLLM pricing database for accurate cost calculation
Cache Support
Tracks cache creation and cache read tokens separately
JSON Output
Export data in structured JSON format with —json
Compact Mode
Use —compact flag for narrow terminals
Environment Variables
| Variable | Description | Default |
|---|---|---|
AMP_DATA_DIR | Custom Amp data directory path | ~/.local/share/amp |
LOG_LEVEL | Control logging verbosity (0 silent … 5 trace) | - |
Data Structure
Amp thread files have this structure:Model Support
Amp primarily uses Anthropic Claude models:- Claude Haiku (fast and efficient)
- Claude Sonnet (balanced performance)
- Claude Opus (most capable)
Use Cases
Budget Tracking
Track both USD costs and Amp credits over time:Thread Analysis
Analyze individual threads to understand costs per conversation:Credits Monitoring
Monitor Amp credits consumption for subscription planning:Links
npm Package
View on npm registry
Amp
Official Amp website
ccusage Family
Explore all related tools
Main Documentation
Full ccusage documentation