Skip to main content

Usage Tracking

Prompt: “What’s my AI API usage today?”What it does: Returns total costs, API calls, and token usage for today, broken down by provider and model.
Prompt: “Compare my usage this week vs last week”What it does: Shows usage summaries for both periods so you can spot trends.
Prompt: “Which provider am I spending the most on?”What it does: Returns costs grouped by provider (OpenAI, Anthropic, etc.)
Prompt: “Show me costs broken down by project tag”What it does: Groups usage by the project metadata tag to see per-project spending.

Savings Analysis

Prompt: “Am I saving money with Claude Max?”What it does: Compares your usage against retail pricing to show if your flat-rate subscription is worth it.
Prompt: “Show my savings vs retail this month”What it does: Shows total retail cost, subscription cost, and net savings for the current month.
Prompt: “Which models am I using the most under my subscription?”What it does: Shows per-model usage and what that would cost at retail rates.

Monitoring & Alerts

Prompt: “Are there any cost anomalies I should know about?”What it does: Analyzes recent usage patterns and flags any unusual spikes or changes.
Prompt: “Do I have any unread alerts?”What it does: Lists recent alerts including budget warnings and cost spike notifications.
Prompt: “Create a Slack webhook for budget alerts at https://hooks.slack.com/services/…”What it does: Creates a new webhook that sends notifications to your Slack channel.

Pricing Lookups

Prompt: “What’s the current pricing for GPT-4o?”What it does: Returns input/output pricing per million tokens and context window size.
Prompt: “Compare Anthropic and OpenAI pricing”What it does: Shows pricing for all models from both providers for comparison.

Claude Code & Codex Sync

Prompt: “Sync my Claude Code usage”What it does: Parses local ~/.claude/projects files and uploads usage metadata (tokens, models, timestamps) to your CostHawk dashboard.
Prompt: “Preview my Claude Code sync with dryRun enabled”What it does: Shows exactly what data would be sent without making any network requests. Great for transparency.
Prompt: “List my Codex sessions first, then sync Codex usage for the last 30 days”What it does: Verifies local discovery with costhawk_list_codex_sessions, then uploads metadata with costhawk_sync_codex_usage maxAgeHours=720.
Prompt: “Sync all my local AI usage data”What it does: Syncs both Claude Code and Codex CLI usage in one operation.

Privacy & Transparency

Run in terminal:
npm exec --yes costhawk@latest -- --what-we-read
What it does: Lists all file paths the MCP server would access, without making network requests.
Run in terminal:
npm exec --yes costhawk@latest -- --self-test
What it does: Confirms hasApiKey, autoSyncEnabled, codexAutoSyncEnabled, and local directory detection (local.codexDir, local.claudeCodeDir).
Prompt: “Show me what would be sent if I sync my usage, but don’t actually send it”What it does: Uses dryRun: true to return the full payload that would be uploaded, so you can verify nothing sensitive is included.

Combining Tools

You can ask complex questions that use multiple tools:
“I’m spending more than usual this week. Can you check for anomalies and show me which project is driving the increase?”
Claude will:
  1. Run anomaly detection
  2. Get usage by project tag
  3. Analyze and explain the results
“Sync my Claude Code usage, then show me my total spending this month including the new data”
Claude will:
  1. Sync local Claude Code data
  2. Fetch updated usage summary
  3. Present a comprehensive monthly report

The MCP server returns data in markdown format by default, making it easy for Claude to present nicely formatted tables and summaries.
Privacy note: All sync operations only send usage metadata (tokens, models, timestamps). Your code, prompts, and file paths are never transmitted.