DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to check token usage and cost for a session and its Agents with Pi Herdsman

Read Pi-native token usage and cost for the current session and its owned Agent sessions.

Who it is forA developer running several delegated Agents who wants to know how much a task used before starting the next one.

The problemDelegated work spreads across many sessions, so the total token use and cost are hard to see in one place.

The outcomeThe Session stats view shows usage for the current session and its owned Agents, and for assigned Leads when a Manager is active.

What you need first

  • Linux or macOS for the released install script
  • Pi and herdr installed, or the install script to set them up
  • A Git project to work in

Steps

  1. Run pi install npm:pi-herdsman
  2. Run herdr integration install pi
  3. Start a session with pi inside a herdr pane
  4. Type /agents and open the Session stats view
  5. Compare the totals with the Agents you delegated

Prompt for your agent

Using the pi-herdsman repo, run a task that delegates work to <number> Agents in <project path>, then open the /agents Session stats view. Expected output: token usage and cost totals for the Lead session and its owned Agent sessions. Verify that the totals include each delegated Agent.

Caveat. The README says usage covers Pi-native token usage and cost for owned sessions, so it does not cover sessions outside the Lead ownership tree.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page