How falconsw/cost-info works
Cost Info is a Claude Code plugin that tracks session cost and token usage, displays a live meter, reports spending on /spend, and warns when a configured budget is crossed. Its main workflow is Claude Code events updating plugin-held meter state, followed by footer or pane rendering and an on-demand report. When Claude Code supplies no plan limits, the plugin polls MiniMax or Z.ai and parses their quota responses. The excerpts show the central hook and provider parsers; they do not expose every event registration or rendering detail.
Main entry points: register.tsx Meter hooks · index.d.ts Meter state types · minimax.ts MiniMax quota parser · glm.ts GLM quota parser
Components 9
Meter and UI
- Meter hooks
cost-info/hooks/register.tsx - Meter state types
cost-info/types/index.d.ts - Footer and pane
cost-info/hooks/register.tsx - Spend report
cost-info/hooks/register.tsx
Plan providers
- MiniMax quota parser
cost-info/hooks/minimax.ts - GLM quota parser
cost-info/hooks/glm.ts
Other components
- Claude Code
- MiniMax API
- Z.ai API
Connections 8
- Claude Code → Meter hooks: delivers events
README.md - Meter hooks → Meter state types: uses state shape
cost-info/types/index.d.ts - Meter hooks → Footer and pane: renders meter
cost-info/hooks/register.tsx - Meter hooks → Spend report: handles command
cost-info/hooks/register.tsx - Meter hooks → MiniMax quota parser: parses response
cost-info/hooks/register.tsx - Meter hooks → GLM quota parser: parses response
cost-info/hooks/register.tsx - Meter hooks → MiniMax API: fetches quota
cost-info/hooks/register.tsx - Meter hooks → Z.ai API: fetches quota
cost-info/hooks/register.tsx