fix(claude): pin Explore/Plan subagents off the inherited Opus model - #172
Merged
Conversation
Since v2.1.198 the built-in Explore and Plan subagents inherit the main
conversation's model instead of running on Haiku. On the Anthropic API that
inheritance is capped at Opus, but on Bedrock no cap applies, so exploration
and plan research ran on Opus 5 whenever the session did.
The existing CLAUDE.md rule ("always set model explicitly") cannot fix this:
Explore and Plan are the only subagents that skip CLAUDE.md entirely, so the
instruction never reaches them. Measured in a live session — an Explore call
with no model parameter ran on claude-opus-5, while search-specialist (which
has model: haiku in its frontmatter) correctly ran on claude-haiku-4-5.
Add same-named user subagent definitions, which override the built-ins and
keep their own model field, and record in CLAUDE.md why the rule above needs
this backstop.
Also drop ANTHROPIC_DEFAULT_SONNET_MODEL from the settings base template: a
us.anthropic.* ID is Bedrock-only and the base is shared with subscribe
accounts. Both the sonnet and the new haiku pin now live in the machine-local
overlay, so the effective value is unchanged.
edge2992
added a commit
that referenced
this pull request
Aug 6, 2026
The `haiku` / `sonnet` aliases in the Explore and Plan override definitions added in #172 had no effect. Verified on Bedrock with a marker in the description: the override files load (the custom description reaches the agent) but the bare alias in `model:` is silently ignored, and both agents still ran on claude-opus-5. Version-form IDs resolve correctly — measured claude-haiku-4-5-20251001 for Explore and claude-sonnet-5 for Plan. This form is provider-neutral, so it stays valid on subscribe accounts too, unlike a us.anthropic.* ID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
問題
「subagent を作ると親の model (Opus) を引き継いでしまう」という症状を実測で切り分けた。
同一セッションでサブエージェントを3体投げ、
~/.claude/projects/<proj>/<session>/subagents/agent-*.jsonlの.message.modelを確認:Explore+model: "haiku"明示claude-haiku-4-5search-specialist(frontmattermodel: haiku)claude-haiku-4-5Explore(model 未指定)claude-opus-5frontmatter も Agent の
modelパラメータも正常に機能していた。壊れていたのは組み込みExplore/Planのみ。原因
modelフィールドが有効になる。変更
dot_claude/agents/Explore.mdを追加(model: haiku、read-only tools)dot_claude/agents/Plan.mdを追加(model: sonnet、read-only tools)dot_claude/CLAUDE.md: Explore / Plan には CLAUDE.md ルールが届かず、上記定義が backstop であることを明記(将来これらを消さないための理由付け).chezmoitemplates/claude-settings-base.json:ANTHROPIC_DEFAULT_SONNET_MODELを削除。us.anthropic.*は Bedrock 専用IDで、base は subscribe 契約のマシンと共有されるため。sonnet / haiku 両方の pin は machine-local な overlay (~/.config/claude-overlay/overlay.jsonnet) に移した(env+マージなので実効値は不変)CLAUDE_CODE_SUBAGENT_MODELは採用しなかった。frontmatter とmodelパラメータの両方を上書きするため、code-reviewerや実装エージェントまで一律に安いモデルへ落ちてしまう。検証
make lint全項目 pass(JSON / rendered template / merge-patch / Brewfile overlay)chezmoi diff --sourceの semantic diff で意図した差分のみを確認:env.ANTHROPIC_DEFAULT_HAIKU_MODELの追加のみ(modelとeffortLevelの2件は本 PR と無関係な既存のライブドリフト)model未指定のExploreがclaude-haiku-4-5-*、Planがclaude-sonnet-5になることをトランスクリプトで実測確認する