{"name":"--model","slug":"model","family":"cli","title":"CLI flags","noun":"CLI flag","description":"Sets the model for the current session with a [model alias](\/docs\/en\/model-config#model-aliases) such as `sonnet`, `opus`, `haiku`, or `fable`, or a model's full name. Overrides the [`model`](\/docs\/en\/settings-reference#model) setting and [`ANTHROPIC_MODEL`](\/docs\/en\/model-config#environment-variables)","description_source":"docs","described_by":{"doc":"claude-code\/cli-reference","title":"CLI reference"},"presence":{"first_seen":"2.1.138","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":149,"mined_builds":149,"first_cited":{"version":"2.1.228","released_at":"2026-08-11 17:45:45","spans":3}},"aliases":[],"entries":[{"version":"2.1.302","anchor":"allow-other-models-claude-code-allow-other-models-added","heading":"Signed client data now stops startup when it has no entry for your model","line":"With `--client-data-url`, Claude Code now exits if the document has no entry for your model, unless `--allow-other-models` is set","released_at":"2026-10-16 16:48:28","reason":"found in this entry's text"},{"version":"2.1.295","anchor":"sdk-spawns-cli-with-flagvalue-form-and-guards-values-st","heading":"Agent SDK passes options so values starting with a dash are not misread","line":"The Agent SDK now passes many options as `--flag=value`, so a value starting with a dash is no longer mistaken for another flag","released_at":"2026-10-08 18:22:58","reason":"found in this entry's text, named in this entry"},{"version":"2.1.284","anchor":"model-help-no-longer-names-claude-fable-5-as-the-example","heading":"--model help text no longer gives an example full model name","line":"The help text for `--model` now ends with \"or a model's full name.\" and no longer shows an example full model name","released_at":"2026-09-28 17:11:59","reason":"found in this entry's text, named in this entry"},{"version":"2.1.274","anchor":"model-switch-suggestion-text-now-considers-config-sources-be","heading":"Model-switch suggestion text now considers config sources beyond gateway","line":"Model-unavailable suggestions now weigh more context before recommending \/model or --model","released_at":"2026-09-16 22:36:09","reason":"named in this entry, found in this entry's text"},{"version":"2.1.236","anchor":"anthropic-default-model-sets-the-model-when-nothing-else-doe","heading":"ANTHROPIC_DEFAULT_MODEL sets the model when nothing else does","line":"Set ANTHROPIC_DEFAULT_MODEL and it becomes your model whenever no flag or ANTHROPIC_MODEL applies.","released_at":"2026-08-19 18:45:14","reason":"named in this entry, found in this entry's text"},{"version":"2.1.234","anchor":"command-line-values-that-look-like-flags-or-urls-are-quoted-","heading":"Command-line values that look like flags or URLs are quoted safely","line":"Values that start with a dash or look like URLs are now passed safely as --flag=value.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"},{"version":"2.1.234","anchor":"early-flag-scan-no-longer-mistakes-tool-lists-and-directorie","heading":"Early flag scan no longer mistakes tool lists and directories for flags","line":"Tool lists and directories passed to flags are no longer misread as flags themselves at startup.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"},{"version":"2.1.234","anchor":"spawned-processes-get-flag-value-when-the-value-looks-like-a","heading":"Spawned processes get --flag=value when the value looks like a flag","line":"Prompts and model names starting with a dash are no longer swallowed as options by subagents and background tasks.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"},{"version":"2.1.228","anchor":"relaunching-claude-code-keeps-your-selected-model","heading":"Relaunching Claude Code keeps your selected model","line":"Restarting after an update keeps the model you picked instead of reverting to the default.","released_at":"2026-08-11 17:45:45","reason":"named in this entry, found in this entry's text"},{"version":"2.1.228","anchor":"model-selection-forwarded-on-restart-in-place","heading":"Model selection forwarded on restart-in-place","line":"Your selected model is passed along whenever Claude Code re-executes itself.","released_at":"2026-08-11 17:45:45","reason":"named in this entry, found in this entry's text"}],"entries_total":14,"docs":[{"source":"claude-code","path":"cli-reference","title":"CLI reference","documented":true},{"source":"api","path":"agents-and-tools\/tool-use\/bash-tool","title":"bash-tool","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/code-execution-tool","title":"code-execution-tool","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/overview","title":"overview","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/text-editor-tool","title":"text-editor-tool","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/web-fetch-tool","title":"web-fetch-tool","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/web-search-tool","title":"web-search-tool","documented":false},{"source":"api","path":"api\/beta-headers","title":"beta-headers","documented":false},{"source":"api","path":"api\/errors","title":"errors","documented":false},{"source":"api","path":"build-with-claude\/citations","title":"citations","documented":false}],"docs_total":13,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/cli\/model","family_url":"https:\/\/changelogs.core-directive.com\/reference\/cli.json"}