cc-cockpit
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 paru, or makepkg -si
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
Configuration
Settings in the tray menu opens a proper window — GNOME's appindicator extension renders submenus inline and stops at one level, and a menu has nowhere to type a number. Saving applies right away, without a restart.
Everything lives in ~/.config/cc-cockpit/config.json, and any key missing from
the file is written back on start, so new options show up there:
{
"language": "auto", // auto (follows the OS) | en | pt | es
"block_hours": 5,
"limits": { "block_usd": null, "week_usd": null }, // null = automatic
"tray_metric": "block", // block | week | today | none
"tray_show_cost": true,
"menu_bar_style": "blocks", // blocks | dots | emoji
"refresh_seconds": 20,
"plan_monthly_usd": null, // e.g. 200 -> shows how many times the plan paid for itself
"plan_name": "",
"local_currency": null, // e.g. {"code":"BRL","symbol":"R$","rate":5.4}
"dashboard_port": 8765,
"warn_pct": 70,
"critical_pct": 90
}
The real numbers, from the statusline
Two things cannot be derived from local transcripts:
- 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.
- 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.pyreads 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.pyvalidates each pid against/procand compares thestarttime, 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.pyholds one catalogue for all three surfaces, plus locale-aware number and currency formatting.panel.pykeeps the official snapshot and appends a line topanel-history.ndjsonwhenever 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 topricing.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cc_cockpit-0.3.0.tar.gz.
File metadata
- Download URL: cc_cockpit-0.3.0.tar.gz
- Upload date:
- Size: 40.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67c54787231764211329653b8bd58c72152b9bea782a4fc6f70b12c638215b5c
|
|
| MD5 |
e9fff917e724913a51ce4e30447f7817
|
|
| BLAKE2b-256 |
7e1b4655f7dfdf9e8a46b2f6dd9d803618aae57781d705f2d06a6c65a0c7a2e5
|
Provenance
The following attestation bundles were made for cc_cockpit-0.3.0.tar.gz:
Publisher:
release.yml on wallacemartinss/cc-cockpit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_cockpit-0.3.0.tar.gz -
Subject digest:
67c54787231764211329653b8bd58c72152b9bea782a4fc6f70b12c638215b5c - Sigstore transparency entry: 2753811662
- Sigstore integration time:
-
Permalink:
wallacemartinss/cc-cockpit@0814c923b41d74828b4ff408355e8969204d4914 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/wallacemartinss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0814c923b41d74828b4ff408355e8969204d4914 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_cockpit-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cc_cockpit-0.3.0-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43421edba61b88d5dad1edf9fdbcfc1d6354dcb0043275b641a11136a652142a
|
|
| MD5 |
676246cb88fde34df0e86cdbdb3bc24f
|
|
| BLAKE2b-256 |
72ab1d7056a989bb3f0a1429b0ca4751ff0f4c147ed461451357e61ff9f4af82
|
Provenance
The following attestation bundles were made for cc_cockpit-0.3.0-py3-none-any.whl:
Publisher:
release.yml on wallacemartinss/cc-cockpit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_cockpit-0.3.0-py3-none-any.whl -
Subject digest:
43421edba61b88d5dad1edf9fdbcfc1d6354dcb0043275b641a11136a652142a - Sigstore transparency entry: 2753811679
- Sigstore integration time:
-
Permalink:
wallacemartinss/cc-cockpit@0814c923b41d74828b4ff408355e8969204d4914 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/wallacemartinss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0814c923b41d74828b4ff408355e8969204d4914 -
Trigger Event:
push
-
Statement type: