Unified Router — Claude↔Qwen Intelligent Task Routing
Route every task to the optimal engine (Claude Code or Qwen Code), model, and thinking depth.
This skill replaces ad-hoc routing decisions with a systematic framework.
Routing Decision Matrix
Engine Selection
| Signal |
Route to Claude Code |
Route to Qwen Code |
| Authority level |
L0-L2 (strategic) |
L5-L6 (worker) |
| Risk tier |
T2-T3 (shared/critical) |
T0-T1 (safe/local) |
| MCP servers needed |
aster, playwright, stripe, k8s, terraform, slack, postgres, docker |
filesystem, github, memory, context7, brave-search, tavily, sequential |
| Multi-agent orchestration |
Yes |
No |
| File coordination |
Multiple tasks touch same files |
Single-file focus |
| Thinking depth |
Architecture, security, design |
Review, test, docs, explore |
| Cost sensitivity |
Budget available |
Token-saving priority |
Model Selection (within each engine)
Claude Code models:
| Complexity |
Model |
When |
| Enterprise |
opus |
Architecture, security audit, multi-service design |
| Complex |
sonnet |
Multi-file implementation, debugging, integration |
| Simple |
haiku |
Quick lookups, simple edits, status checks |
Qwen Code models:
| Complexity |
Model |
When |
| Deep |
qwen3.5:cloud |
Complex code review, large refactors |
| Standard |
qwen3:8b |
Test gen, docs, simple fixes |
| Quick |
qwen3:8b |
Exploration, search, scaffolding |
| Creative |
minimax-m2.5:cloud |
Creative writing, brainstorming |
| Coding |
kimi-k2.5:cloud |
Strong coding tasks |
| Cloud (free) |
coder-model (--qwen-oauth) |
Best quality, 1K free/day |
Thinking Depth Selection
| Task Type |
Thinking Budget |
Model |
Engine |
| Architecture, design, security |
8000 tokens |
qwen3.5:cloud or Claude opus |
Either (prefer Claude) |
| Implementation, bug fix, integration |
4000 tokens |
qwen3:8b or Claude sonnet |
Either |
| Review, test, docs, explore, scaffold |
1000 tokens |
qwen3:8b or Claude haiku |
Prefer Qwen (saves tokens) |
Dispatch Commands
Claude → Qwen (offload worker tasks)
# Standard dispatch (existing)
qwen-dispatch review "Review src/auth.py" --cwd ~/project
# With thinking (NEW)
qwen-dispatch review "Review src/auth.py" --think --cwd ~/project
# Thinking-only mode (NEW)
qwen-dispatch think "Analyze the auth flow design" --cwd ~/project
# Full auto-activation (NEW)
qwen-dispatch auto "Implement user pagination" --cwd ~/project
Qwen → Claude (escalation)
# When Qwen detects T2+ risk
qwen-escalate "Design the new microservice architecture" --cwd ~/project
# With prior thinking context
qwen-escalate "Deploy to production" --context ~/.qwen/thinking/think_abc123.json
Routing Algorithm
1. Parse task → extract domain, complexity, risk signals
2. Check MCP requirements → if needs servers Qwen lacks → Claude
3. Check risk tier → T2+ → Claude
4. Check authority level → L0-L2 → Claude, L5-L6 → Qwen
5. Check file coordination → multi-task same-file → Claude (needs orchestration)
6. Default → Qwen with --think flag (saves tokens, adds reasoning)
Integration Points
- CoreMind STAGE 4 (PLAN): Router evaluates each plan step
- CoreMind STAGE 7 (EXECUTE): Router dispatches to the selected engine
- qwen-dispatch: Updated with
think, plan, auto task types + --think flag
- qwen-escalate: New bidirectional bridge for Qwen→Claude handoff
- auto-activate.py: Qwen's thinking engine (invoked by all new task types)
Artifact Flow
Claude thinking → ~/.claude/projects/*/memory/ (Claude's memory)
Qwen thinking → ~/.qwen/thinking/*.json (structured artifacts)
Qwen plans → ~/.qwen/plans/*.json (execution DAGs)
Qwen logs → ~/.qwen/logs/*.json (execution results)
Qwen metrics → ~/.qwen/metrics/*.jsonl (performance tracking)
Both engines can read each other's artifacts for context continuity.
1---2name: unified-router3description: Intelligent task routing across Claude Code + Qwen Code — picks the right engine, model, and thinking depth for every task4---56# Unified Router — Claude↔Qwen Intelligent Task Routing78Route every task to the optimal engine (Claude Code or Qwen Code), model, and thinking depth.9This skill replaces ad-hoc routing decisions with a systematic framework.1011## Routing Decision Matrix1213### Engine Selection1415| Signal | Route to Claude Code | Route to Qwen Code |16|--------|---------------------|---------------------|17| Authority level | L0-L2 (strategic) | L5-L6 (worker) |18| Risk tier | T2-T3 (shared/critical) | T0-T1 (safe/local) |19| MCP servers needed | aster, playwright, stripe, k8s, terraform, slack, postgres, docker | filesystem, github, memory, context7, brave-search, tavily, sequential |20| Multi-agent orchestration | Yes | No |21| File coordination | Multiple tasks touch same files | Single-file focus |22| Thinking depth | Architecture, security, design | Review, test, docs, explore |23| Cost sensitivity | Budget available | Token-saving priority |2425### Model Selection (within each engine)2627**Claude Code models:**28| Complexity | Model | When |29|-----------|-------|------|30| Enterprise | opus | Architecture, security audit, multi-service design |31| Complex | sonnet | Multi-file implementation, debugging, integration |32| Simple | haiku | Quick lookups, simple edits, status checks |3334**Qwen Code models:**35| Complexity | Model | When |36|-----------|-------|------|37| Deep | qwen3.5:cloud | Complex code review, large refactors |38| Standard | qwen3:8b | Test gen, docs, simple fixes |39| Quick | qwen3:8b | Exploration, search, scaffolding |40| Creative | minimax-m2.5:cloud | Creative writing, brainstorming |41| Coding | kimi-k2.5:cloud | Strong coding tasks |42| Cloud (free) | coder-model (--qwen-oauth) | Best quality, 1K free/day |4344### Thinking Depth Selection4546| Task Type | Thinking Budget | Model | Engine |47|-----------|----------------|-------|--------|48| Architecture, design, security | 8000 tokens | qwen3.5:cloud or Claude opus | Either (prefer Claude) |49| Implementation, bug fix, integration | 4000 tokens | qwen3:8b or Claude sonnet | Either |50| Review, test, docs, explore, scaffold | 1000 tokens | qwen3:8b or Claude haiku | Prefer Qwen (saves tokens) |5152## Dispatch Commands5354### Claude → Qwen (offload worker tasks)55```bash56# Standard dispatch (existing)57qwen-dispatch review "Review src/auth.py" --cwd ~/project5859# With thinking (NEW)60qwen-dispatch review "Review src/auth.py" --think --cwd ~/project6162# Thinking-only mode (NEW)63qwen-dispatch think "Analyze the auth flow design" --cwd ~/project6465# Full auto-activation (NEW)66qwen-dispatch auto "Implement user pagination" --cwd ~/project67```6869### Qwen → Claude (escalation)70```bash71# When Qwen detects T2+ risk72qwen-escalate "Design the new microservice architecture" --cwd ~/project7374# With prior thinking context75qwen-escalate "Deploy to production" --context ~/.qwen/thinking/think_abc123.json76```7778## Routing Algorithm7980```811. Parse task → extract domain, complexity, risk signals822. Check MCP requirements → if needs servers Qwen lacks → Claude833. Check risk tier → T2+ → Claude844. Check authority level → L0-L2 → Claude, L5-L6 → Qwen855. Check file coordination → multi-task same-file → Claude (needs orchestration)866. Default → Qwen with --think flag (saves tokens, adds reasoning)87```8889## Integration Points9091- **CoreMind STAGE 4 (PLAN)**: Router evaluates each plan step92- **CoreMind STAGE 7 (EXECUTE)**: Router dispatches to the selected engine93- **qwen-dispatch**: Updated with `think`, `plan`, `auto` task types + `--think` flag94- **qwen-escalate**: New bidirectional bridge for Qwen→Claude handoff95- **auto-activate.py**: Qwen's thinking engine (invoked by all new task types)9697## Artifact Flow9899```100Claude thinking → ~/.claude/projects/*/memory/ (Claude's memory)101Qwen thinking → ~/.qwen/thinking/*.json (structured artifacts)102Qwen plans → ~/.qwen/plans/*.json (execution DAGs)103Qwen logs → ~/.qwen/logs/*.json (execution results)104Qwen metrics → ~/.qwen/metrics/*.jsonl (performance tracking)105```106107Both engines can read each other's artifacts for context continuity.