gaia-research

pi-cost

Calculate and display the token usage, turns, and estimated cost for the active session and subagent runs by parsing the harness session logs. Use when the user asks for token usage, session cost, or types `/pi-cost`.

gaia-research 23 8 Updated 2mo ago

Resources

1
GitHub

Install

npx skillscat add gaia-research/gaia-skill-tree/pi-cost

Install via the SkillsCat registry.

SKILL.md

pi-cost

A utility skill to parse and estimate costs for the active Pi coding agent session, including any subagents called during the run.

Setup

The Python helper script is pre-installed in the skill folder:
scripts/pi_cost.py

No extra dependencies are required.

Usage

When triggered, execute the helper script using the bash tool:

python3 .claude/skills/pi-cost/scripts/pi_cost.py

This will output:

  1. Active session file name and path.
  2. Main session stats: total turns, tokens (input/output/cacheRead/cacheWrite), and estimated cost based on standard model pricing.
  3. Nested subagent runs: breakdown of subagent name, model, turns, token details, and estimated cost.
  4. Total consolidated session summary.

Categories