Token monitor for coding agents — like htop for AI spend
Project description
tktop
Token monitor for coding agents. Like htop for your AI spend.
Features
- Live dashboard — real-time token usage breakdown (input/output/cache)
- Token flow graph — sparkline showing output tokens per turn
- Tool stats — see which tools consume the most calls
- Drift detection — 9 algorithms detecting loops, thrashing, runaway sessions
- Cost tracking — per-session cost estimates by model
- Turn drill-down — inspect individual turns with token split and content preview
- LLM analysis — on-demand optimization suggestions via Ollama/Anthropic/Vertex AI/OpenAI
Install
# From PyPI
pip install tktop
# Upgrade to the latest release
pip install -U tktop
Usage
tktop # launch interactive session list
Keybindings
| Key | Action |
|---|---|
↑/↓ or j/k |
Navigate |
enter |
Select / drill-down |
a |
Run LLM analysis |
r |
Refresh |
escape |
Back |
q |
Quit |
Supported Agents
- Claude Code
- Codex
- Cursor (planned)
- Aider (planned)
LLM Analysis
Copy .env.example to .env and configure:
cp .env.example .env
# Edit .env with your provider settings
Supported providers: ollama (default), anthropic, vertex, openai
Development
make install # install in dev mode
make test # run tests
make clean # clean build artifacts
Local development still uses an editable install:
pip install -e ".[dev]"
For maintainers, a versioned release can be prepared with:
make release VERSION=0.1.1
Devbox
If you have the Devbox CLI installed, you can bootstrap the repo with:
devbox shell
On first entry, the shell creates .venv, installs .[dev], and activates the
environment for the session.
License: MIT. See LICENSE.
Repository instructions for Codex are in AGENTS.md. The current
design is documented in
docs/specs/2026-06-08-tktop-design.md.
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 tktop-0.1.0.tar.gz.
File metadata
- Download URL: tktop-0.1.0.tar.gz
- Upload date:
- Size: 81.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2707eec6002ca50da8a1d1376cacf1989c6bb2787cf01710c0bc62d763a84c7
|
|
| MD5 |
76ceee14cf57cf303a3f1cad5091fb7a
|
|
| BLAKE2b-256 |
b064a1f7b88740fa88830e03c29a32c8654196f2e4404f5b4e3cb264354b48dc
|
Provenance
The following attestation bundles were made for tktop-0.1.0.tar.gz:
Publisher:
release.yml on chanilharisankar/tktop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tktop-0.1.0.tar.gz -
Subject digest:
e2707eec6002ca50da8a1d1376cacf1989c6bb2787cf01710c0bc62d763a84c7 - Sigstore transparency entry: 1809885584
- Sigstore integration time:
-
Permalink:
chanilharisankar/tktop@c0b345837a6496969331f7ab04d78e71cd11e5a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/chanilharisankar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0b345837a6496969331f7ab04d78e71cd11e5a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tktop-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tktop-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.0 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 |
5f5f17e833b7f7dc5bbbee414081f8acbfbdd78aaa45f84202fa016543223569
|
|
| MD5 |
6b95d1cae21a9cb19bc9b886384e559e
|
|
| BLAKE2b-256 |
68068efff4d6f90cbf2979bd7523bf38df127d9ced232a2128b68b4d72b1c097
|
Provenance
The following attestation bundles were made for tktop-0.1.0-py3-none-any.whl:
Publisher:
release.yml on chanilharisankar/tktop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tktop-0.1.0-py3-none-any.whl -
Subject digest:
5f5f17e833b7f7dc5bbbee414081f8acbfbdd78aaa45f84202fa016543223569 - Sigstore transparency entry: 1809885614
- Sigstore integration time:
-
Permalink:
chanilharisankar/tktop@c0b345837a6496969331f7ab04d78e71cd11e5a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/chanilharisankar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0b345837a6496969331f7ab04d78e71cd11e5a8 -
Trigger Event:
push
-
Statement type: