Stalltop
- 1 Devlogs
- 7 Total hours
htop for your AI coding agents - and it tells you which one is stuck
htop for your AI coding agents - and it tells you which one is stuck
Hey guys, welcome to StallTop. In the AI agents era, managing your agents well and getting the most out of them is an important skill.
So I decided to create StallTop, an htop for AI coding agents. I built it out of a need of my own: one day, I was using Claude Code, Gemini CLI, Antigravity, and Codex all together for a big project I was working on; my agents hit their usage limit and sat idle for hours while I thought they were still working. For that reason, I decided to create StallTop, for managing resources, sessions advancements and limits.
The idea: StallTop should list every session, how many tokens used (it’s also calculated the cost, based on the model used, I still didn’t manage cost increase when context becomes larger), and above all, which one is stuck waiting for you: it could be a permission prompt, or just a usage limit. I’m using Rust.
I strated by creating the skeleton of the project, mainly by creating Cargo.lock and Cargo.toml, and starting by creating lib.rs and limit.rs
The limit parser (limit.rs) was the first module. When Claude Code hits a usage limit, the transcript gets a line like You've hit your session limit · resets 2:40am (Europe/Rome). That string is the whole reason the tool exists, so limits.rs turns it into a kind (session, weekly, monthly spend) and a real UTC timestamp for the reset. Three details took the time:
europe/rome isn’t a zone. So I restore the casing word by word, including America/New_York.[It has 9 tests: same day, next-day rollover, 12am, 24-hour clock, an explicit date, and three “garbage in” cases that must keep the limit hit but drop the reset time instead of crashing.]
I also worked on model.rs, which contains all of shared types (agent, token counters, status, a session with its last 20 events)
Then pricing.rs, which contains a price table for each model, with input and output cost for tokens and cache cost.
Then I worked on status, which are the rules. A dead session beats everything, then “waiting for you”, then a usage limit, busy and then idle. Six tests
The last two files were tail.rs and procfs.rs. The first one reads onyl the new lines of a growing file, while the otehr reads /proc behind a trait, so tests can use a fake process table.
Next I’m gonna work on a minimal TUI.