Skip to main content

Settings & Preferences

1 min read

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

Bash

Via Settings File

Settings are stored in ~/.claude/settings.json:

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 |

Bash

Safety Settings

Control how Claude handles file modifications:

Bash

Output Formatting

Customize how responses are displayed:

Bash

Context Settings

Configure how Claude handles context:

Bash

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

Bash

Configuration Profiles

Create different configurations for different contexts:

Work Profile

JSON

Personal Profile

JSON

Switching Profiles

Bash

Project-Level Settings

Override global settings per project with .claude/config.json:

JSON

Advanced Configuration

Custom System Prompts

Add persistent instructions:

Bash

File Ignore Patterns

Prevent Claude from reading certain files:

JSON

Token Limits

Configure token usage:

JSON

Troubleshooting

Settings Not Applying

  1. Check file permissions: ls -la ~/.claude/settings.json
  2. Validate JSON syntax: cat ~/.claude/settings.json | jq .
  3. Restart Claude Code after changes

Environment Variables Not Working

Bash

Reset All Settings

Bash

Recommended Settings

For Development

JSON

For Code Review

JSON

For Learning

JSON

Next Steps

Generated with AI using Claude AI by Anthropic

Model: Claude Opus 4.5 · Generated: 2025-12-20 · Build: v1.21.0-75762dc

Edit this page on GitHub··

Discussion

0/2000

Comments are reviewed before being published