Skip to main content

AirPilot Blackbox

Analyze your Claude AI usage logs and calculate costs from ~/.claude or Docker containers.

Quick Start

uvx airpilot-blackbox
# or use the short alias
blackbox

Option 2: Clone and run

git clone https://github.com/shaneholloman/airpilot-blackbox.git
cd airpilot-blackbox
uv run .

Runtime Usage

# Analyze local ~/.claude directory (default)
blackbox
# or
uvx airpilot-blackbox

# Analyze Docker containers
blackbox --docker

# Export results to JSON
blackbox --output results.json

# Show only summary
blackbox --summary-only

# Show tool usage statistics
blackbox --tools

# Show cache efficiency analytics
blackbox --cache

# Show response time analysis
blackbox --response-times

# Show all enhanced analytics
blackbox --full

# Limit items shown in tables
blackbox --limit 5

uvx usage

# Analyze local ~/.claude directory (default)
uvx airpilot-blackbox

# Analyze Docker containers
uvx airpilot-blackbox --docker

# Export results to JSON
uvx airpilot-blackbox --output results.json

# Show only summary
uvx airpilot-blackbox --summary-only

# Show tool usage statistics
uvx airpilot-blackbox --tools

# Show cache efficiency analytics
uvx airpilot-blackbox --cache

# Show response time analysis
uvx airpilot-blackbox --response-times

# Show all enhanced analytics
uvx airpilot-blackbox --full

# Limit items shown in tables
uvx airpilot-blackbox --limit 5

Features

  • Zero Installation: Just clone and run with uv
  • Comprehensive Stats: Token usage, costs, sessions, daily trends
  • Docker Support: Analyze usage from devcontainers (auto-analyzes all containers)
  • Session Deduplication: Automatically detects and merges duplicate sessions across sources
  • Rich Terminal UI: Beautiful tables and formatting
  • Cost Tracking: Automatic calculation based on current Claude API pricing
  • Cache Analytics: Track cache efficiency, ROI, and savings
  • Response Time Analysis: Monitor performance by model and percentiles
  • Enhanced Tool Analytics: Cost per tool, usage patterns, and combinations

Example Output

uv run blackbox
╭────────────────────────╮
│ AirPilot Blackbox      │
│ Analyse AirPilot usage │
╰────────────────────────╯

Found 232 JSONL files across 1 source(s)
  Parsing usage logs...


Overall Usage Statistics
 Total Messages                20,132
 Input Tokens                 155,998
 Output Tokens              1,834,052
 Cache Creation Tokens     73,508,335
 Cache Read Tokens      1,532,465,059
 Total Tokens           1,607,963,444

 Total Cost                   $982.98

Model Usage Breakdown
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Model                    ┃ Messages ┃   Input ┃    Output ┃         Cache ┃    Cost ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ claude-sonnet-4-20250514 │   18,298 │ 151,274 │ 1,763,274 │ 1,510,144,603 │ $708.47 │
│ claude-opus-4-20250514   │    1,194 │   4,724 │    70,778 │    95,828,791 │ $274.51 │
│ <synthetic>              │      640 │       0 │         0 │             0 │ $0.0000 │
└──────────────────────────┴──────────┴─────────┴───────────┴───────────────┴─────────┘

Daily Usage
┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Date       ┃ Messages ┃ Sessions ┃      Tokens ┃    Cost ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━┩
│ 2025-06-23 │      335 │        3 │  23,717,050 │  $51.39 │
│ 2025-06-22 │    1,256 │       30 │  78,414,970 │ $202.86 │
│ 2025-06-21 │    1,014 │        2 │  90,414,152 │ $217.63 │
│ 2025-06-20 │      380 │        4 │  21,862,784 │  $69.93 │
│ 2025-06-19 │    1,048 │        7 │  79,102,093 │ $233.74 │
│ 2025-06-18 │       30 │        1 │   1,663,801 │   $6.13 │
│ 2025-06-17 │      153 │        5 │   6,541,711 │  $24.51 │
│ 2025-06-16 │    1,774 │       19 │ 130,643,490 │ $275.64 │
│ 2025-06-15 │      315 │        2 │  26,584,711 │  $66.19 │
│ 2025-06-14 │    2,440 │       25 │ 190,579,840 │ $411.25 │
└────────────┴──────────┴──────────┴─────────────┴─────────┘

Session Breakdown
┏━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Session ID  ┃ Messages ┃ Duration ┃ Models              ┃   Cost ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ 76966e72... │      422 │    3h 9m │ opus, sonnet, +1    │ $88.22 │
│ 81eab4b0... │      464 │   5h 20m │ opus, <synthetic>   │ $87.72 │
│ 126eb98b... │      320 │   3h 21m │ opus, <synthetic>   │ $71.68 │
│ 6ddd6588... │      176 │   4h 55m │ opus, <synthetic>   │ $57.34 │
│ 50a9c408... │      962 │  22h 41m │ sonnet, <synthetic> │ $42.44 │
│ 63dc55b9... │      838 │   5h 48m │ sonnet, <synthetic> │ $39.39 │
│ 71c64fb4... │    1,169 │   3h 53m │ sonnet              │ $38.31 │
│ 12606cef... │    1,069 │   7h 15m │ sonnet, <synthetic> │ $37.30 │
│ e42f0435... │      918 │    8h 7m │ sonnet, <synthetic> │ $35.40 │
│ 7a39bcd8... │      791 │   6h 52m │ sonnet, <synthetic> │ $31.71 │
└─────────────┴──────────┴──────────┴─────────────────────┴────────┘

Requirements

  • Python 3.8+
  • uv (install with curl -LsSf https://astral.sh/uv/install.sh | sh)
  • Docker (optional, for container support)

License

MIT

Metadata

Release files for airpilot-blackbox 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airpilot-blackbox 0.1.1
File Size Uploaded
airpilot_blackbox-0.1.1.tar.gz 51.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airpilot-blackbox 0.1.1
File Interpreter ABI Platform
airpilot_blackbox-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 76.7 kB

Release files / airpilot_blackbox-0.1.1.tar.gz

Download URL airpilot_blackbox-0.1.1.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eeb452aea0896369228cd04d773cf8277c2f33f021086e5251f279cabdab69dc
BLAKE2b-256 checksum
How to use checksums
d1452d95fe72e6f3eff6d75f9ef63f533361b0ecec32b7b62a062117dd20b003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Release files / airpilot_blackbox-0.1.1-py3-none-any.whl

Download URL airpilot_blackbox-0.1.1-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed060fa82e2ca5e2bbf2a4980ed74845c6154975426f161ec592f62c4cb85841
BLAKE2b-256 checksum
How to use checksums
f96205ff236125a9d767f3ed27a603da88a7f9272779adef559f038dc237d3fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page