Skip to main content

cc-cockpit

license: MIT

A Claude Code usage panel for GNOME: a tray indicator with a consumption ring, a local dashboard and a terminal summary.

Everything is read from what Claude Code already writes under ~/.claude. It makes no network calls, reads no credentials and sends nothing anywhere.

The interface follows your OS language — English, Portuguese and Spanish are bundled — and can be pinned in the config file or with --lang.

What it shows

5h block how much the current rate-limit window has consumed, time to reset, hourly pace, projection to the end of the block, and how long until the reference ceiling. The window starts at the exact timestamp of its first request — not rounded to the hour — which is what makes the reset match what the CLI reports
7 days / today / month rolling totals, as a percentage of your own historical peak
Open sessions every live CLI instance: name, project, busy/idle, uptime, RAM, pid, and what that session has consumed
Projects ranked by consumption across the whole history
Blocks, days and hours time series showing when you actually spend
Token mix input / output / cache write 5m / cache write 1h / cache read, with the cache hit rate
Models, effort and subagents where the consumption really goes

Usage is measured in API-equivalent USD: what those messages would cost on the pay-as-you-go API. On a Pro/Max plan none of it is billed — the number works as a weight unit for consumption and shows how much the plan returns.

Install

Debian / Ubuntu — the .deb pulls in the GTK dependencies by itself:

# from the latest release
sudo apt install ./cc-cockpit_0.2.0_all.deb
cc-cockpit setup

Arch — from the AUR:

yay -S cc-cockpit    # or: makepkg -si from packaging/PKGBUILD
cc-cockpit setup

Any distribution — pipx, reusing the system GTK bindings:

sudo apt install python3-gi python3-cairo gir1.2-ayatanaappindicator3-0.1  # tray only
pipx install cc-cockpit --system-site-packages
cc-cockpit setup

--system-site-packages is what lets the virtualenv see PyGObject and pycairo. Without them the tray is unavailable, and the dashboard and report still work.

From a checkout:

git clone https://github.com/wallacemartinss/cc-cockpit
cd cc-cockpit && ./install.sh

cc-cockpit setup registers the GNOME autostart entry, captures the statusline (see below), checks the tray dependencies and runs the first collection. cc-cockpit setup --remove undoes the autostart entry.

cc-cockpit                 # tray + dashboard in the background
cc-cockpit report          # terminal summary
cc-cockpit serve --open    # dashboard only (http://127.0.0.1:8765)
cc-cockpit json            # everything as JSON, for scripting
cc-cockpit collect         # ingest new transcripts and exit
cc-cockpit config          # config path and contents
cc-cockpit --lang es report

The real numbers, from the statusline

Two things cannot be derived from local transcripts:

  1. The limit belongs to the account, not to the CLI. Whatever you consume in the Claude app counts against the same window and leaves nothing on disk, so a window can start before your first local request.
  2. The weekly limit is a fixed window with its own reset time, not the rolling 7 days a local reader would assume.

Claude Code pipes a JSON payload into the statusline command on every render, and it carries exactly what the plan panel shows:

"rate_limits": {
  "five_hour": {"used_percentage": 23, "resets_at": 1788800000},
  "seven_day": {"used_percentage": 3,  "resets_at": 1788790000}
}

Register the capture once — no credentials, no undocumented endpoint:

cc-cockpit statusline --install

It writes statusLine into ~/.claude/settings.json, keeping a .bak. If you already had one, it is chained rather than replaced, so its output still shows in the CLI. The captured payload also carries the context window percentage per session, which the dashboard shows next to each open session.

From then on the official percentage is the source of truth, and it reveals the real ceiling — local consumption ÷ official percentage — so the currency figures stay meaningful too.

When there is no statusline data yet

Numbers fall back, in order of trust: official (statusline) → anchored (what you typed) → local estimate. The middle one exists because a fresh install has no capture yet:

cc-cockpit sync --block 23% --block-reset 1h55 --week 3% --week-reset 1h15
cc-cockpit sync            # show anchors, samples and implied ceilings
cc-cockpit sync --reset

Both the tray and the dashboard say which source is in use.

How it works

~/.claude/projects/**/*.jsonl   transcripts (usage per request)
~/.claude/sessions/*.json       one entry per live CLI       ─┐
statusline payload (stdin)      official rate limits + context ├─> cockpit/
      ~/.local/share/cc-cockpit/events.ndjson  <───────────────┘
      ~/.local/share/cc-cockpit/panel.json     official snapshot
  • collector.py reads each transcript from the last offset, so a refresh costs ~30 ms even with 190 MB of history.
  • Events land in a dedicated NDJSON file. That matters: Claude Code prunes transcripts after ~30 days, and from the first collection onward cc-cockpit keeps the full history.
  • Deduplication by message.id:requestId, so resuming a session is not counted twice.
  • sessions.py validates each pid against /proc and compares the starttime, so a recycled pid is never mistaken for a live session.
  • Prices live in pricing.py: cache writes at 1.25× (5m) and 2× (1h) of input, cache reads at 0.1× (0.025× on Fable 5.1). The transcript separates the two cache-write TTLs and the calculation uses that split instead of assuming 5m.
  • i18n.py holds one catalogue for all three surfaces, plus locale-aware number and currency formatting.
  • panel.py keeps the official snapshot and appends a line to panel-history.ndjson whenever the percentage changes.

Honest limitations

  • Without the statusline capture and without limits, the percentage is relative to your own history, not to the real plan limit.
  • The statusline only refreshes while a CLI session is rendering. That is enough — what is not running cannot be consuming — but right after a long gap the percentage may lag until the next render.
  • Consumption from the Claude app shows up in the official percentage, never in the local currency figures, which read Claude Code transcripts only.
  • Models released after this version fall back to their family price (opus, sonnet, haiku, fable) until they are added to pricing.py.
  • <synthetic> rows are responses the CLI generates locally: they show up in the request count and cost nothing.

Packaging

packaging/ holds the .deb build script and the Arch PKGBUILD; see packaging/README.md for the release flow. A v* tag builds the wheel, the sdist and the .deb, publishes to PyPI and attaches everything to the GitHub release.

License

MIT — see LICENSE.

Not affiliated with Anthropic.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_cockpit-0.2.0.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_cockpit-0.2.0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file cc_cockpit-0.2.0.tar.gz.

File metadata

  • Download URL: cc_cockpit-0.2.0.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cc_cockpit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4ca6f2a2bb553b2aa1f72101b4bef7e8dffb673f0d7591ed53ea7c25d0dff459
MD5 7770f279b4f7128aee3ebf3b64293cbf
BLAKE2b-256 7cae6586f32ec9e7cfd9cf73d419c7d39af27a9e1ba4ebf7994909ca2659eae5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_cockpit-0.2.0.tar.gz:

Publisher: release.yml on wallacemartinss/cc-cockpit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_cockpit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cc_cockpit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cc_cockpit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21bebee32e58e11afd9e1b3559504bb0d1cfc5c6e334e583af4de69ad83a9429
MD5 526f09456b4bbcaa6ee0e9c9d242c051
BLAKE2b-256 5d295485e423149bd1843c734aa59b8da95755b04fc14b09d972b987427a0324

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_cockpit-0.2.0-py3-none-any.whl:

Publisher: release.yml on wallacemartinss/cc-cockpit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.0 This release

2 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