settings.json files that control behavior, UI preferences, model settings, and more.
Configuration Files
Qwen Code supports multiple settings files with different scopes:Settings Priority
Settings are merged with the following precedence (later values override earlier ones):- System Defaults
- User Settings (
~/.qwen/settings.json) - Workspace Settings (
.qwen/settings.json) - System Settings (as overrides)
File Format
Settings files are JSON files with optional comments (using// or /* */):
Top-Level Configuration
Model Providers
object
required
Model providers configuration grouped by authentication type. Each auth type contains an array of model configurations.See Model Providers for detailed configuration.
Environment Variables
object
Fallback environment variables (e.g., API keys). Lower priority than shell Security Note: Never commit API keys to version control. Consider using
export and .env files..env files instead.MCP Servers
object
Configuration for Model Context Protocol (MCP) servers.
Model Settings
string
The default model to use when Qwen Code starts.
number
default:"-1"
Maximum number of user/model/tool turns to keep in a session.
-1 means unlimited.number
The maximum number of tokens allowed in a session before automatic compression or truncation.
boolean
default:"false"
Avoid sending the workspace startup context at the beginning of each session. Useful for large projects.
object
Generation configuration settings for API requests.
number
Request timeout in milliseconds.
number
Maximum number of retries for failed requests.
boolean
default:"true"
Enable cache control for DashScope providers.
number
Overrides the default context window size for the selected model. Use when a provider’s effective context limit differs from Qwen Code’s default.
General Settings
boolean
default:"false"
Enable Vim keybindings in the terminal UI.
boolean
default:"true"
Enable automatic update checks and installations on startup.
boolean
default:"true"
Automatically add a Co-authored-by trailer to git commit messages when commits are made through Qwen Code.
string
default:"auto"
The language for the user interface. Use
"auto" to detect from system settings.Options: "auto", "en", "zh", "ja", "de", "fr", "ru", "pt-BR"string
default:"auto"
The language for LLM output. Use
"auto" to detect from system settings, or set a specific language.boolean
default:"true"
Enable saving chat history to disk. Disabling this will prevent
--continue and --resume from working.string
default:"utf-8"
Default encoding for new files.Options:
"utf-8" (without BOM), "utf-8-bom" (with BOM)UI Settings
string
default:"Qwen Dark"
The color theme for the UI.
boolean
default:"false"
Hide helpful tips in the UI.
boolean
default:"true"
Show line numbers in code output.
boolean
default:"true"
Show welcome back dialog when returning to a project with conversation history.
boolean
default:"true"
Enable loading phrases (disable for accessibility).
boolean
Render output in plain-text to be more screen reader accessible.
Security Settings
string
The protocol to use on startup.Options:
"openai", "anthropic", "gemini", "vertex-ai", "qwen-oauth"string
API key for OpenAI compatible authentication (only used when
selectedType is "openai").string
Base URL for OpenAI compatible API.
boolean
default:"false"
Enable folder trust security feature. See Trusted Folders.
Context Settings
array
Additional directories to include in the workspace context. Missing directories will be skipped with a warning.
boolean
default:"true"
Respect
.gitignore files when searching.boolean
default:"true"
Respect
.qwenignore files when searching. See .qwenignore.boolean
default:"true"
Enable fuzzy search when searching for files.
Tools Settings
string
default:"default"
Approval mode for tool usage. Controls how tools are approved before execution.Options:
"plan": Show execution plan only, don’t execute"default": Prompt for approval before execution"auto-edit": Auto-approve edit tools, prompt for others"yolo": Auto-approve all tools
array
A list of tool names that will bypass the confirmation dialog.
array
Tool names to exclude from discovery.
boolean
default:"true"
Use node-pty for an interactive shell experience. Falls back to child_process if PTY is unavailable.
boolean
default:"true"
Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.
boolean
default:"true"
Use the bundled ripgrep binary. When set to false, the system-level
rg command will be used instead.MCP Settings
array
A list of MCP servers to allow.
array
A list of MCP servers to exclude.
Privacy Settings
boolean
default:"true"
Enable collection of usage statistics.
Advanced Settings
array
Environment variables to exclude from project context. Default:
["DEBUG", "DEBUG_MODE"]object
Configuration for web search providers.
Complete Example
Migration
Qwen Code automatically migrates settings files from older versions. The$version field tracks the schema version.
Current version: 3
