Skip to main content

kiro-usage

Track token usage and costs across Kiro AI coding sessions — in real time.

PyPI version Python License: MIT Platform

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 /clear and 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 --json flag for scripting
  • IDE tracking — tracks usage across Kiro IDE sessions as well as CLI sessions
  • macOS + Linux — service registration via launchd (macOS) or systemd (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

MIT

Release files for kiro-usage 0.1.3

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

Source distribution (sdist)

Source distribution for kiro-usage 0.1.3
File Size Uploaded
kiro_usage-0.1.3.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kiro-usage 0.1.3
File Interpreter ABI Platform
kiro_usage-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 33.0 kB

Release files / kiro_usage-0.1.3.tar.gz

Download URL kiro_usage-0.1.3.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ecd024dacec2eb5caa5ceedb64059b3ab6bff6cfd1ae653ec1ab58d1c0081298
BLAKE2b-256 checksum
How to use checksums
2cda78a4e46dcb0ecad5984eda7fc1e4012247120d9d1dc1ba1d2ed8cb8a9d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.

Transparency log

Release files / kiro_usage-0.1.3-py3-none-any.whl

Download URL kiro_usage-0.1.3-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a70e64848df5e22ae32478f838975d0cbf7d66602d021925a98b016b3eef1c2
BLAKE2b-256 checksum
How to use checksums
6a8fbf18c3ad84fa7126d6fb4beb868dd5f036a6695624a0bd600679ccf4b895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

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