DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

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.

Short answer: Run pi install npm:pi-herdsman; then run herdr integration install pi; start a session with pi inside a herdr pane. All steps.

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.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for boadij/pi-herdsman and "Check token usage and cost for a session and its Agents"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer