- Add all 21 commands (clawd, ralph, prometheus*, dexto*) - Add all hooks (intelligent-router, clawd-*, prometheus-wrapper, unified-integration-v2) - Add skills (ralph, prometheus master) - Add MCP servers (registry.json, manager.sh) - Add plugins directory with marketplaces - Add health-check.sh and aliases.sh scripts - Complete repository synchronization with local ~/.claude/ Total changes: 100+ new files added All integrations now fully backed up in repository 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
2.2 KiB
Executable File
2.2 KiB
Executable File
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