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.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add QwenLM/qwen-code --skill hook-configgit clone --depth 1 https://github.com/QwenLM/qwen-codeWrote 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.
[](https://agentmods.dev/skills/qwenlm/qwen-code/hook-config)<a href="https://agentmods.dev/skills/qwenlm/qwen-code/hook-config"><img src="https://agentmods.dev/badge/skills/qwenlm/qwen-code/hook-config/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.
<a href="https://agentmods.dev/skills/qwenlm/qwen-code/hook-config"><img src="https://agentmods.dev/badge/skills/qwenlm/qwen-code/hook-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.05347 |
| Opus 5.5 | $0.00014 | $0.02139 |
| Sonnet 5.5 | $0.00007 | $0.01069 |
| Haiku 4.5 | $0.00003 | $0.00535 |
Grade A, and why
hook-config 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 596 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Creating Hooks for Qwen Code
This skill guides you through creating hooks — automated behaviors that trigger on specific events like tool execution, session lifecycle, file changes, and notifications. Hooks are configured in settings.json files.
When to Use Hooks
Use hooks when you need:
- Automated side effects after tool execution (format, lint, test)
- Guardrails before tool execution (block protected files, detect secrets)
- Notifications when events occur (desktop alerts, webhooks)
- Validation gates that block or allow operations based on conditions
- Session automation at start, end, or compaction
When NOT to use hooks:
- One-off tasks (just do them directly)
- Complex multi-step workflows (use agents or skills instead)
- Anything that needs user interaction mid-execution
Configuration Scopes
| Scope | File | Use Case |
|---|---|---|
| Project | ${QWEN_CONFIG_DIR}/settings.json |
Team-shared, version controlled |
| Local | ${QWEN_CONFIG_DIR}/settings.local.json |
Personal, not committed |
| User | ~/${QWEN_USER_CONFIG_DIR}/settings.json |
Global across all projects |
Choose project for team guardrails and standards. Choose local for personal preferences and notifications. Choose user for global behaviors across all projects.
Configuration Format
{
"hooks": {
"<EventName>": [
{
"matcher": "<regex>",
"hooks": [
{
"type": "command",
"command": "${QWEN_CONFIG_DIR}/hooks/my-hook.sh",
"name": "my-hook",
"timeout": 60
}
]
}
]
}
}
Each event maps to an array of hook definitions. Each definition has:
| Field | Required | Description |
|---|---|---|
matcher |
No | Regex filter (matches tool name for tool events) |
hooks |
Yes | Array of hook handlers |
sequential |
No | Run hooks in order instead of parallel |
async |
No | Fire-and-forget, don't block the operation |
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.
- 4d ago First seen · 596 lines · 35 tokens per session scan A 63209af31c47
hook-config is a skill published in the GitHub repository QwenLM/qwen-code (31,040 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 5,347 once invoked, about $0.0001 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-11-26.
hook-config compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| hook-configQwenLM/qwen-code | Skill | 31k | today | Apache-2.0 | A | 35 | Claude Code |
| sls-dashboard-builderalibaba/loongsuite-pilot | Skill | 270 | 3d ago | Apache-2.0 | A | 72 | Claude Code, Codex |
| agentloop-audit-dashboardalibaba/loongsuite-pilot | Skill | 270 | 3d ago | Apache-2.0 | A | 149 | Claude Code, Codex |
| loongsuite-pilot-opsalibaba/loongsuite-pilot | Skill | 270 | 3d ago | Apache-2.0 | A | 15 | Claude Code, Codex |
| agentloop-audit-queryalibaba/loongsuite-pilot | Skill | 270 | 3d ago | Apache-2.0 | A | 54 | Claude Code, Codex |
| novel-workshopMerkyorLynn/Lynn | Skill | 73 | 17d ago | Apache-2.0 | A | 90 | Claude Code |
| proactive-agentMerkyorLynn/Lynn | Skill | 73 | 17d ago | Apache-2.0 | A | 46 | Claude Code, Codex |