Token Chart
Productivitytoken-chartToken Chart is an Agent Skill for productivity published in the rcarmo/piclaw repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Generate a 7-day token usage chart (all chats) and post it to the web UI timeline.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/rcarmo/piclaw/blob/HEAD/skel/.pi/skills/token-chart/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/token-chart, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Token chart
Generate token-usage charts from the database or from session files.
Modes
default— daily stacked token-usage bars across the last N daysprovider-model— stacked usage grouped by provider + model for attribution by model familyprovider-model-cost— estimated cost grouped by provider + model using the pricing reference bundled with the script
Examples
Default chart:
bun /workspace/.pi/skills/token-chart/token-chart.ts
Provider + model chart:
bun /workspace/.pi/skills/token-chart/token-chart.ts --mode provider-model
Estimated provider + model cost chart:
bun /workspace/.pi/skills/token-chart/token-chart.ts --mode provider-model-cost
Post to the web chat via IPC:
bun /workspace/.pi/skills/token-chart/token-chart.ts --ipc
Post via IPC and allow a Pushover nudge:
bun /workspace/.pi/skills/token-chart/token-chart.ts --ipc --nudge
Data sources
- default source:
token_usagerows in${PICLAW_STORE}/messages.db --source sessions: read usage from session files under${PICLAW_DATA}/sessionsinstead of SQLite--sessions-dir <dir>: override the session-file location explicitly
Use --source sessions when DB-backed token usage is unavailable or when you want to inspect raw session-file history directly.
Output behaviour
--ipcwrites an IPC message JSON file and, if needed, an SVG media file so piclaw posts the chart to the web timeline.- without
--ipc, the script writes markdown to stdout with an embedded SVG data URL plus summary text. --output-svg <path>writes the SVG to a file in either mode.
Notes
- Numbers are formatted with compact
K/Mlabels. - Use this on demand unless you intentionally wire it into a scheduled task.