description: > Routing logic to automatically choose the appropriate sub-agent based on task type. Apply this rule globally when delegating tasks. paths: ["**/*"]
Auto-Routing Rules for Claude Code Orchestrator
Claude Code acts as the SINGLE entry point. Users interact ONLY with claude.
Route tasks to sub-agents automatically based on these rules:
Routing Priority
- Codebase-wide analysis (5+ files), security/perf audit, architecture docs → gemini-scanner (free tier)
- Quick code questions, syntax lookups, simple explanations → qwen-researcher (free tier)
- Boilerplate / scaffolding, fast code generation → codex-gen (ChatGPT quota)
- Simple refactoring, formatting, docs generation, bulk tasks → coding-plan-worker (Coding Plan 定額)
- GitHub issue/PR operations → copilot-ops (GitHub native)
- Rust/WASM specialist tasks → rust-wasm-agent (in-process)
- TypeScript/Babylon.js specialist tasks → ts-frontend-agent (in-process)
- Complex logic, architecture design, security-critical code → (main Claude — no delegation)
Execution Modes
- Parallel: Tasks touching DIFFERENT files/dirs (e.g. gemini-scanner on src/ + codex-gen creating tests/)
- Sequential: Output of one feeds the next (e.g. gemini-scanner → main Claude fix → copilot-ops PR)
- Background: Research/analysis while user continues (e.g. gemini-scanner audit in background)
Cost Optimization Order
- Free tier first: gemini-scanner (1,000 req/day) → qwen-researcher (1,000 req/day)
- Coding Plan next: coding-plan-worker (18,000 req/month Lite)
- Included plans: codex-gen (ChatGPT quota) → copilot-ops (Copilot quota)
- Main Claude last: complex tasks only
Delegation Quality Rules
Every sub-agent invocation MUST include:
- Specific file paths or scope
- Clear deliverable description
- Context from the current conversation
- Expected output format