claude-mobile-cost-tracking

Calculate and aggregate Claude API costs per session using exact token pricing.

3|1|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/krzemienski/claude-mobile-expo --skill claude-mobile-cost-tracking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-mobile-cost-tracking
Source: https://github.com/krzemienski/claude-mobile-expo/tree/main/.claude/skills/claude-mobile-cost-tracking
Command: npx skills add https://github.com/krzemienski/claude-mobile-expo --skill claude-mobile-cost-tracking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Lack of transparency and control over Claude API costs for users can lead to frustration and unexpected bills. This Skill provides a mandatory, precise system for calculating, aggregating, and displaying API usage costs, fostering trust and clarity.

Core Features & Use Cases

  • Exact Cost Calculation: Uses Anthropic's precise pricing ($0.003/1k input, $0.015/1k output) for accurate, auditable cost reporting.
  • Per-Session Aggregation: Tracks costs for individual messages and aggregates them per user session for detailed analysis and historical review.
  • Frontend Display & Slash Command: Integrates cost metrics directly into the app's Settings screen and provides a /cost slash command for immediate user access.
  • Use Case: Implement a cost tracking service in your mobile app that shows users exactly how much their AI interactions are costing them in real-time, fostering trust and preventing surprise bills.

Quick Start

Use the claude-mobile-cost-tracking skill to implement the CostService and integrate the total session cost display into the Settings screen.

Frequently Asked Questions about claude-mobile-cost-tracking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I track Claude API costs in real time?

Track Claude API costs by calculating per-message token usage against Anthropic's exact pricing ($0.003 per 1k input tokens, $0.015 per 1k output tokens), then aggregate costs per user session. Display totals in your app's Settings screen or via a /cost slash command for immediate visibility.

Can I show users their API billing without manual calculation?

Yes. Implement automatic cost calculation using exact token counts from Claude API responses and Anthropic's published pricing model. Aggregate session-level costs and persist them in frontend state to display auditable, real-time billing without user intervention.

What's the best way to implement cost tracking across multiple user sessions?

Implement per-message cost calculation immediately after each API call, storing input and output token counts. Aggregate costs per session in your state layer, then persist totals to frontend storage. This enables historical review and per-session cost comparison.

How do I prevent unexpected Claude API bills?

Provide transparency by calculating and displaying session costs to users in real time. A dedicated cost display in Settings or accessible via slash command fosters awareness and allows users to monitor spending before bills accumulate.

Does this approach work for mobile applications?

Yes. The cost-tracking model integrates into mobile app Settings screens and supports slash commands for on-demand cost lookup. Frontend state persistence and session-level aggregation work across iOS, Android, and web platforms.