hook-config

hook-config is a skill for Claude Code from QwenLM/qwen-code. It costs 35 tokens per session (5,347 once invoked), scanned A, original, Apache-2.0.

A guide for creating hooks: automatic actions triggered by events such as tool use, file changes, notifications, or session start and end. Hooks are configured in settings files.

In plain words
What is it for?
Use it to format, lint, or test after tool use; block risky operations; detect secrets; send notifications; or add validation gates.
Why use it?
It helps you add repeatable checks, protections, notifications, and session actions without remembering to run them yourself.

Skill for Claude Code ✓ vendor

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Good fit Use it to format, lint, or test after tool use; block risky operations; detect secrets; send notifications; or add validation gates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qwenlm/qwen-code/hook-config
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 · 31,040 stars · on GitHub · qwenlm.github.io

Install

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.

Any agent
npx skills add QwenLM/qwen-code --skill hook-config
Clone the repo
git clone --depth 1 https://github.com/QwenLM/qwen-code

Made for: Claude Code.

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 hook-config

README.md
[![agentmods](https://agentmods.dev/badge/skills/qwenlm/qwen-code/hook-config/github.svg)](https://agentmods.dev/skills/qwenlm/qwen-code/hook-config)
Your own site
<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.

agentmods 80×15 button for hook-config

Your own site · 80×15
<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>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,347 The whole file, excluding the scripts and references it only reads on demand.
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.00035 $0.05347
Opus 5.5 $0.00014 $0.02139
Sonnet 5.5 $0.00007 $0.01069
Haiku 4.5 $0.00003 $0.00535

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

Security

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.

packages/harness/core/src/skills/builtin/hook-config/SKILL.md · 596 lines

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

Read the full file on GitHub · 596 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. 4d ago First seen · 596 lines · 35 tokens per session scan A 63209af31c47

Subscribe to this mod's changes

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.

Related

hook-config compared with skills from other repositories

hook-config next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hook-configQwenLM/qwen-codeSkill31ktodayApache-2.0A35Claude Code
sls-dashboard-builderalibaba/loongsuite-pilotSkill2703d agoApache-2.0A72Claude Code, Codex
agentloop-audit-dashboardalibaba/loongsuite-pilotSkill2703d agoApache-2.0A149Claude Code, Codex
loongsuite-pilot-opsalibaba/loongsuite-pilotSkill2703d agoApache-2.0A15Claude Code, Codex
agentloop-audit-queryalibaba/loongsuite-pilotSkill2703d agoApache-2.0A54Claude Code, Codex
novel-workshopMerkyorLynn/LynnSkill7317d agoApache-2.0A90Claude Code
proactive-agentMerkyorLynn/LynnSkill7317d agoApache-2.0A46Claude Code, Codex