Skip to content

Where Qwen Code stores QWEN.md, skills, agents, and MCP servers

Qwen Code is a fork of Gemini CLI, and its file layout shows it: a global ~/.qwen/ folder mirroring ~/.gemini/, per-project .qwen/ folders, and a QWEN.md context file where Gemini reads GEMINI.md. It tracks its upstream closely but has diverged in a few places worth knowing. ~ is your home directory; paths starting with .qwen/ are relative to a project root.

ArtifactGlobalPer-projectFormat
Context / rules~/.qwen/QWEN.mdQWEN.md (project root, parents, and subdirectories)Markdown
Skills~/.qwen/skills/<name>/SKILL.md.qwen/skills/<name>/SKILL.mdMarkdown + YAML frontmatter
Subagents~/.qwen/agents/*.md.qwen/agents/*.mdMarkdown + YAML frontmatter
Commands~/.qwen/commands/**/*.md.qwen/commands/**/*.mdMarkdown (TOML deprecated)
MCP servers~/.qwen/settings.jsonmcpServers.qwen/settings.jsonmcpServersJSON
Settings~/.qwen/settings.json.qwen/settings.jsonJSON
Extensions~/.qwen/extensions/<name>/qwen-extension.jsonJSON manifest + bundled dirs

Qwen Code searches for QWEN.md from the current working directory up through each parent until it hits the project root (the first .git folder) or your home directory, plus the global ~/.qwen/QWEN.md for instructions that apply to every project. Everything found is concatenated — with separators naming each file’s origin — into the system prompt. Context files can import other Markdown files with @path/to/file.md, so a large QWEN.md can be split into modules.

Same SKILL.md-folder convention as Claude Code and Cursor: a directory per skill under ~/.qwen/skills/ (personal) or .qwen/skills/ (committed with the repo). Frontmatter requires name and description; Qwen adds optional extras — priority (sort order in /skills), paths (the skill stays invisible until a matching file is touched), and flags to hide a skill from either the user or the model.

Subagent definitions are Markdown files with YAML frontmatter in ~/.qwen/agents/ (all projects) or .qwen/agents/ (one project) — project agents win on name collisions. The /agents create wizard writes these files for you; they’re plain Markdown underneath, so they index and convert like any other agent file.

Each Markdown file under a commands/ directory becomes a slash command, with subdirectories as namespaces (commands/git/commit.md/git:commit) and {{args}} for parameter injection.

Settings merge across four levels — system defaults, user (~/.qwen/settings.json), project (.qwen/settings.json), and a system-override file (/etc/qwen-code/settings.json on Linux, C:\ProgramData\qwen-code\settings.json on Windows). MCP servers live in the same file, as a top-level mcpServers map: command/args/env for stdio servers, url or httpUrl plus headers for remote ones. The env and headers values are where API keys end up — treat both settings files as secret-adjacent.

Installed extensions live under ~/.qwen/extensions/<name>/, each with a qwen-extension.json manifest that can bundle MCP servers, a commands/ directory, skills/, agents/, and its own context file. Like Claude Code’s plugin cache, these bundled artifacts behave exactly like your own but live where no one looks.

Quartermaster’s scanner indexes every location on this page — QWEN.md files, skills, agents, commands, and one record per MCP server parsed out of settings.json — into one searchable registry alongside Claude Code, Cursor, Codex, and 8 more tools. Secrets are never indexed — env/header key names kept, values dropped — and conversion can move a skill or MCP config between Qwen Code and any of them. See the full discovery map or the quickstart.