[BUG] `context: fork` and subagents appear to use a different (lighter) model despite model configuration

Resolved 💬 5 comments Opened Apr 13, 2026 by 2atbas Closed Jun 1, 2026

Preflight Checklist

  • [x] I have searched existing issues 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 a skill uses context: fork or delegates to a subagent, output quality degrades dramatically compared to running the identical prompt in the main session. The degradation pattern — repetitive self-correction loops where the model cannot resolve simple Dutch vocabulary questions — is consistent with a smaller model (Haiku-level), not with Opus 4.6.

All model configuration points to claude-opus-4-6: the model frontmatter field, CLAUDE_CODE_SUBAGENT_MODEL, and the main session. Self-reporting and JSONL transcripts also log claude-opus-4-6. But the behavior doesn't match.

The issue was isolated by testing three variants of the same skill with the same prompt and input:

| Variant | Config | Result |
|---|---|---|
| Skill without fork | No context: fork, no agent: | Correct. Clean output, 18 well-structured observations, no loops. |
| Skill with context: fork | context: fork, no agent: | Degraded. Repetitive self-correction spirals, multiple restarts. |
| Skill delegating to subagent | context: fork + agent: schrijf-redacteur | Degraded. Identical loop behavior. |

The only variable that causes degradation is context: fork. The agent delegation is not the factor.

Example of degraded behavior (abbreviated): the model tries to flag the Dutch word "gegevens" as incorrect, then produces the same word repeatedly while trying to state the correction, unable to break the loop. It restarts its full analysis 3-4 times within a single response. The same prompt without fork resolves this cleanly on the first attempt.

What Should Happen?

A skill with context: fork should use the model specified in configuration (frontmatter model field, CLAUDE_CODE_SUBAGENT_MODEL, or main session model). Output quality should be consistent with that model's capabilities.

Error Messages/Logs

No error messages. The JSONL transcript for the subagent logs `"model": "claude-opus-4-6"` for every assistant message, but the behavior contradicts this.

Steps to Reproduce

  1. Set environment variable: $env:CLAUDE_CODE_SUBAGENT_MODEL = "claude-opus-4-6"
  2. Start Claude Code in Opus 4.6 mode (confirm with /model)
  3. Create a skill file .claude/skills/schrijf-redactie-nofork/SKILL.md:
---
name: schrijf-redactie-nofork
description: Review text without fork.
disable-model-invocation: true
---
 
Review de volgende tekst en lever redactiecommentaar als genummerde lijst.
Tekst: $ARGUMENTS
  1. Create an identical skill with fork .claude/skills/schrijf-redactie-fork/SKILL.md:
---
name: schrijf-redactie-fork
description: Review text with fork.
disable-model-invocation: true
context: fork
---
 
Review de volgende tekst en lever redactiecommentaar als genummerde lijst.
Tekst: $ARGUMENTS
  1. Provide a Dutch-language document (any multi-page text with some grammar issues works)
  2. Run both: /schrijf-redactie-nofork @"document.md" and /schrijf-redactie-fork @"document.md"
  3. Compare output quality. The fork variant produces self-correction loops and repeated restarts; the non-fork variant produces clean output.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

N/A

Claude Code Version

2.1.104

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • CLAUDE_CODE_SUBAGENT_MODEL=claude-opus-4-6 was confirmed set in the same PowerShell session
  • The subagent transcript (JSONL in ~/.claude/projects/{project}/{session}/subagents/) logs claude-opus-4-6 for all assistant messages — but this likely reflects the requested model, not necessarily the model that actually served the request
  • The degradation is reproducible: tested 4 times with fork, each time producing the same loop pattern; tested without fork, each time producing clean output
  • Related issues: #25546 (CLAUDE_CODE_SUBAGENT_MODEL doesn't override built-in agents), #10993 (unclear interaction between env var and model field)

View original on GitHub ↗

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