Skip to content

sbnet/headroom-stats

Repository files navigation

headroom-stats

A real-time terminal dashboard for Headroom — the token-optimization proxy for Claude. See your token savings, cache performance, and compression stats live, without leaving the terminal.

Rust License

Requirements

Installation

curl -fsSL https://raw.githubusercontent.com/sbnet/headroom-stats/main/install.sh | bash

This downloads a pre-built binary for your platform (Linux x86/arm64, macOS Intel/Apple Silicon) to ~/.local/bin. Re-run to update.

Custom install dir:

INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/sbnet/headroom-stats/main/install.sh | bash

Build from source (requires Rust 1.75+):

cargo install --git https://github.com/sbnet/headroom-stats

Usage

# Reads ANTHROPIC_BASE_URL automatically (set by headroom)
headroom-stats

# Explicit proxy URL
headroom-stats --url http://localhost:8787

# Custom refresh interval (default: 5s)
headroom-stats --interval 10
Key Action
q / Esc Quit
r Force immediate refresh

How it works

headroom-stats polls the /stats HTTP endpoint exposed by the Headroom proxy and renders the response as a live TUI dashboard using ratatui. The dashboard refreshes automatically every N seconds (configurable) and also responds to force-refresh on demand.

The displayed metrics mirror what headroom perf reports from logs, but sourced from the live proxy instead:

Section Source
Request summary requests.* + tokens.*
Per-model breakdown cost.per_model.*
Prefix cache prefix_cache.totals.*
Optimization overhead overhead.*
Content router router.route_counts
TOIN learning toin.*

Stack

Release workflow

# 1. Bump the version in Cargo.toml
# 2. Commit + tag
git tag vX.Y.Z
git push origin vX.Y.Z

Contribution Guidelines

  • Prefer small, focused pull requests.
  • Keep changes pragmatic: small diffs, clear manual checks, explicit commit messages.
  • Do not commit secrets or credentials in plain text.
  • If you change deployment behavior, update this README.

Security

If you identify a vulnerability or unsafe infra/deployment practice, open a private issue or contact the maintainer before public disclosure.

License

This project is licensed under MIT. See LICENSE.

About

A real-time terminal dashboard for Headroom — the token-optimization proxy. See your token savings, cache performance, and compression stats live, without leaving the terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors