qwen-code: Instructions file for Codex

AGENTS.md

qwen-code AGENTS.md is an instructions file for Codex, OpenCode from QwenLM/qwen-code. It costs 4,344 tokens per session, scanned A, original, Apache-2.0.

A repository guide describing how contributors should build and change Qwen Code. It covers simplicity rules, commands, and which core parts of the project require maintainer review.

In plain words
What is it for?
Use it when planning or implementing changes, choosing build and test commands, or deciding whether a change needs maintainer approval.
Why use it?
It helps contributors avoid unnecessary complexity and prevents outside changes from bypassing review rules for important shared code.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is QwenLM/qwen-code's own configuration. It tells Codex and OpenCode how to work on qwen-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything qwen-code configures →

About the project

Qwen Code is an open-source AI coding agent that runs in a terminal and helps developers work with code through language models. It supports multiple model providers and can also be used through IDEs, desktop software, SDKs, and messaging bots.

QwenLM/qwen-code · 29,032 stars · on GitHub · qwenlm.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to QwenLM/qwen-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/QwenLM/qwen-code/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/QwenLM/qwen-code

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for qwen-code AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/qwenlm/qwen-code/agents-md/github.svg)](https://agentmods.dev/instructions/qwenlm/qwen-code/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/qwenlm/qwen-code/agents-md"><img src="https://agentmods.dev/badge/instructions/qwenlm/qwen-code/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for qwen-code AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/qwenlm/qwen-code/agents-md"><img src="https://agentmods.dev/badge/instructions/qwenlm/qwen-code/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,344 This file is loaded in full into every session.
When invoked 4,344 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04344 $0.04344
Opus 5.5 $0.01738 $0.01738
Sonnet 5.5 $0.00869 $0.00869
Haiku 4.5 $0.00434 $0.00434

Measured 16d ago against content hash e69084e39585, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

qwen-code AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 369 lines

How it starts

The opening of the file, as written. The whole thing — 369 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Working Principles

Simplicity First

Minimum code that solves the problem. Nothing speculative. (This is the principle we care about most.)

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

Core Infrastructure Is Maintainer-Only (triage gate, two-tier rule)

Core modules — packages/core/src/**, packages/*/src/auth/**, packages/*/src/providers/**, packages/*/src/models/**, packages/*/src/config/**, packages/*/src/tools/**, packages/*/src/services/**, cross-package changes — are the architectural backbone. External PRs touching them face a two-tier gate (maintainer-authored PRs are exempt):

  1. Large-scope refactor changes (500+ production logic lines in core, excluding test and generated/schema files) → hard block. Skip evaluation entirely — the maintainer exemption above is the sole exception. Large-scale core refactors must be maintainer-initiated. When counting lines, exclude files matching *.test.ts, *.test.tsx, *.spec.ts, *.spec.tsx, __tests__/**, *.schema.ts, *.schema.json, *.generated.ts, and **/generated/** — only production logic counts. feat-type and other non-refactor PRs are NOT hard-blocked on size; they escalate to the maintainer for awareness instead. A non-blocking advisory also applies at 1000+ production logic lines. Breadth alone is not size — a low-risk sweep that touches 10+ files but changes a line or two each is escalated to a maintainer for awareness and otherwise judged under Tier 2's 100%-confidence bar, not auto-rejected on file count.
  2. Small-scope changes → gate may evaluate, but must be 100% confident. Any doubt at all → escalate to maintainer. "The direction looks correct" is not confidence. The gate must name every downstream consumer; if it cannot, escalate.

Read the full file on GitHub · 369 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed · -2 tokens per session e69084e39585
  2. 21d ago Changed · -6 tokens per session f5f637cd75f1
  3. 22d ago Changed · +18 lines · +244 tokens per session b0c616ae9b67
  4. 1mo ago Changed · -1 lines · +5 tokens per session 77c655dcc198
  5. 1mo ago Changed · +3 lines · +49 tokens per session debc7d0aec42
  6. 1mo ago Changed · +1 lines · +103 tokens per session 0ff7902ee1a3
  7. 1mo ago Changed · +3 lines · +59 tokens per session 75f5eb14a7ba
  8. 1mo ago Changed · +8 lines · +121 tokens per session 6a8d6c80e9fc
  9. 1mo ago Changed · +10 lines · +154 tokens per session b6270113c6e2
  10. 2mo ago First seen · 327 lines · 3,617 tokens per session scan A c3a7b9451f6f

Subscribe to this mod's changes

qwen-code AGENTS.md is an instructions file published in the GitHub repository QwenLM/qwen-code (29,032 stars, last pushed yesterday), licensed Apache-2.0. It adds 4,344 tokens to every session, about $0.0174 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

qwen-code AGENTS.md compared with instructions from other repositories

qwen-code AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
qwen-code AGENTS.mdQwenLM/qwen-codeInstructions file29kyesterdayApache-2.0A4,344Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode