"deepseek-v4-flash" is not a model: Claude Code does not recognize the model
Quick fix
Most related issues remain unresolved. Upgrade to CC Switch v4, enter the model's actual context window, and use [1m] only if it truly supports 1M.
Symptom
Section titled “Symptom”"deepseek-v4-flash" is not a model this version of Claude Code recognizes, so auto-compact will keep this session within 200k tokens (the context window it assumes). If the model accepts more, append [1m] to the model name for 1M, or set CLAUDE_CODE_MAX_CONTEXT_TOKENS to its real window; to make it recognized, map it in the modelOverrides setting or update Claude Code; CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1 restores the previous wait-for-the-API behavior.Claude Code 2.1.224 cannot recognize the context window of `deepseek-v4-flash`, so it plans auto-compaction using a conservative 200k window. This is an unknown-model warning and does not necessarily mean the request will fail; if the model's actual window is larger, compaction may occur prematurely.
Related tracking discussions indicate that CC Switch integration among per-model windows, environment-variable injection, and routing modes is still being implemented in stages; `[1m]` and an arbitrary numeric window are also different mechanisms. The maintainer closed the original report because the v4.0 interface and configuration-writing method had changed substantially, but did not confirm that the warning was fully resolved for all third-party models.
First upgrade to CC Switch v4 and reconfigure the provider; this was the maintainer's recommendation when closing the original report. If the warning remains after upgrading, report it again with the version and reproduction steps.
Confirm the third-party model's actual context window. Add `[1m]` to the model name only if the model truly supports 1M; do not use `[1m]` to represent windows such as 256K, 400K, 500K, or 800K.
When a numeric window is needed, set `CLAUDE_CODE_MAX_CONTEXT_TOKENS` in the Claude Code configuration. The 512000 value below is a manual configuration example from the issue, not a confirmed DeepSeek V4 window; replace it with the actual window specified by the provider.
~/.claude/settings.json {"env": {"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "512000","DISABLE_COMPACT": "1"}}If using a newer Claude Code Desktop, refer to the new configuration method reported in the thread while retaining auto-compaction. The value 262144 applies only to that user's setup and must not be treated as the DeepSeek V4 window.
~/.claude/settings.json {"env": {"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "262144","CLAUDE_CODE_MAX_CONTEXT_TOKENS": "262144","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "90"}}
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 3 real issues
- Why does enabling 1m in the settings still not show after updating?
- The reported model name is not in Claude Code's known-model list, so the client still treats it as an unknown model. The maintainer recommends upgrading to and reconfiguring CC Switch v4 first; related tracking discussions also indicate that full integration among routing, environment variables, and per-model windows is still in progress.
- Can the window be customized through `CLAUDE_CODE_MAX_CONTEXT_TOKENS`?
- Yes. The thread provides a method for manually setting it in `~/.claude/settings.json`, but the value must come from the model's actual window. Do not directly apply the 512000 or 262144 examples from other models to DeepSeek.
- Does adding `[1m]` to the model name solve every custom-window problem?
- No. The tracking discussion indicates that `[1m]` is suitable only for models that truly support that capacity and cannot represent arbitrary numeric windows. An incorrect marker may also cause the client to plan for a capacity above the upstream limit.
- Must Claude Code be restarted after modifying `settings.env`?
- Testing with Claude Code 2.1.292 in the thread shows that changing an existing `CLAUDE_CODE_MAX_CONTEXT_TOKENS` value can make a running session recalculate its window. However, deleting the key does not clear the old value already applied to the process, and shared user configuration affects multiple CLI sessions simultaneously.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.