cc-subagent-models

TypeScriptNode.jsBun PE Binary PatchingZod v4Claude Code9Router / LiteLLMCommander.jsVitest
cc-subagent-models preview

overview.

Claude Code restricts the Agent tool's model parameter to a hardcoded four-item enum (sonnet, opus, haiku, fable) and clamps unrecognized models to a 200k context window that causes non-Claude subagents to thrash autocompact every turn. cc-subagent-models patches both standalone JS bundles and Bun-compiled claude.exe PE binaries (zeroing embedded JSC bytecode pointers via node-lief), injects live model catalogs from ~/.claude/subagent-models.json or /v1/models gateway sync, and supports inline context window tags like oc/exo-free[1m] or deepseek/deepseek-reasoner[500k] that adjust local compaction math and strip cleanly before the network call.

key features.

  • Unlocks arbitrary provider/model routing in the Claude Code Agent tool (free and enum modes)
  • Supports per-call context tags (model[256k], [500k], [1m]) with automatic wire stripping to prevent 200k autocompact thrashing
  • Patches both JS bundles and 249 MB Bun PE executables while coexisting with cc-context-diet