{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "boadij-pi-herdsman--check-token-usage-and-cost-per-session",
 "repo": "boadij/pi-herdsman",
 "repo_url": "https://github.com/boadij/pi-herdsman",
 "repo_slug": "boadij-pi-herdsman",
 "title": "Check token usage and cost for a session and its Agents",
 "page_title": "How to check token usage and cost for a session and its Agents with Pi Herdsman",
 "summary": "Read Pi-native token usage and cost for the current session and its owned Agent sessions.",
 "who": "A developer running several delegated Agents who wants to know how much a task used before starting the next one.",
 "problem": "Delegated work spreads across many sessions, so the total token use and cost are hard to see in one place.",
 "outcome": "The Session stats view shows usage for the current session and its owned Agents, and for assigned Leads when a Manager is active.",
 "steps": [
  "Run `pi install npm:pi-herdsman`",
  "Run `herdr integration install pi`",
  "Start a session with `pi` inside a herdr pane",
  "Type `/agents` and open the Session stats view",
  "Compare the totals with the Agents you delegated"
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "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.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/boadij-pi-herdsman/check-token-usage-and-cost-per-session/",
 "md": "https://dedupedai.com/use-cases/boadij-pi-herdsman/check-token-usage-and-cost-per-session/index.md",
 "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 hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/boadij-pi-herdsman--check-token-usage-and-cost-per-session.json",
 "api_version": "v1"
}
