anthropics / anthropics/claude-code
[BUG] CLAUDE_CODE_SUBAGENT_MODEL Inheritance Issue
- Vorherrschende Sprache
- Python
- Sterne
- 145k
- Forks
- 23.1k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
When the main session is configured to a local model via ANTHROPIC_API_KEY routing, CLAUDE_CODE_SUBAGENT_MODEL set to the local model name, claude-code-guide/named subagents still fail with claude-haiku-4-5-20251001 not found, while subagent_type: "fork" correctly inherits the local model
### What Should Happen?
The subagent should inherit the model the main session is using. The parameter is set for inheritance but it still defaults to Haiku
### Error Messages/Logs
```shell
Agent "Claude Code hooks guide" failed: Agent terminated early due to an API error: There's an issue with the selected model
(claude-haiku-4-5-20251001). It may not exist or you may not have access to it. Run /model to pick a different model. (error type
model_not_found, HTTP 404, model sent to the API: claude-haiku-4-5-20251001)
```
### Steps to Reproduce
Issue a prompt that will call a subagent while the model is set to a local model. The subagent will fail saying it has an API Error with the selected model (Claude-haiku-4-5-20251001.
### Claude Model
Other
### Is this a regression?
I don't know
### Last Working Version
_No response_
### Claude Code Version
2.1.263
### Platform
Anthropic API
### Operating System
macOS
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
_No response_
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by reproducing the failure with a local model, CLAUDE_CODE_SUBAGENT_MODEL, and a named subagent, then compare it with subagent_type: "fork", which reportedly inherits correctly. Trace where the main-session model is selected for each subagent path; done means named subagents use the configured model instead of defaulting to claude-haiku-4-5-20251001.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- ai, api, cli
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100