brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: claude --settings overrides settings for one session with inline JSON

Claude
~/tips/tip-claude-code-settings-inline-json

claude --settings '{"model": "claude-opus-5-5"}'

Overrides Claude Code settings for a single session with a JSON file or an inline JSON string.

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

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link