settings.json files that control behavior, UI preferences, model settings, and more.
Configuration Files
Qwen Code supports multiple settings files with different scopes:| File | Scope | Description |
|---|---|---|
~/.qwen/settings.json | User (global) | Applies to all your Qwen Code sessions. Recommended for modelProviders and env. |
.qwen/settings.json | Project | Applies only when running Qwen Code in this project. Overrides user settings. |
| System settings | System | Administrator-level settings (platform-specific paths) |
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
Model providers configuration grouped by authentication type. Each auth type contains an array of model configurations.See Model Providers for detailed configuration.
Environment Variables
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
Configuration for Model Context Protocol (MCP) servers.
Model Settings
The default model to use when Qwen Code starts.
Maximum number of user/model/tool turns to keep in a session.
-1 means unlimited.The maximum number of tokens allowed in a session before automatic compression or truncation.
Avoid sending the workspace startup context at the beginning of each session. Useful for large projects.
Generation configuration settings for API requests.
Request timeout in milliseconds.
Maximum number of retries for failed requests.
Enable cache control for DashScope providers.
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
Enable Vim keybindings in the terminal UI.
Enable automatic update checks and installations on startup.
Automatically add a Co-authored-by trailer to git commit messages when commits are made through Qwen Code.
The language for the user interface. Use
"auto" to detect from system settings.Options: "auto", "en", "zh", "ja", "de", "fr", "ru", "pt-BR"The language for LLM output. Use
"auto" to detect from system settings, or set a specific language.Enable saving chat history to disk. Disabling this will prevent
--continue and --resume from working.Default encoding for new files.Options:
"utf-8" (without BOM), "utf-8-bom" (with BOM)UI Settings
The color theme for the UI.
Hide helpful tips in the UI.
Show line numbers in code output.
Show welcome back dialog when returning to a project with conversation history.
Enable loading phrases (disable for accessibility).
Render output in plain-text to be more screen reader accessible.
Security Settings
The protocol to use on startup.Options:
"openai", "anthropic", "gemini", "vertex-ai", "qwen-oauth"API key for OpenAI compatible authentication (only used when
selectedType is "openai").Base URL for OpenAI compatible API.
Enable folder trust security feature. See Trusted Folders.
Context Settings
Additional directories to include in the workspace context. Missing directories will be skipped with a warning.
Respect
.gitignore files when searching.Respect
.qwenignore files when searching. See .qwenignore.Enable fuzzy search when searching for files.
Tools Settings
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
A list of tool names that will bypass the confirmation dialog.
Tool names to exclude from discovery.
Use node-pty for an interactive shell experience. Falls back to child_process if PTY is unavailable.
Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance.
Use the bundled ripgrep binary. When set to false, the system-level
rg command will be used instead.MCP Settings
A list of MCP servers to allow.
A list of MCP servers to exclude.
Privacy Settings
Enable collection of usage statistics.
Advanced Settings
Environment variables to exclude from project context. Default:
["DEBUG", "DEBUG_MODE"]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
