Qwen Code Hook Examples
These files relate to part 17 of the tutorial.
settings-workflow.example.json— an example of connecting three hooks.pre_tool_guard.py— blocks several obviously dangerous commands before launchingBash.log_tool_result.py— writes a compact log of tool events to.qwen/hooks/logs/tool-events.jsonl.inject_sdd_context.py— adds a short reminder about project SDD files.
Copy the scripts to .qwen/hooks/, make them executable, and manually merge the settings example with your .qwen/settings.json.