Guide
Settings file locations for every AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, Amp and Factory Droid (2026)
Where is the settings file for each AI coding agent, and which file wins when the same key is set twice?
Claude Code uses ~/.claude/settings.json plus .claude/settings.json and .claude/settings.local.json in the project. Codex uses ~/.codex/config.toml plus .codex/config.toml in trusted projects. Gemini CLI and Qwen Code use ~/.gemini/settings.json and ~/.qwen/settings.json with a .gemini or .qwen folder per project. OpenCode uses ~/.config/opencode/opencode.json and opencode.json, Amp uses ~/.config/amp/settings.json and .amp/settings.json, and Factory Droid uses ~/.factory/settings.json. Cursor keeps AI settings in the Cursor Settings panel and agent files such as permissions.json in ~/.cursor and .cursor. In every tool the project file overrides the user file.
Also in: 简体中文 · 日本語 · 한국어 · Español · Português (Brasil)
Coding agent settings change often
Get one email a week when a setting, flag or permission rule changes, checked against the vendor docs.
Quick answer: user and project settings files
- Claude Code: ~/.claude/settings.json (user), .claude/settings.json (shared project), .claude/settings.local.json (just you, one project). Change common options with /config.
- Cursor: Cursor Settings panel (Ctrl/Cmd + Shift + J) for AI features, the VS Code style settings.json for editor keys, and agent files in ~/.cursor and .cursor: mcp.json, permissions.json, hooks.json, sandbox.json. The Cursor CLI uses ~/.cursor/cli-config.json.
- OpenAI Codex: ~/.codex/config.toml (user) and .codex/config.toml in the repo, loaded only when you trust the project.
- Gemini CLI: ~/.gemini/settings.json (user) and .gemini/settings.json in the project root.
- Qwen Code: ~/.qwen/settings.json (user) and .qwen/settings.json in the project root.
- OpenCode: ~/.config/opencode/opencode.json (global) and opencode.json in the project root. JSONC works too.
- Amp: ~/.config/amp/settings.json (user) and the nearest .amp/settings.json (workspace). Every key starts with amp.
- Factory Droid: ~/.factory/settings.json, edited with the /settings command. A settings.local.json next to it merges on top.
Which file wins
- Claude Code, highest first: managed settings, command line arguments, .claude/settings.local.json, .claude/settings.json, ~/.claude/settings.json. List keys such as permissions.allow merge across files.
- Codex, highest first: CLI flags and -c overrides, project .codex/config.toml files (closest to your directory wins), a --profile file, ~/.codex/config.toml, then system and built-in defaults.
- Gemini CLI and Qwen Code: the project file overrides the user file, and a system settings file overrides both. Environment variables and command line arguments override every file.
- OpenCode: files are merged, not replaced. Later sources override earlier ones only for conflicting keys, and the project config loads after the global one.
- Amp: workspace settings override user settings.
- Cursor permissions.json: the user and project files are combined, and their arrays are concatenated.
- Factory Droid: settings.local.json merges on top of settings.json at the same level.
Same idea, different syntax
Claude Code: .claude/settings.json
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": ["Bash(npm run test *)"],
"deny": ["Read(./.env)"]
}
}Codex: ~/.codex/config.toml
model_reasoning_effort = "medium" approval_policy = "on-request" sandbox_mode = "workspace-write"
Gemini CLI: .gemini/settings.json
{
"general": {
"defaultApprovalMode": "auto_edit"
},
"tools": {
"sandbox": "docker"
}
}OpenCode: opencode.json
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"edit": "ask",
"bash": { "*": "ask", "git *": "allow" }
}
}Cursor: .cursor/permissions.json
{
"terminalAllowlist": ["git", "npm", "pnpm"],
"mcpAllowlist": ["github:*"]
}Gotchas
- Claude Code settings files are strict JSON. A comment or trailing comma is a syntax error.
- A project .codex/config.toml cannot set provider, auth, notification, profile or telemetry keys. Put those in ~/.codex/config.toml.
- Gemini CLI settings must sit inside their category object, such as general, ui, model or tools. YOLO mode cannot be set in the file, only with --yolo or --approval-mode=yolo.
- Commit shared files (.claude/settings.json, .cursor/permissions.json, opencode.json) and keep personal ones out of git (.claude/settings.local.json, Droid's settings.local.json).
Full settings guide for each agent
- Claude Code settings.json: locations, precedence and key settings
- Cursor settings and the ~/.cursor config files
- Codex config.toml: precedence, profiles and MCP
- Gemini CLI settings.json: locations and structure
- Qwen Code settings.json, providers and approval modes
- OpenCode opencode.json: precedence, models and permissions
- Amp settings.json and AGENTS.md
- Factory Droid settings.json, autonomy and custom droids
- Compare: add an MCP server in every AI coding agent
- Compare: allow all commands in every AI coding agent
Get coding agent settings changes by email
When a setting, flag or permission rule in this guide changes, it goes in the weekly AgentAtlas update, checked against the vendor docs. One email a week.
Sources
Other guides
Reviewed Oct 18, 2026. Settings change often; the linked vendor docs are the source of truth.