
Security News
GitHub to Block pull_request_target Workflows by Default Starting December 2
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.
Live htop-style TUI dashboard for AI token consumption across harnesses (OpenCode, Claude Code, Codex, generic JSONL)
htop — but for AI tokens. 🔥
A live terminal dashboard that shows, in real time, how many tokens your AI coding agents are burning across every harness on your machine — OpenCode, Claude Code, Codex, and anything that writes JSONL.
npm i -g tktop · pip install tktop-tui
tktop AI token consumption monitor · runtime: opencode · 12:02:16
sessions 3 (1 active) · in 438.1K out 229.0K cache-r 40.13M rsn 0 w 0 cost - burn - tok/min
┌─ scatter · x: tokens(in+out, log) · y: tok/min · 2 dots ─────────────────────────────────────────┐
│ y: 0…100 tok/min │
│ │
│ │
│ ✚ ★ │
│100K 1M 10│
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
◆ HARNESS MODEL SESSION IN OUT COST TOK/MIN ▼ AGE
✚ opencode eliza/glm-5-3 TOKFLOW 383.3K 186.9K - - 14s
· opencode eliza/glm-5-3 ├─ Sweep tokflow … 43.8K 35.8K - - 17h
· opencode eliza/glm-5-3 └─ Test tokflow J… 11.0K 6.3K - - 18h
showing 3 sessions matching "/tokflow"
sort: 1 burn · 2 recent · 3 tokens · 4 cost · g group: none · a archived:off · / filter · p
(real capture — the two nested sessions are subagents spawned by that very parent session)

You run OpenCode, Claude Code, Codex, and half a dozen agents in parallel. They all eat tokens, and none of them answer the simple question: what's burning right now, how fast, and who's responsible?
tktop answers it at a glance — the way htop does for CPU and nvtop does for GPUs:
t and subagent sessions nest under their parent with
htop-style ├─ / └─ glyphs.htop/nvtop class: total in/out at the top, filter (/ /
live substring typing), group-by with subtotals, sparkline history per session.tktop-dump prints the table once for scripts, logs, CI heat-maps.npm i -g tktop # all platforms
tktop
Or from Python:
pip install tktop-tui
tktop
Both install the same tktop command. The pip flavor stages the TUI into
~/.local/share/tktop/ and launches it with Bun — no path conflicts either way.
Requirements: Bun ≥ 1.3.14 on the PATH. If missing, tktop
prints the one-line fix and exits — first run of the pip version may also fetch JS
dependencies once.
warning EACCES ... /usr/lib/node_modules ? — system npm needs sudo. The npm-recommended fix is a user prefix —
mkdir ~/.npm-global
npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc && npm i -g tktop
EBADENGINE warnings about node >= 26 ? — cosmetic; tktop runs under Bun, not Node. npm just engine-checks against the Node it was invoked with.
From source: bun run src/index.ts; repo shim: ln -sf ~/tktop/bin/tktop ~/.local/bin/.
Headless: tktop-dump (or bun run src/dump.ts) prints one table and exits.
CLI flags: --interval <ms> · --filter <s> · --sort <key> (burn, recent, tokens,
cost, in, out, cacheR, rsn, age, harness, model, title, dir) · --all (include archived).
| Input | Action |
|---|---|
| click column header | sort by that column — ▼ desc / ▲ asc, click again to reverse |
| click row | move the selection cursor there |
| mouse wheel | scroll the table (cursor paging) |
1 2 3 4 | quick sort: burn rate · recency · total tokens · cost |
/ | filter, live-typed (harness · session · model · dir · id) — enter confirm, esc cancel |
g | group by: none → harness → model (subtotal rows) |
t | tree view — nest subagent sessions under their parent 🌳 |
a | show/hide archived sessions |
j k ↑ ↓ PgUp PgDn Home End | navigate |
p | toggle the live scatterplot |
r | force refresh now |
? | help overlay |
q | quit (Ctrl+C works too) |
| Where | What it means |
|---|---|
| Header banner | grand totals: input, output, reasoning, cache read/write, cost, live burn |
| Scatter plot | every active session is a colored marker · x = (bins+out) tokens, log scale · y = tok/min · 15s afterglow when a session goes idle |
Marker column ◆ | the same marker+color as the dot in the plot, so rows↔dots map at a glance (· = no live dot) |
TOK/MIN + sparkline | live burn rate (EMA) and its recent history — █▆▄▂▂▁▁ falling? generation finished |
CACHE-R / RSN | cache-read and reasoning tokens — hidden costs of agent workloads |
AGE | seconds/minutes since last activity — spot zombie or idle sessions |
| Harness | Source | Mode |
|---|---|---|
| OpenCode | ~/.local/share/opencode/opencode.db (session_v2, read-only) | cumulative counters |
| Claude Code | ~/.claude/projects/**.jsonl (auto-detected) | additive per-message usage |
| Codex CLI | ~/.codex/sessions/**.jsonl (auto-detected) | latest cumulative token_count |
| Anything | generic JSONL via ~/.config/tktop/adapters.json | additive or latest |
Zero configuration for the three built-ins. The generic JSONL adapter adds any tool you use in a few lines:
// ~/.config/tktop/adapters.json
{
"sources": [
{
"harness": "myagent",
"glob": "~/.myagent/sessions/*.jsonl",
"sessionId": "session_id",
"model": "model",
"title": "prompt",
"directory": "cwd",
"timeUpdated": "timestamp",
"usage": "usage",
"tokens": {
"input": "input_tokens",
"output": "output_tokens",
"reasoning": "reasoning_tokens",
"cacheRead": "cache_read_input_tokens"
},
"cost": "cost",
"mode": "additive" // sum per-line values; use "latest" for cumulative counters
}
]
}
All fields are dotted paths into each JSON line.
TOK/MIN + sparkline) is derived live from counter deltas between
polls and EMA-smoothed — accurate while tktop runs; restarts re-derive from scratch.costUSD). Missing → -.- until their harness records new usage (OpenCode persists usage on
message completion, not per token).| Doc | What |
|---|---|
docs/GOAL.md | Goals, scope, and explicit non-goals |
docs/ADR-001-architecture.md | Adapters → Store → UI projection, why it's layered |
docs/ADR-002-tooling-opentui.md | Why Bun + OpenTUI over Node/ncurses |
docs/ADR-003-adapters.md | Adapter data contract & failure discipline |
docs/RESOLUTION-PLAN.md | Shipped phases, verification evidence, roadmap |
CHANGELOG.md | Release history |
git clone https://github.com/AlexKay28/tktop && cd tktop
bun install # once
bun run src/index.ts # the TUI
bun run dump # headless table, data-layer smoke test
bun run typecheck # bun check
Layered so the data and UI never entangle: adapters (poll() → SessionInfo[],
never throws) → Store (rates, sorting, grouping, tree) → UI renderables. Adding a
harness means writing one adapter — see src/adapters/ and the
generic-JSONL config above as a template.
Enter on a session, headless via tktop-dump --drill)~/.config/tktop/config.json, bell on new alert)@opentui/ssh remote watching (tktop --serve [port], ssh -p <port> localhost)npm run compile → dist/tktop, ~130 MB, runs with no Bun install)Ideas welcome — please open an issue.
MIT © AlexKay28
If tktop saves you from a runaway agent — leave a ⭐.
FAQs
Live htop-style TUI dashboard for AI token consumption across harnesses (OpenCode, Claude Code, Codex, generic JSONL)
We found that tktop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.

Security News
/Application Security
A practical guide to securing GitHub Actions against supply chain attacks, covering malicious pull requests, credential theft, dependency risks, and release pipelines.

Security News
Composer 2.11 adds dependency cooldowns, joining package managers that delay new releases to reduce supply chain risks while allowing urgent security updates.