agent-top
AGENTS.md22 starsChanged 2 months agoMITView on GitHub
agent-top is a Rust workspace with two crates: crates/agent-top-core/tests/fixtures holds real transcripts, reduced to the fields the parser reads, with the exact numbers each should produce. They cover what the inline unit tests cannot: a whole real session, at scale, including cost. A price-table edit that the unit tests wave through will fail here. When a golden test fails, decide which it is. If you meant to change the parse, re-record with UPDATE_GOLDEN=1 cargo test -p agent-top-core --test golden and…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository9 other files it gives its agents.
- docs/llms.txtllms.txt
- agent-topSkill
- rust-best-practicesSkill
- tuff-capabilitiesSkill
- tuff-cli-guideSkill
- add-harness-adapterSkill
- agent-topSkill
- tuff-cli-guideSkill
- write-changelogSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Never guess a price: If a model is not in pricing.rs, its tokens are unpriced_tokens.
- Very specific: line 12
Format notes live next to the parser: When a harness changes its on-disk layout, update the module doc comment in harness/<name>.rs with …
- Distinctive: line 15
Commit subjects follow Conventional Commits.
- Very specific: line 24
When a golden test fails, decide which it is.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent and contributor guide
agent-top is a Rust workspace with two crates:
crates/agent-top-core— discovery, transcript parsing, pricing, process trees. No terminal dependency. Everything here must be testable without a TTY and is what--jsonprints.crates/agent-top— the ratatui front end, CLI flags, formatting.
Rules
- Read-only. agent-top observes; it never signals, writes to, or connects to an agent. A PR that adds
kill, a socket client, or a hook that mutates agent state needs an RFC first (see the internal handbook). - Never guess a price. If a model is not in
pricing.rs, its tokens areunpriced_tokens. Update the table with the date it was checked. - Format notes live next to the parser. When a harness changes its on-disk layout, update the module doc comment in
harness/<name>.rswith the version you verified against. - Heuristics are labelled. Anything attributed by cwd or by name matching sets
Attribution::CwdHeuristicor is aProcKindguess; the UI must not present it as exact. - Edition 2024, no
unsafe, no async. One refresh per tick is cheap enough; keep it simple until measurements say otherwise. - Commit subjects follow Conventional Commits. No AI attribution trailers.
Golden fixtures
crates/agent-top-core/tests/fixtures holds real transcripts, reduced to the
fields the parser reads, with the exact numbers each should produce. They cover
what the inline unit tests cannot: a whole real session, at scale, including
cost. A price-table edit that the unit tests wave through will fail here.
When a golden test fails, decide which it is. If you meant to change the parse,
re-record with UPDATE_GOLDEN=1 cargo test -p agent-top-core --test golden and
review the diff, because that diff is the change to every user's numbers. If you
did not, the parse drifted.
Adding a fixture means sanitising it first: drop every field the parser does not read rather than masking it, then audit the result for real paths, prompts and tool output before committing. See the README in that directory.
The README demo
docs/demo.gif is recorded by vhs docs/demo.tape from docs/demo-snapshot.json
(the docs images by docs/screenshots.tape, docs/once.tape and
docs/views-and-panes.tape, with --theme dark so the terminal is never asked),
a hand-authored snapshot replayed through --replay. Never re-record it against
a live machine: the frame would carry real project names, working directories
and session ids into a public README. Edit the JSON to change what the demo
shows.
The same goes for the web view. docs/screenshots/ui-*.png come from
uv run --with playwright python docs/ui-demo.py, which fills a fresh store
with invented sessions and screenshots agent-top ui on it. Never screenshot
the view against a real store; edit the script's tables instead.
Checks
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo run -- --onceWhere the thinking is
Design documents (PRD, roadmap, RFCs, ADRs, decision log, debt register) are in the sibling repository agent-top-internal-docs, an mdBook. docs/ in this repository holds only the public-facing vision, architecture and roadmap.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

