The Claude Code Changelog
All Episodes
Fixing Context Sizing and Model Pinning for Subagents in Claude Code 2.1.325

Fixing Context Sizing and Model Pinning for Subagents in Claude Code 2.1.325

0:00|0:00

Claude Code version 2.1.325 fixes context sizing for subagents on distinct models, preventing workers with smaller context windows from receiving outputs sized for the main session. It also preserves subagent model pins across plan mode switches and includes fixes for third-party gateway context compaction, fallback plan saving, and zstd decoding.


Chapter 1

Subagent Models Finally Stay Put in 2.1.325

Lachlan Reed

This one's brought to you by Jellypod AI, and it's a fix for anyone running a cheap worker model under a big orchestrator. Version 2.1.325, released November 13th, fixes how subagents with their own model get sized.

James Turner

Right, so the changelog line is this: subagents on a different model were sizing file reads and MCP results with the main session's model. That's the bug. If your main session has a big context window and your worker doesn't, the worker got handed output cut for the bigger one and could hit the wall.

Lachlan Reed

And that connects to the two earlier episodes, the subagent effort one and the workflow subagent model one. Those gave you granular control over which model and how much thinking. But mixed setups had context sizing mismatches and model resets, and 2.1.325 is where that gets fixed.

James Turner

There's a second fix, and it's the model reset part. Subagents with their own model were being moved to the plan mode model when the model setting was opusplan or haiku. So you'd pin a worker to something light, switch to opusplan, and the worker quietly changed models. In 2.1.325, that pin holds.

Lachlan Reed

So how do you use it? Pin the worker, then run the main session on something bigger. You can set CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL in your environment, or give a subagent its own model in its definition. Then run slash model opusplan, and the worker should stay on what you picked.

James Turner

A quick check is to run a task that makes the worker read a large file or call an MCP tool with big output. Before this, that's where the mismatch would bite. Now reads and results are sized for the worker's own model. I'd test it once before trusting it on a long job, because it's a fresh fix.

Lachlan Reed

Caveats. The changelog only says the sizing now uses the subagent's model. It doesn't promise a small model will never run short on room, so still tell workers to summarize instead of dumping big payloads. Also, the same release fixes a session going back to an earlier permission mode after a subagent's plan was approved, so watch your permission mode after approvals.

James Turner

Now the smaller stuff. Fixed sessions on many third party gateways and Foundry stopping with a context length error on every turn instead of compacting. And when your organization's policy blocks a request, the error now tells you to run slash rewind and change the message, or run slash clear.

Lachlan Reed

And there's a plansDirectory fix. If you've set a custom folder in settings and it can't take an approved plan edit, the plan now gets saved in the default plans folder, with a warning saying where and why. No more lost plan. There's also a security fix for how zstd compressed responses are decoded, plus a note for Claude when a sandboxed git checkout or stash can't update protected files like the ones in dot claude.

James Turner

Update, re-test your mixed model setup, and check that your pinned workers stay pinned.