npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@timothywalton/agent-top

v0.1.0

Published

htop for AI agents. Live terminal dashboard for token burn rate, $ cost, API call rate, and action loops — press 'k' to kill a runaway agent on the spot. Built on aegis-node.

Readme

agent-top

htop, but for your AI agents. Live token burn rate, $ cost, API call rate, and loop detection — in your terminal, with a one-key kill switch.

demo

npm License


Why this exists

You can htop your CPU. You can docker stats your containers. But your AI agent — the thing that can rack up a $400 API bill in 20 minutes from a silent retry loop — runs invisibly until the bill arrives.

agent-top wraps any agent process and shows you, live, in your terminal:

  • Tokens/min — bar fills up, turns red as it approaches your scale
  • API calls/min — same, for outbound API call rate
  • Running total cost in $ (estimated from tokens, or reported directly)
  • Top repeated action with an automatic ⚠ loop warning
  • One key (k) to kill it instantly — no Ctrl-C dance, no "are you sure"

Install & run (under 60 seconds)

npx agent-top -- python my_agent.py

For live cost/token tracking, your agent prints one JSON line per event to stdout — these lines are automatically stripped from the visible output:

import json
print(json.dumps({"agent_top": {"tokens": 1500}}))
print(json.dumps({"agent_top": {"api_call": "openai.chat.completions"}}))
print(json.dumps({"agent_top": {"action": "tool:bash:ls"}}))

No telemetry? agent-top still works — you get uptime, exit status, and the kill key, no code changes needed.

What it looks like

agent-top  pid 5821  uptime 00:01:42

  tokens/min  ████████████████████████░░░░░░░░  38,400 / 50,000
  api calls/m ████████████████░░░░░░░░░░░░░░░░  16 / 60

  total tokens   194,200
  total api calls 78
  est. cost      $0.3884
  top action     tool:web_search:query=1 (x14/min)  ⚠ possible loop

  [k] kill agent now    [q] detach    aegis-node: active

Pairs with Aegis-Node

agent-top is the dashboard; aegis-node is the enforcement layer. Install both — agent-top detects aegis-node automatically and shows enforcement status in the footer. Use agent-top to watch, aegis-node to guarantee the limits hold even when you're not looking.

npm install agent-top aegis-node

Cost estimation

By default, cost is estimated at $0.002 / 1k tokens (rough blended small-model rate). Override with --price-per-1k:

npx agent-top --price-per-1k 0.015 -- python my_agent.py

Or report cost_usd directly per event for exact accounting:

{"agent_top": {"tokens": 1500, "cost_usd": 0.0225}}

Roadmap

  • [ ] Multi-agent view (tile multiple agent-top panes for agent swarms)
  • [ ] Historical session log + replay
  • [ ] Web dashboard mode (same telemetry protocol, browser UI)
  • [ ] Per-tool cost breakdown table

More from ScriptMasterLabs

Part of the agent-economy infrastructure stack: aegis-node (kill switch), proof402-middleware (x402 payments — RLUSD/XRPL or USDC/Base), and the full agent-payment architecture.

scriptmasterlabs.com/stack · Full architecture map

License

MIT