agtop
top for coding agents — a terminal dashboard showing what Claude Code and Codex sessions are
doing while they do it. ldegio, GPL v2, 224 stars. Node 18+, no external dependencies; runs via
npx @ldegio/agtop or installs globally.
What it shows
Per session: spend, token usage, context-window saturation (CTX%), CPU load, memory, tool
invocations with timestamps, subagent dispatches, and cost split by model. Aggregates get sparkline
charts; a live process tree shows child processes. The UI is keyboard-navigable with mouse support —
panels for Info, Performance, Processes, Tool Activity, Subagents, Cost and Config, cycled by tab or
number key — with search, filtering by session status and age, column sorting, and expansion into a
session’s subagents. Non-interactive output too: -l for a table, -j for JSON.
How it knows
Two sources joined, and the join is the whole trick. It parses JSONL transcripts for the financial
and token metrics, then correlates OS processes to sessions for CPU and memory. A generic process
monitor sees node burning a core and cannot say which session, which model, or how much that core
cost; agtop knows the session structures of both harnesses well enough to attribute it.
That is also the tool’s fragility: the transcript format is the harness’s private business, not a published interface, so this reads an artifact that can change without warning. Marked volatile.
Why it matters here — the corner had four levers and no instrument
This spoke’s token-budget corner is well populated with ways to spend less: headroom compresses tool outputs before the model sees them, safe-prompt-pruning deterministically removes expired material, pxpipe swaps modality to arbitrage image-token pricing, md-this-page strips at capture, and context-rot explains why the spending hurts quality and not just cost.
Every one of those is an intervention. None of them is a measurement. agtop is the first source here that only observes — it changes nothing about how an agent runs and reports what running it actually cost, per session, per model, with context saturation as a live number rather than an inference.
That matters because the corner’s claims are quantitative and mostly self-reported: 60–95% fewer tokens, 59–70% cost cut, 27–34% reductions. jetbrains-ponytail-tested is this spoke’s standing demonstration of what happens when someone measures such a claim independently — an advertised −54%/−20% came back at −15.4%/−10.3%. A per-session cost and token instrument is precisely what a practitioner would need to run that check on their own workload, which is a more useful thing than another lever.
Two honest limits. It measures cost and resource use, not quality — a session that spent little because the agent gave up cheaply looks good here. And CTX% is the corner’s most interesting number made visible without being made actionable: context-rot argues degradation tracks context accretion, and watching saturation climb tells you it is happening, not what to drop.
Related
claude-code · context-rot · headroom · pxpipe · safe-prompt-pruning · md-this-page · jetbrains-ponytail-tested · effort-level · agent-anti-patterns