Skip to main content

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

tktop-0.1.0.tar.gz (81.4 kB view details)

Uploaded Source

Built Distribution

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

tktop-0.1.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

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

Hashes for tktop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2707eec6002ca50da8a1d1376cacf1989c6bb2787cf01710c0bc62d763a84c7
MD5 76ceee14cf57cf303a3f1cad5091fb7a
BLAKE2b-256 b064a1f7b88740fa88830e03c29a32c8654196f2e4404f5b4e3cb264354b48dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tktop-0.1.0.tar.gz:

Publisher: release.yml on chanilharisankar/tktop

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

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

Hashes for tktop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f5f17e833b7f7dc5bbbee414081f8acbfbdd78aaa45f84202fa016543223569
MD5 6b95d1cae21a9cb19bc9b886384e559e
BLAKE2b-256 68068efff4d6f90cbf2979bd7523bf38df127d9ced232a2128b68b4d72b1c097

See more details on using hashes here.

Provenance

The following attestation bundles were made for tktop-0.1.0-py3-none-any.whl:

Publisher: release.yml on chanilharisankar/tktop

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page