Settings & Preferences
Configure Claude Code settings for your optimal workflow
title: Settings & Preferences description: Configure Claude Code settings for your optimal workflow
Claude Code provides various settings to customize its behavior. These range from model selection to safety preferences and output formatting.
Accessing Settings
Via Command Line
Via Settings File
Settings are stored in ~/.claude/settings.json:
Available Settings
Model Selection
Choose which Claude model to use:
| Model | Best For |
|-------|----------|
| claude-opus-4-5-20251101 | Complex reasoning, research |
| claude-sonnet-4-20250514 | Balanced performance (default) |
| claude-haiku-3-5-20241022 | Fast, simple tasks |
Safety Settings
Control how Claude handles file modifications:
Output Formatting
Customize how responses are displayed:
Context Settings
Configure how Claude handles context:
Environment Variables
Override settings via environment variables:
| Variable | Description | Example |
|----------|-------------|---------|
| ANTHROPIC_API_KEY | API authentication | sk-ant-... |
| CLAUDE_MODEL | Override default model | claude-opus-4-5-20251101 |
| CLAUDE_CONFIG_DIR | Custom config location | ~/.config/claude |
| CLAUDE_MAX_TOKENS | Response length limit | 8192 |
| NO_COLOR | Disable colored output | 1 |
Setting Environment Variables
Configuration Profiles
Create different configurations for different contexts:
Work Profile
Personal Profile
Switching Profiles
Project-Level Settings
Override global settings per project with .claude/config.json:
Advanced Configuration
Custom System Prompts
Add persistent instructions:
File Ignore Patterns
Prevent Claude from reading certain files:
Token Limits
Configure token usage:
Troubleshooting
Settings Not Applying
- Check file permissions:
ls -la ~/.claude/settings.json - Validate JSON syntax:
cat ~/.claude/settings.json | jq . - Restart Claude Code after changes