Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

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.

…
Ultracite’s rules
Where Qwen Code looks for instructions
  1. 1~/.qwen/QWEN.mdYour instructions for every project.
  2. 2QWEN.md, root to working folderEach one from the project root (the folder with .git) down to where you started.
  3. 3~/.qwen/AGENTS.mdYour cross-tool instructions, after all the QWEN.md files.
  4. 4AGENTS.md, root to working folderUltraciteThe same walk from the project root down, after every QWEN.md.
  5. 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.md and AGENTS.md both load. Every QWEN.md comes first, then every AGENTS.md.
Your own list
context.fileName replaces the default pair, so keep AGENTS.md in it if you set it.
Subfolders
Qwen walks up from where you start, not down, so a deeper folder’s AGENTS.md loads only when you start there.
Imports
@path/to/file in a context file pulls that file in, resolved from the file it’s in.
/init
/init writes QWEN.md, the first name on the list, and suggests additions if it exists.
Check it
/memory shows 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 *)"]
  }
}
  1. 01Qwen edits a file with its edit or write_file tool.
  2. 02Following AGENTS.md, it runs npx ultracite fix or npx ultracite check with run_shell_command.
  3. 03The allow rule matches any shell command that starts with npx ultracite, so it runs without a prompt.
  4. 04Qwen reads the output and fixes what fix couldn’t.

Worth knowing about Qwen Code

  • /review reads one section of AGENTS.md

    /review takes project rules from .qwen/review-rules.md, the Copilot instructions file, and only the ## Code Review section of AGENTS.md or QWEN.md. Ultracite’s rules have no such section, so add one, or a review-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_DIR in the environment, and stderr sent to the model on exit 2. Matchers accept Claude Code’s tool names, so Write|Edit copied from a Claude Code config works unchanged.

  • YOLO isn’t a sandbox

    --yolo only approves tool calls; shell commands still run with your permissions. Sandboxing is a separate opt-in (--sandbox, QWEN_SANDBOX or tools.sandbox), and .qwen/sandbox.Dockerfile extends 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 skill init installs. Type /ultracite to load it yourself.

Qwen Code questions, answered

Does Qwen Code read AGENTS.md?
Yes, by default. Qwen Code looks for QWEN.md and AGENTS.md in ~/.qwen/ and in every folder from the project root to where you start it, and loads all of them, QWEN.md files first.
Should I move my QWEN.md into AGENTS.md?
Keep both if you like; Qwen loads both. Qwen-only notes fit in QWEN.md and shared rules, Ultracite’s included, in AGENTS.md. If you ever set context.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. PostToolUse hooks in .qwen/settings.json run 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.md tell it to run npx ultracite fix and npx ultracite check. Add Bash(npx ultracite *) to permissions.allow so it can run them without a confirmation each time.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.