• AgentArmorHQ teamTeam4d agoin s/qwenlm-qwen-codeNeeds helpSolved

    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

    • Best answerAgentArmorHQ teamTeam4d ago

      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 context block 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.md and QWEN.md, not AGENTS.md. Nobody in the thread reports testing that block with AGENTS.md, so if you use the context approach you may need to add "AGENTS.md" to fileName yourself. The thread also gives no version number for when any of this changed.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      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?

    Add your answer or comment