High cost incurred due to automatic task execution before model switch

Resolved 💬 3 comments Opened Nov 25, 2025 by dapeipeipeipei Closed Jan 19, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

I asked Claude Code to switch to a cheaper model (from Opus 4.5 to Sonnet 4.5), but before the switch completed,
the system automatically executed an expensive "Explore" task using Opus 4.5, resulting in unexpected high costs.

Steps to Reproduce:

  1. Start Claude Code (default model: claude-opus-4-5)
  2. User asks a simple question:(Do you understand my project?)
  3. User immediately requests to switch to a cheaper model
  4. Before user can execute /model command, Claude automatically launches an Explore subagent using Opus
  5. The Explore task consumes 6.3M cache read tokens on Opus 4.5

Expected Behavior:

  • Claude should wait for user confirmation before executing expensive operations
  • Or at minimum, should not auto-launch large tasks when user has expressed intent to switch to cheaper model

Actual Behavior:

  • Automatic Explore task executed on Opus 4.5
  • Cost: $6.26 for a task user did not explicitly request

Cost Output:
Total cost: $6.49
Usage by model:
claude-haiku: 30.5k input, 13.1k output, 588.0k cache read, 57.2k cache write ($0.2261)
claude-opus-4-5: 107 input, 21.4k output, 6.3m cache read, 414.4k cache write ($6.26)

Suggested Fix:

  • Add confirmation prompt before launching expensive subagent tasks
  • Respect user's intent to switch models before executing new tasks
  • Consider cost warnings when about to execute high-token operations

What Claude Actually Did

  1. User started conversation and asked a simple question: (Do you understand my project?)
  2. Claude (running on Opus 4.5) responded that it was using Opus 4.5 model
  3. User immediately said: (Switch to a cheaper model)
  4. Claude provided instructions for switching models
  5. User asked: (Recommend a model for my project)
  6. Claude recommended Sonnet 4.5
  7. User said: (Switch me to Sonnet 4.5)
  8. User executed /model command and switched to Sonnet
  9. User then asked to investigate why activities API was returning empty
  10. At this point, Claude launched an Explore subagent - but the /cost output shows 6.3M cache read tokens were

charged to Opus 4.5, suggesting significant Opus usage occurred during the conversation before/during model switch

  1. Total Opus cost: $6.26 for what should have been a simple conversation about switching models

Expected Behavior

  1. When user expresses intent to switch to a cheaper model ("换一个便宜点的模型"), Claude should NOT initiate any

expensive operations

  1. Claude should wait for user to complete the model switch before executing any large tasks
  2. If Claude needs to perform an expensive operation (like Explore with millions of tokens), it should:
  • Warn the user about potential cost
  • Ask for confirmation before proceeding
  1. Subagent tasks should respect the current model setting and not unexpectedly use expensive models

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

_No response_

Claude Model

Opus

Relevant Conversation

1. Start Claude Code with default Opus model (or any expensive model)
  claude
  2. Ask a simple question like: "Do you understand my project?"
  3. Immediately say: "Switch to a cheaper model" (before Claude responds or while it's responding)
  4. Claude will respond using Opus AND may automatically launch an Explore subagent on Opus before user can execute
   /model command
  5. Run /cost to see unexpected high charges on the expensive model

  ---
  Minimal Reproduction:

  User: Do you understand my project?
  User: Switch to a cheaper model please
  # Before user can run /model, Claude already executes expensive operations on Opus

Impact

High - Significant unwanted changes

Claude Code Version

2.0.52

Platform

Anthropic API

Additional Context

Patterns Noticed:

  • The issue occurs when Claude automatically decides to launch subagent tasks (like "Explore") without explicit

user request

  • Expensive model (Opus 4.5) was used for cache operations even after user expressed intent to switch models
  • 6.3M cache read tokens on Opus resulted in $6.26 charge for a simple conversation about switching models

Cost Breakdown:
Total cost: $6.49
Usage by model:
claude-haiku: 30.5k input, 13.1k output, 588.0k cache read, 57.2k cache write ($0.2261)
claude-opus-4-5: 107 input, 21.4k output, 6.3m cache read, 414.4k cache write ($6.26)

Project Structure:

  • React frontend project (citygetaway_frontend)
  • Standard structure with src/, components/, contexts/, etc.
  • Nothing unusual that should trigger excessive token usage

User Intent Timeline:

  1. User asked simple question → Opus responded
  2. User immediately requested cheaper model → Opus still processing
  3. User switched to Sonnet via /model → But Opus charges already incurred
  4. Total Opus cost: $6.26 for ~2 minutes of interaction

Suggested Improvements:

  1. Add cost estimation warning before launching Explore/subagent tasks
  2. Queue expensive operations until model switch is complete if user requests it
  3. Add a --budget-limit flag to prevent unexpected charges
  4. Show real-time cost indicator during operations

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗