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

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

How to allow Cursor to run all commands: Run Everything, allowlist and sandboxHow to allow Claude Code to run all commands: permission modes, allow rules and skip permissionsClaude Code permissions: allow, ask and deny rules, rule syntax and allowed toolsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: format on save, block risky edits, get notifiedClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): GitHub Copilot custom instructions: Adding MCP servers to GitHub Copilot: Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Customize OpenHands with skills, AGENTS.md, setup.sh and MCP: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modesCursor hooks: hooks.json, beforeShellExecution, afterFileEdit and exit codesCursor sandbox: sandbox.json, network allowlist and run modesCursor settings: settings.json, Cursor Settings and the ~/.cursor config filesCursor browser agent: @browser, browser automation and approval modesCursor subagents: .cursor/agents, frontmatter, built-in Explore and BrowserCursor telemetry and OpenTelemetry export (Privacy Mode, OTLP, Analytics API): Cursor rules setup: project, user and Team Rules, .mdc frontmatter, globs and AGENTS.mdClaude Code headless mode: claude -p, --output-format json, --bare and CI flagsClaude Code statusline: custom status bar in settings.json with context %, cost and git branchClaude Code /model: switch models, aliasesClaude Code /cost and /usage: check token spend, usage limits and reduce costsClaude Code VS Code extension: install, shortcuts, settings and /ideCodex AGENTS.md: global, project and override instruction files explainedCodex MCP servers: codex mcp add and [mcp_servers] in config.tomlCodex sandbox modes: read-only, workspace-write, danger-full-access and network accesscodex exec: run Codex non-interactively in scripts and CI with JSON outputCodex skills: create SKILL.md, skill folder locations and $skill invocationGEMINI.md in Gemini CLI: context file locations, imports and /memoryGemini CLI MCP servers: gemini mcp add and mcpServers in settings.jsonGemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CIGemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisorcopilot-setup-steps.yml: set up the GitHub Copilot cloudGitHub Copilot CLI permissions: --allow-tool, --deny-tool, --allow-all-tools and trusted directoriesGitHub Copilot custom agents: .github/agents/*.agent.md profiles, tools and frontmatterGitHub Copilot code review settings: automatic PR reviews, rulesets, effort level and approvalsOpenCode MCP Server Setup: Local and Remote Servers in opencode.jsonOpenCode Permissions: Allow, Ask or Deny Bash, Edit and WebfetchOpenCode Custom Agents and Subagents: Markdown Files, Modes and @ MentionsCline MCP Setup: cline_mcp_settings.json for Local and Remote ServersCline Auto Approve and YOLO Mode: Run Commands and Edits Without PromptsCline Skills: SKILL.md Location, Format and Slash Command UseAmp MCP Setup: amp mcp add, amp.mcpServers and Workspace ApprovalAmp AGENTS.md: File Locations, @ Mentions and Glob-Scoped GuidanceAmp Skills: SKILL.md Folders, amp skill add and Search OrderKiro MCP Setup: .kiro/settings/mcp.json, autoApprove and OAuthKiro Hooks: .kiro/hooks JSON, PreToolUse, PostFileSave and StopKiro Permissions: permissions.yaml Allow, Ask and Deny RulesFactory Droid MCP Setup: droid mcp add, mcp.json Locations and /mcpFactory Droid Hooks: hooks.json, PreToolUse Matchers and Exit CodesFactory Droid Custom Droids (Subagents): .factory/droids Markdown FilesJunie MCP Setup: .junie/mcp/mcp.json for CLI and /mcp CommandJunie Brave Mode and Action Allowlist: Auto-Approve Commands in Junie CLIJunie Custom Slash Commands: .junie/commands Markdown Files and Argumentsgoose .goosehints and AGENTS.md: Global and Project Instructionsgoose Permission Modes: GOOSE_MODE auto, approve, smart_approve and chatgoose Recipes: recipe.yaml Format, Parameters and goose run --recipeZed Agent Tool Permissions: Auto-Approve Terminal Commands with tool_permissionsUse Claude, Codex and Gemini CLI in Zed: External Agents and agent_serversZed with Ollama, LM Studio and llama.cpp: Local Model Setup and Context LengthMCP 2026-07-28 Migration Guide: Stateless Protocol, No Sessions, server/discover, MRTR, and SDK v2 UpgradeSubagents and Custom Agents Compared: Claude Code vs Codex vs Cursor vs Gemini CLI vs GitHub CopilotAllow all commands in any AI coding agent: Cursor, Claude Code, Codex, Gemini CLI, Copilot CLI and 7 moreAdd an MCP server to any AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, VS Code and 8 moreRules and instruction files in every AI coding agent: .cursor/rules, CLAUDE.md, AGENTS.md, GEMINI.md, Copilot instructions and moreGemini CLI hooks: settings.json, BeforeTool, AfterTool, exit codes and /hooksGitHub Copilot hooks: .github/hooks/*.json for Copilot CLI and the cloud agentHooks in every AI coding agent: Claude Code, Cursor, Gemini CLI, GitHub Copilot, Kiro and Factory DroidAgent Skills (SKILL.md) in every AI coding agent: Claude Code, Codex, Cline, Amp and OpenHandsHow to deploy a remote MCP server (Streamable HTTP): Cloudflare Workers, Vercel, Railway and moreHeadless mode in every AI coding agent: claude -p, codex exec, gemini -p, Cursor agent -p and copilot -p for scripts and CIClaude Code sandbox: /sandbox, sandbox.enabled, allowedDomains, excludedCommands and strict modeSandbox modes in every AI coding agent: Claude Code, Cursor, Codex and Gemini CLI compared

Reviewed Oct 18, 2026. Settings change often; the linked vendor docs are the source of truth.