Use claude config to Set Default Preferences Across All Your Sessions
If you find yourself typing --model opus or other flags every time you start Claude Code, set them as defaults instead. The claude config command lets you save preferences so they apply automatically.
# Set your preferred model as the default
claude config set preferredModel opus
# See all your current settings
claude config list
# Get a specific setting's value
claude config get preferredModel
Settings are scoped at different levels — user settings apply everywhere, project settings apply only to a specific repo:
# User-level: applies to all projects (your personal defaults)
claude config set --global preferredModel sonnet
# Project-level: applies only to this repo (shared via .claude/settings.json)
claude config set --project preferredModel opus
Project-level settings live in .claude/settings.json and can be committed to version control — so your whole team gets the same defaults without each person configuring manually.
You can also manage permission settings to reduce how often Claude asks for approval:
# See what tools are currently allowed
claude config list
# Allow specific commands to run without prompting
claude config set allowedTools "Bash(npm run test),Bash(npm run lint)"
A few settings worth configuring early:
- preferredModel — set your go-to model so you don't pass
--modelevery time - allowedTools — pre-approve safe commands you run constantly (test runners, linters)
- theme — set your preferred color theme for the terminal UI
Check what's available with claude config list and the documentation — new settings get added with updates.
Configure once, benefit forever — claude config turns your most-used flags into automatic defaults.
via Claude Code
Log in to leave a comment.
When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.
Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.
Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.