Sometimes I want Claude Code to behave differently for one session only, without editing a settings file and remembering to change it back.
The --settings flag takes a path to a JSON file or an inline JSON string. The settings docs give this example to start one session on another model without touching your default:
claude --settings '{"model": "claude-opus-5-5"}'
The command line sits above every settings file except managed settings. Keys you leave out keep the values from your files, and nothing is written to disk, so the next session starts as usual.
A file works the same way:
claude --settings ./review-session.json
The reference says the file must be a regular file of at most 2 MiB. That makes a few named setups easy to keep around, each in its own file.
Lists mostly merge with the ones from your files instead of replacing them. A permissions.allow in the flag adds rules to the existing ones, so it cannot remove a rule you already allowed. Managed settings still win over everything, so a key your organization controls will not change. For a few keys there is a dedicated flag that is shorter: --model overrides both the file and the environment variable ANTHROPIC_MODEL for a session.
Further reading: Claude Code CLI reference