Files
SuperCharged-Claude-Code-Up…/skills/hooks/QWEN-HOOK-README.md
admin b723e2bd7d Reorganize: Move all skills to skills/ folder
- Created skills/ directory
- Moved 272 skills to skills/ subfolder
- Kept agents/ at root level
- Kept installation scripts and docs at root level

Repository structure:
- skills/           - All 272 skills from skills.sh
- agents/           - Agent definitions
- *.sh, *.ps1       - Installation scripts
- README.md, etc.   - Documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 18:05:17 +00:00

2.2 KiB

Qwen Consultation Hook for Claude Code

Allows Claude Code to consult with the local Qwen installation (/usr/local/bin/qwen) for assistance with tasks.

Files Created

  • /home/uroma/.claude/hooks/qwen-consult.sh - Main hook script
  • /home/uroma/.claude/hooks/hooks.json - Updated with Qwen hook
  • /home/uroma/.claude/hooks.json - Updated with Qwen hook

Configuration

The hook behavior is controlled via environment variables:

Variable Default Description
QWEN_CONSULT_MODE off When to consult Qwen: off, delegate, or always
QWEN_MODEL (default) Optional: specify Qwen model to use
QWEN_MAX_ITERATIONS 30 Max iterations for Qwen execution

Usage Modes

1. Off Mode (Default)

export QWEN_CONSULT_MODE=off

Qwen is never consulted. Hook is disabled.

2. Delegate Mode

export QWEN_CONSULT_MODE=delegate

Qwen is consulted when you use keywords like:

  • "consult qwen"
  • "ask qwen"
  • "delegate to qwen"
  • "get a second opinion"
  • "alternative approach"

3. Always Mode

export QWEN_CONSULT_MODE=always

Qwen is consulted for every request.

Examples

Enable delegate mode in current session

export QWEN_CONSULT_MODE=delegate

Use with a specific model

export QWEN_CONSULT_MODE=delegate
export QWEN_MODEL=qwen2.5-coder-32b-instruct

Make permanent (add to ~/.bashrc)

echo 'export QWEN_CONSULT_MODE=delegate' >> ~/.bashrc

Monitoring Qwen

When Qwen is triggered, it runs in the background. You can monitor it:

# View Qwen output in real-time
tail -f ~/.claude/qwen-output.log

# Check if Qwen is running
ps aux | grep qwen

# Stop Qwen manually
kill $(cat ~/.claude/qwen.lock)

Hook Event

This hook triggers on UserPromptSubmit - every time you submit a prompt to Claude Code.

State Files

  • ~/.claude/qwen-consult.md - Current consultation state
  • ~/.claude/qwen-output.log - Qwen execution output
  • ~/.claude/qwen.lock - PID file for running Qwen process
  • ~/.claude/qwen-consult.log - Consultation trigger log