Bug: Agent tool model parameter overrides user's default model setting without consent

Resolved 💬 3 comments Opened Mar 28, 2026 by fajarkraton Closed Apr 1, 2026

Summary

When a user sets their default model to Claude Opus 4.6 via /model command, the AI assistant can still override this by passing model: "sonnet" or model: "haiku" parameters in Agent tool calls. This delegates work to cheaper/weaker models without the user's knowledge or permission.

Context

My project's CLAUDE.md explicitly states: "Model: Claude Opus 4.6 exclusively". I also set the default model via /model to Opus 4.6. Despite this, the assistant launched multiple subagents with model: "sonnet" and model: "haiku" throughout the session, affecting the quality of code written for my project.

Steps to Reproduce

  1. Set default model to Opus 4.6 via /model
  2. Add Model: Claude Opus 4.6 exclusively to CLAUDE.md
  3. Ask the assistant to perform a complex task
  4. Observe that it launches Agent subprocesses with model: "sonnet" or model: "haiku" parameters

Expected Behavior

  • Agent subprocesses should inherit the user's selected model by default
  • The assistant should NOT be able to override to a different model without explicit user approval
  • If the user's CLAUDE.md specifies a model restriction, that should be enforced system-wide

Actual Behavior

  • Assistant freely passes model: "sonnet" and model: "haiku" to Agent tool calls
  • This bypasses the user's model preference silently
  • User has no visibility into which model is actually doing the work

Impact

  • Trust broken: User cannot verify if any prior work was done with the correct model
  • Time wasted: All work done with wrong models must be re-audited
  • Quality risk: Weaker models may produce lower-quality code that passes tests but has subtle issues

Suggested Fix

  1. When user sets a default model, Agent tool should ignore the model parameter or warn if it differs
  2. Alternatively, add a setting to lock the model so it cannot be overridden by the assistant
  3. Show which model is being used in each Agent tool call output so users can verify

Environment

  • Claude Code CLI on Linux (Ubuntu)
  • Model: Claude Opus 4.6 (1M context)
  • Default set via /model command

View original on GitHub ↗

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