Default location: ~/.cc-switch/
Customizable location in settings (for cloud sync).
~/.cc-switch/
├── cc-switch.db # SQLite database
├── settings.json # Device-level settings
└── backups/ # Automatic backups
├── backup-20251230-120000.json
├── backup-20251229-180000.json
└── ...
cc-switch.db is a SQLite database that stores:
| Table | Contents |
|---|---|
| providers | Provider configurations |
| provider_endpoints | Provider endpoint candidate list |
| mcp_servers | MCP server configurations |
| prompts | Prompt presets |
| skills | Skill installation status |
| skill_repos | Skill repository configurations |
| proxy_config | Proxy configuration |
| proxy_request_logs | Proxy request logs |
| provider_health | Provider health status |
| model_pricing | Model pricing |
| settings | App settings |
settings.json stores device-level settings:
{
"language": "zh",
"theme": "system",
"windowBehavior": "minimize",
"autoStart": false,
"claudeConfigDir": null,
"codexConfigDir": null,
"geminiConfigDir": null,
"opencodeConfigDir": null,
"openclawConfigDir": null
}These settings are not synced across devices.
The backups/ directory stores automatic backups:
- Automatically created before each configuration import
- Retains the most recent 10 backups
- File names include timestamps
Default: ~/.claude/
~/.claude/
├── settings.json # Main configuration file
├── CLAUDE.md # System prompt
└── skills/ # Skills directory
└── ...
{
"env": {
"ANTHROPIC_API_KEY": "sk-xxx",
"ANTHROPIC_BASE_URL": "https://api.anthropic.com"
},
"permissions": {
"allow_file_access": true
}
}| Field | Description |
|---|---|
env.ANTHROPIC_API_KEY |
API key |
env.ANTHROPIC_BASE_URL |
API endpoint (optional) |
env.ANTHROPIC_AUTH_TOKEN |
Alternative authentication method |
MCP server configuration is in ~/.claude.json:
{
"mcpServers": {
"mcp-fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}Default: ~/.codex/
~/.codex/
├── auth.json # Authentication configuration
├── config.toml # Main configuration + MCP
└── AGENTS.md # System prompt
{
"OPENAI_API_KEY": "sk-xxx"
}# Basic configuration
base_url = "https://api.openai.com/v1"
model = "gpt-4"
# MCP servers
[mcp_servers.mcp-fetch]
command = "uvx"
args = ["mcp-server-fetch"]Default: ~/.gemini/
~/.gemini/
├── .env # Environment variables (API Key)
├── settings.json # Main configuration + MCP
└── GEMINI.md # System prompt
GEMINI_API_KEY=xxx
GOOGLE_GEMINI_BASE_URL=https://generativelanguage.googleapis.com
GEMINI_MODEL=gemini-pro{
"mcpServers": {
"mcp-fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
}
}
}| Field | Description |
|---|---|
mcpServers |
MCP server configuration |
Default: ~/.opencode/
~/.opencode/
├── config.json # Main configuration file
├── AGENTS.md # System prompt
└── skills/ # Skills directory
└── ...
Default: ~/.openclaw/
~/.openclaw/
├── openclaw.json # Main configuration file (JSON5 format)
├── AGENTS.md # System prompt
└── skills/ # Skills directory
└── ...
OpenClaw uses a JSON5 format configuration file with the following main sections:
{
// Model provider configuration
models: {
mode: "merge",
providers: {
"custom-provider": {
baseUrl: "https://api.example.com/v1",
apiKey: "your-api-key",
api: "openai-completions",
models: [{ id: "model-id", name: "Model Name" }]
}
}
},
// Environment variables
env: {
ANTHROPIC_API_KEY: "sk-..."
},
// Agent default model configuration
agents: {
defaults: {
model: {
primary: "provider/model"
}
}
},
// Tool configuration
tools: {},
// Workspace file configuration
workspace: {}
}| Field | Description |
|---|---|
models.providers |
Provider configuration (mapped to CC Switch's "providers") |
env |
Environment variable configuration |
agents.defaults |
Agent default model settings |
tools |
Tool configuration |
workspace |
Workspace file management |
CC Switch's priority when modifying configurations:
- CC Switch Database - Single source of truth (SSOT)
- Live Configuration Files - Written when switching providers
- Backfill Mechanism - Reads from live files when editing the current provider
- CLI tool configuration files (will be backfilled by CC Switch)
- CC Switch's
settings.json
cc-switch.dbdatabase file- Backup files
If you manually edit CLI tool configurations:
- Open CC Switch
- Edit the corresponding provider
- You will see the manual changes have been backfilled
- Save to sync to the database
CC Switch v3.7.0 migrated from JSON files to SQLite:
- Automatic migration on first launch
- Displays a notification upon successful migration
- Old configuration files are retained as backups
- Export configuration on the source device
- Import configuration on the target device
- Or use the cloud sync feature
It is recommended to regularly export configurations:
- Settings > Advanced > Data Management
- Click "Export"
- Save to a secure location
The export file includes:
- All provider configurations
- MCP server configurations
- Prompt presets
- App settings
- Usage logs (large data volume)
- Device-level settings (not suitable for cross-device)