Claude Code should warn before executing high-cost external API calls
Problem
Claude Code executed 100K+ Google Maps Places API calls in a single session without estimating the cost or asking for confirmation. This resulted in ~$600 in API charges with no warning.
Context
User asked Claude Code to collect diaspora community data (restaurants, groceries, cultural centers, banks, nonprofits, colleges) across dozens of US metros and 30+ ethnicities. Claude Code proceeded to make bulk Google Maps Places API calls without:
- Estimating the projected cost (e.g., "this will be ~100K API calls at $0.003-0.032 each, potentially $300-600")
- Asking for explicit approval before proceeding
- Suggesting scoping strategies (sample first, fewer metros, prioritize categories)
Expected behavior
Claude Code already warns before destructive operations (git reset --hard, rm -rf, etc.). The same pattern should apply to expensive operations — specifically bulk calls to paid external APIs. Before executing, Claude Code should:
- Estimate the number of API calls and projected cost
- Present the estimate to the user
- Get explicit confirmation before proceeding
- Suggest ways to reduce scope if the cost is high
Impact
$600 in irreversible API charges in a single session. The user had no opportunity to scope down or approve the spend.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗