/papi:usage-reporterfrom papi
Reports token usage from local AI client transcripts to PAPI build_execute. Sums input, output, and cache tokens for a time window. Supports Claude Code and OpenCode.
Ships in papi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
PAPI cannot see how many tokens a build used: the MCP call only sees its own request, and a model cannot read its own usage. The numbers exist in your AI client's local transcript. This skill sums them for a window and hands you the three numbers build_execute already accepts.
It is optional. If it cannot run, complete the build normally: tokens are recorded as Not recorded, never as 0 and never estimated.
| Client | Source | Status |
|---|---|---|
| Claude Code | ~/.claude/projects/<project path with dashes>/*.jsonl | Verified. Every assistant message carries input, output, cache read and cache creation tokens, a timestamp and the model. |
| OpenCode | ~/.local/share/opencode/opencode.db, table message | Verified (task-4842). Each assistant row has input, output, reasoning, cache read and cache write tokens, a millisecond timestamp and the model id. Run node .claude/skills/usage-reporter/scripts/opencode-usage-report.mjs --from <iso> --to <iso>. It covers every OpenCode session on the machine, not only this project. Needs Node 22+ (node:sqlite). |
| Codex | not verified | Codex was not installed on the machine checked, so no real transcript was available. No reader is shipped for it; it reports Not recorded until one is confirmed. |
started_at when you called build_execute to start, and the time you complete it.node .claude/skills/usage-reporter/scripts/usage-report.mjs \
--from 2026-10-14T09:00:00Z --to 2026-10-14T11:30:00Z
"notRecorded": false, pass its buildExecute object into the completing build_execute call as input_tokens, output_tokens and cache_read_tokens. If "notRecorded": true, pass nothing.Stage calls (plan, review_submit, release, strategy_review): each of these tool responses ends with a line naming the time the next window opened. On your next stage call, run the script with --from <that time> --to <now> and pass its buildExecute object, your model and window_started_at as the optional stage_usage argument. The server stores it on that call, so no one runs anything by hand and nothing is estimated.
Per-stage totals: pass --stages '{"plan":["<iso>","<iso>"],"build":[...],"review":[...],"release":[...]}' using the plan, build, review and release tool-call timestamps. Stages are assigned in order without overlap; whatever falls outside every stage is reported as unassigned, so the stages plus unassigned always equal the window total.
input_tokens meansinput_tokens is every prompt token that was not read from cache: the model's input_tokens plus cache_creation_input_tokens. cache_read_tokens is the cached part, kept apart because it is billed very differently. Totals are session windows: any other turns inside the window are counted too, and this is not a per-call figure.
input_tokens, output_tokens and cache_read_tokens into the build_execute call yourself. Those three integers are the whole payload, validated and capped by the server.message.id. The script keeps the last record per id; summing every line would roughly double the output tokens.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
papi@buildwithclaude is listed by davepoon/buildwithclaude — review the source before installing
npx claudepluginhub davepoon/buildwithclaude --plugin papi14 skills in this plugin
/check-mcpDiagnose why PAPI tools are missing or failing. Use when the user says "check mcp", "is papi connected", "papi isn't working", "mcp status", or when PAPI tools are expected but do not appear in the available tools list./deployment-completeness-auditRead-only audit of changes that were built but not wired, deployed or exercised. Trace the target project's actual release path, runtime, migrations and adapters; report evidence and missing access honestly./designDesign and critique any visible UI, before and after building. Trigger on UI work: "improve the UI", "redesign", "polish", "make it look better", "visual upgrade", "design review", "design audit", "layout fix", "UX improvement", or any task whose deliverable is a page, screen, or component that renders. Shapes a direction, critiques the surface, builds, and verifies. Reads the project's own DESIGN.md and PRODUCT.md at run time. If you are about to write or edit anything that renders visible UI, use this skill first.
Other plugins' skills for the same job