Files
SuperCharged-Claude-Code-Up…/hooks/QWEN-HOOK-README.md
uroma 932529d37f Replace placeholder files with originals from system
Found and copied original files from ~/.claude installation:

- hooks/ - Original Qwen and Ralph hook scripts with full functionality
- commands/ - Original command definitions (brainstorm, write-plan, execute-plan)
- bin/ralphloop - Original 223-line Python wrapper (6,290 bytes)
- scripts/sync-agents.sh - Original sync script with GitHub/Gitea backup
- templates/ - Original config templates from working installation
- plugins/ - Original comprehensive plugin README

Files sourced from:
- ~/.claude/skills/skills/hooks/
- ~/.claude/skills/skills/commands/
- ~/.claude/skills/skills/templates/
- /home/uroma/obsidian-web-interface/bin/ralphloop
- ~/.claude/agents/sync-agents.sh

These are the production files from the working Claude Code
installation, replacing the placeholder files I created earlier.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 18:23:28 +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