Qwen Code loads AGENTS.md beside QWEN.md
Qwen Code loads AGENTS.md by default, after any QWEN.md, from the project root down to the folder you start in. Ultracite doesn’t set up a hook for it yet, so after an edit Qwen runs ultracite fix and check because the rules tell it to.
Qwen Code by Alibaba CloudChecked against Qwen Code 0.25.0
# Ultracite Code Standards
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
## Quick Reference
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`
Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
…- 1
~/.qwen/QWEN.mdYour instructions for every project. - 2
QWEN.md, root to working folderEach one from the project root (the folder with.git) down to where you started. - 3
~/.qwen/AGENTS.mdYour cross-tool instructions, after all theQWEN.mdfiles. - 4
AGENTS.md, root to working folderUltraciteThe same walk from the project root down, after everyQWEN.md. - 5
.qwen/QWEN.local.mdYour personal notes for this project, loaded last so they can override the rest. Keep it out of git.
How Qwen Code reads the rules
Qwen Code looks for two names, QWEN.md and then AGENTS.md, in your home folder and in every directory from the project root to where you started. It joins everything it finds into the system prompt, each file labeled with its path.
- Both names
QWEN.mdandAGENTS.mdboth load. EveryQWEN.mdcomes first, then everyAGENTS.md.- Your own list
context.fileNamereplaces the default pair, so keepAGENTS.mdin it if you set it.- Subfolders
- Qwen walks up from where you start, not down, so a deeper folder’s
AGENTS.mdloads only when you start there. - Imports
@path/to/filein a context file pulls that file in, resolved from the file it’s in.- /init
/initwritesQWEN.md, the first name on the list, and suggests additions if it exists.- Check it
/memoryshows which files loaded, and the footer counts the context files in use.
Let Qwen run Ultracite without asking
Qwen Code has PostToolUse hooks, but Ultracite doesn’t configure one for it yet. Until then the commands in AGENTS.md are the check, and a permissions.allow rule lets Qwen run them without stopping to ask.
{
"permissions": {
"allow": ["Bash(npx ultracite *)"]
}
}- 01Qwen edits a file with its
editorwrite_filetool. - 02Following
AGENTS.md, it runsnpx ultracite fixornpx ultracite checkwithrun_shell_command. - 03The
allowrule matches any shell command that starts withnpx ultracite, so it runs without a prompt. - 04Qwen reads the output and fixes what
fixcouldn’t.
Worth knowing about Qwen Code
/review reads one section of AGENTS.md
/reviewtakes project rules from.qwen/review-rules.md, the Copilot instructions file, and only the## Code Reviewsection ofAGENTS.mdorQWEN.md. Ultracite’s rules have no such section, so add one, or areview-rules.md, if reviews should check against them.Hooks in Claude Code’s format
Qwen Code’s hooks take Claude Code’s shape: the same event names,
CLAUDE_PROJECT_DIRin the environment, and stderr sent to the model on exit 2. Matchers accept Claude Code’s tool names, soWrite|Editcopied from a Claude Code config works unchanged.YOLO isn’t a sandbox
--yoloonly approves tool calls; shell commands still run with your permissions. Sandboxing is a separate opt-in (--sandbox,QWEN_SANDBOXortools.sandbox), and.qwen/sandbox.Dockerfileextends the default Docker image for your project.The Ultracite skill
Qwen Code loads skills from
.qwen/skills/and.agents/skills/at the project root, and the same folders in your home directory, so it finds the Ultracite skillinitinstalls. Type/ultraciteto load it yourself.
Qwen Code questions, answered
- Does Qwen Code read AGENTS.md?
- Yes, by default. Qwen Code looks for
QWEN.mdandAGENTS.mdin~/.qwen/and in every folder from the project root to where you start it, and loads all of them,QWEN.mdfiles first. - Should I move my QWEN.md into AGENTS.md?
- Keep both if you like; Qwen loads both. Qwen-only notes fit in
QWEN.mdand shared rules, Ultracite’s included, inAGENTS.md. If you ever setcontext.fileName, list both names, because it replaces the default pair. - Does Qwen Code read AGENTS.md files in subfolders?
- Only on the way up. Qwen loads the ones between the project root and the folder you start in; one deeper than that loads only when you start Qwen in its folder.
- Does Qwen Code support hooks?
- Yes.
PostToolUsehooks in.qwen/settings.jsonrun after a tool succeeds, and a hook that exits with code 2 passes its stderr to the model. Project hooks load only in a trusted folder. Ultracite doesn’t write one for Qwen Code yet. - How do I make Qwen Code run the linter?
- The rules in
AGENTS.mdtell it to runnpx ultracite fixandnpx ultracite check. AddBash(npx ultracite *)topermissions.allowso it can run them without a confirmation each time.
Keep going
- AgentGemini CLIGoogle’s open-source terminal agent for Gemini models, now for paid API and enterprise users.
- AgentKimi Code CLIMoonshot AI’s terminal agent that edits code and runs shell commands.
- AgentMistral VibeMistral AI’s open-source terminal coding agent, also usable in editors over ACP.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.