Skip to main content

@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

npx @ccusage/amp@latest --help

Installation

Since npx @ccusage/amp@latest is quite long to type repeatedly, set up a shell alias:
alias ccusage-amp='bunx @ccusage/amp@latest'
Then simply run:
ccusage-amp daily
ccusage-amp monthly --json

Data Source

The CLI reads Amp thread data from:
  • Default: ~/.local/share/amp/threads/
  • Custom: Set AMP_DATA_DIR environment variable
Each thread is stored as a JSON file named 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:
npx @ccusage/amp@latest daily

Monthly Report

View usage aggregated by month:
npx @ccusage/amp@latest monthly

Session Report (Threads)

Detailed breakdown by individual threads:
npx @ccusage/amp@latest session

JSON Output

Export structured data for scripting:
npx @ccusage/amp@latest daily --json

Compact Mode

Optimized for screenshots and narrow terminals:
npx @ccusage/amp@latest daily --compact

Token Fields

Amp tracks detailed token usage:
FieldDescriptionBilling
inputTokensTotal input tokens sent to modelStandard input billing
outputTokensCompletion tokensOutput billing
cacheCreationInputTokensTokens used for cache creationCache creation cost
cacheReadInputTokensTokens read from cacheCheaper cached billing
totalTokensSum of input and outputTotal token count

Credits System

Amp uses a credits-based billing system in addition to token counts:
  • Each usage event includes a credits field
  • 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

VariableDescriptionDefault
AMP_DATA_DIRCustom Amp data directory path~/.local/share/amp
LOG_LEVELControl logging verbosity (0 silent … 5 trace)-

Data Structure

Amp thread files have this structure:
{
  "id": "T-{uuid}",
  "created": 1700000000000,
  "title": "Thread Title",
  "messages": [
    {
      "role": "assistant",
      "messageId": 1,
      "usage": {
        "model": "claude-haiku-4-5-20251001",
        "inputTokens": 100,
        "outputTokens": 50,
        "cacheCreationInputTokens": 500,
        "cacheReadInputTokens": 200,
        "credits": 1.5
      }
    }
  ],
  "usageLedger": {
    "events": [
      {
        "model": "claude-haiku-4-5-20251001",
        "credits": 1.5,
        "tokens": {
          "input": 100,
          "output": 50
        }
      }
    ]
  }
}

Model Support

Amp primarily uses Anthropic Claude models:
  • Claude Haiku (fast and efficient)
  • Claude Sonnet (balanced performance)
  • Claude Opus (most capable)
All models are priced using LiteLLM’s pricing database for accurate cost calculation.

Use Cases

Budget Tracking

Track both USD costs and Amp credits over time:
ccusage-amp monthly --json > usage.json

Thread Analysis

Analyze individual threads to understand costs per conversation:
ccusage-amp session

Credits Monitoring

Monitor Amp credits consumption for subscription planning:
ccusage-amp daily

npm Package

View on npm registry

Amp

Official Amp website

ccusage Family

Explore all related tools

Main Documentation

Full ccusage documentation

Build docs developers (and LLMs) love