Does Qwen Code load AGENTS.md and how do I configure it?
Qwen Code does not load AGENTS.md automatically, so agent instructions in that file are ignored unless you configure it manually. What settings.json value works, and what did the maintainers recommend? I'm using the Qwen Code CLI on the dev machine where my project has an AGENTS.md file.
Originally asked on GitHub: https://github.com/QwenLM/qwen-code/issues/504
3 answers
Status: the issue was closed as completed by a maintainer in November 2025, but the thread does not state that AGENTS.md is auto-detected by default. The reporter's request was for native default support; the maintainer instead provided configuration options.
The reporter confirmed that the Gemini CLI-style setting works in Qwen Code's settings.json:
json"contextFileName": "AGENTS.md"An earlier authentication problem had prevented them from testing it, but after that was resolved the setting worked.
Later, a maintainer recommended the following
contextblock in settings.json and pointed to https://qwenlm.github.io/qwen-code-docs/en/cli/configuration/#example-settingsjson (opens external site):json"context": { "fileName": ["CONTEXT.md", "QWEN.md"], "includeDirectories": ["path/to/dir1", "~/path/to/dir2", "../path/to/dir3"], "loadFromIncludeDirectories": true, "fileFiltering": { "respectGitIgnore": false } }Note that the maintainer's example lists
CONTEXT.mdandQWEN.md, notAGENTS.md. Nobody in the thread reports testing that block with AGENTS.md, so if you use thecontextapproach you may need to add"AGENTS.md"tofileNameyourself. The thread also gives no version number for when any of this changed.Did this work for you?What a GitHub user tried on GitHub (Worked)
The reporter set "contextFileName": "AGENTS.md" in settings.json and confirmed it works in Qwen Code once an earlier authentication issue was resolved.
Source: https://github.com/QwenLM/qwen-code/issues/504 (opens external site)
Did this work for you?What @pomelo-nwu tried on GitHub (Outcome unclear)
A maintainer suggested configuring the "context" block with fileName, includeDirectories, loadFromIncludeDirectories, and fileFiltering, then closed the issue. The example lists CONTEXT.md and QWEN.md, and no one in the thread reports testing it with AGENTS.md.
Source: https://github.com/QwenLM/qwen-code/issues/504#issuecomment-3501379835 (opens external site)
Did this work for you?
Related questions
- Why did qwen-code burn millions of tokens and push my Alibaba Cloud account into debt?
- Qwen Code shows far fewer tokens than Bailian bills — how do I stop charges and get a refund?
- qwen-code with OpenRouter: force a provider and fix OpenAI connection error?
- How do I enable Agentic Coding Protocol (ACP) support for qwen-code in Zed?
- Ollama qwen3-coder fails with "does not support tools" in qwen-code agent mode