Settings File Paths
Where to place your configuration file on different operating systems
# Main settings file
~/.claude/settings.json
# Alternative location
~/.claude/.config.json
# Debug logs
~/.claude/debug/
# Project-specific settings
/path/to/project/.claude/settings.json
# Custom config directory (optional)
export CLAUDE_CONFIG_DIR="/custom/path"
# Then: /custom/path/settings.json{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"CLAUDE_CODE_USE_OPENAI_COMPATIBLE": "1",
"OPENAI_COMPATIBLE_BASE_URL": "https://api.openai.com/v1",
"OPENAI_COMPATIBLE_API_KEY": "sk-your-api-key-here",
"OPENAI_COMPATIBLE_MODEL": "gpt-4o"
},
"permissions": {
"allow": [],
"deny": []
},
"apiKeyHelper": {
"enabled": false
}
}| Variable | Description | Example |
|---|---|---|
| CLAUDE_CODE_USE_OPENAI_COMPATIBLE | Enable OpenAI-compatible mode | 1 |
| OPENAI_COMPATIBLE_BASE_URL | API base URL | https://api.openai.com/v1 |
| OPENAI_COMPATIBLE_API_KEY | Your API key | sk-... |
| OPENAI_COMPATIBLE_MODEL | Model identifier | gpt-4o |
| CLAUDE_CONFIG_DIR | Custom config directory | /custom/path |
| CLAUDE_CODE_DEBUG_LOGS_DIR | Debug log directory | /path/to/logs |
| CLAUDE_CODE_SIMPLE | Enable simple/bare mode | 1 |
| CLAUDE_CODE_GIT_BASH_PATH | Git Bash path (Windows) | C:\Program Files\Git\bin\bash.exe |
Claude Code Configuration File Locations
Claude Code stores its configuration in a settings.json file. The location varies by operating system and respects platform-specific conventions.
macOS
On macOS, the configuration is stored in your home directory:
~/.claude/settings.jsonThis expands to /Users/yourusername/.claude/settings.json. Create the .claudedirectory if it doesn't exist.
Linux
Linux follows the XDG Base Directory Specification when available:
$XDG_CONFIG_HOME/claude/settings.jsonIf XDG_CONFIG_HOME is not set, it defaults to ~/.claude/settings.json.
Windows
On Windows, the configuration is stored in the AppData folder:
%APPDATA%\Claude\settings.jsonThis typically expands to C:\Users\YourUsername\AppData\Roaming\Claude\settings.json.
Creating the Configuration
Use the Configuration Generator to create your settings file, then save it to the appropriate path for your operating system.