Track token usage and costs across Kiro CLI sessions
Project description
kiro-usage
Track token usage and costs across Kiro AI coding sessions — in real time.
A lightweight terminal dashboard that monitors your Kiro CLI token consumption and cost estimates — including cache-read/cache-write breakdown — and persists data across /clear and restarts via a background archiver.
Why? Kiro does not expose running token totals in the UI. This tool fills that gap: see exactly how many tokens and dollars each session costs, live, as you work.
Features
- Real-time dashboard — live-refreshing terminal UI (powered by Rich)
- Session archiving — background service snapshots sessions every 10 s; data survives
/clearand Kiro restarts - Cache breakdown — separates CacheWrite (new tokens), CacheRead (context resent), and Output tokens
- Cost estimates — cache-aware pricing (5-min write rate vs. 1-hour read rate)
- Multiple time windows — today / last 7 days / last 30 days / all time
- JSON output — pipe-friendly
--jsonflag for scripting - IDE tracking — tracks usage across Kiro IDE sessions as well as CLI sessions
- macOS + Linux — service registration via
launchd(macOS) orsystemd(Linux)
Install
Requires uv (recommended) or pip with Python ≥ 3.9.
# install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# install kiro-usage and register the background archiver
uv tool install kiro-usage && kiro-usage install
Or with pip:
pip install kiro-usage
kiro-usage install
Usage
kiro-usage # today's usage, live refresh
kiro-usage week # last 7 days
kiro-usage month # last 30 days
kiro-usage all # all time
kiro-usage --json # JSON output (machine-readable)
kiro-usage --no-live # print once and exit (good for scripts/CI)
Service Management
kiro-usage install # register background archiver (launchd / systemd)
kiro-usage uninstall # remove background archiver
kiro-usage status # check archiver status
The background archiver watches the Kiro CLI SQLite database for changes and snapshots sessions to ~/.kiro_sessions/ every 10 seconds. This ensures session data is preserved even after /clear or a Kiro restart.
How It Works
Kiro CLI / Kiro IDE
SQLite database (~/.kiro/...)
│
│ file mtime poll (every 10 s)
▼
kiro-usage-archiver ──► ~/.kiro_sessions/*.json
(launchd / systemd)
kiro-usage viewer ◄── ~/.kiro_sessions/*.json
(on-demand, live-refresh)
Token Metrics
| Metric | Description |
|---|---|
| CacheWrite | New tokens sent this turn (estimated, chars ÷ 4) |
| CacheRead | Prior context resent to the API (estimated) |
| Output | Tokens streamed back from the model (from chunks, accurate) |
| Cost | Cache-aware estimate — write tokens at 5-min rate, read tokens at 1-hour rate |
FAQ
Q: Does this work with Claude / Anthropic models?
Yes — Kiro uses Claude models under the hood. kiro-usage tracks whatever tokens Kiro sends and receives.
Q: Does it need an API key? No. It reads Kiro's local SQLite database directly — no network calls, no extra credentials.
Q: Is data sent anywhere?
No. Everything stays local in ~/.kiro_sessions/.
Q: Why do costs look like estimates? Kiro doesn't expose the exact prompt/completion split, so input tokens are approximated from character count (÷ 4). Output tokens come from streaming chunks and are accurate.
Q: Does it work without systemd / launchd?
Yes. Run kiro-usage-archiver manually in a terminal, or just use kiro-usage without the background service (you'll only see current-session data without persistence across /clear).
Uninstall
kiro-usage uninstall
uv tool uninstall kiro-usage
License
Project details
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 kiro_usage-0.1.3.tar.gz.
File metadata
- Download URL: kiro_usage-0.1.3.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecd024dacec2eb5caa5ceedb64059b3ab6bff6cfd1ae653ec1ab58d1c0081298
|
|
| MD5 |
6c31761eedbc3434954bbef785e199dc
|
|
| BLAKE2b-256 |
2cda78a4e46dcb0ecad5984eda7fc1e4012247120d9d1dc1ba1d2ed8cb8a9d2e
|
Provenance
The following attestation bundles were made for kiro_usage-0.1.3.tar.gz:
Publisher:
publish.yml on weswes0/kiro-usage-tracker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiro_usage-0.1.3.tar.gz -
Subject digest:
ecd024dacec2eb5caa5ceedb64059b3ab6bff6cfd1ae653ec1ab58d1c0081298 - Sigstore transparency entry: 1361541827
- Sigstore integration time:
-
Permalink:
weswes0/kiro-usage-tracker@3e7f21ec11d584257aedfd3fec51f50d4de5aa5e -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/weswes0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e7f21ec11d584257aedfd3fec51f50d4de5aa5e -
Trigger Event:
push
-
Statement type:
File details
Details for the file kiro_usage-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kiro_usage-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a70e64848df5e22ae32478f838975d0cbf7d66602d021925a98b016b3eef1c2
|
|
| MD5 |
e63ea1fae3c6a2c3aa30e0638f1ad3ce
|
|
| BLAKE2b-256 |
6a8fbf18c3ad84fa7126d6fb4beb868dd5f036a6695624a0bd600679ccf4b895
|
Provenance
The following attestation bundles were made for kiro_usage-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on weswes0/kiro-usage-tracker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiro_usage-0.1.3-py3-none-any.whl -
Subject digest:
0a70e64848df5e22ae32478f838975d0cbf7d66602d021925a98b016b3eef1c2 - Sigstore transparency entry: 1361541831
- Sigstore integration time:
-
Permalink:
weswes0/kiro-usage-tracker@3e7f21ec11d584257aedfd3fec51f50d4de5aa5e -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/weswes0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3e7f21ec11d584257aedfd3fec51f50d4de5aa5e -
Trigger Event:
push
-
Statement type: