claudex-routing

Route delegated work to provider subagents based on live quota headroom and model availability.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill claudex-routing-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claudex-routing
Source: https://github.com/kkkaoru/dotfiles/tree/main/.claude/skills/claudex-routing
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill claudex-routing-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When orchestrating Claude Code with multiple AI providers (Codex, Grok, Claude, Qwen), it is hard to know which provider has remaining quota and which model to delegate work to. This Skill turns the injected routing context into an authoritative capacity snapshot so the orchestrator always delegates to the provider with the most headroom instead of guessing or exhausting a single quota. ## Core Features & Use Cases - Capacity-aware delegation: Ranks selected_workers by weekly and five-hour remaining quota, excludes exhausted providers, and enforces exact-model concurrency limits before launching Agent/Task subagents. - Dynamic model selection: Honors explicitly requested models via model_prefixes while enforcing a merged denylist (disabled_subagent_models) that overrides even explicit requests. - Worker lifecycle management: Defines rules for background fan-out, recipient reuse via SendMessage, independent verification of subagent results, and RAM-aware parallel caps on macOS. - Use Case: In a claudex orchestrator session, a user asks for a multi-file refactor; the Skill routes independent scopes to the top-ranked Codex and Grok workers in parallel, keeps the custom-advisor on a separate capacity channel, and verifies each worker's diff before reporting completion. ## Quick Start Ask the claudex orchestrator to implement a feature and let it automatically delegate the work to the highest-headroom provider subagent.

Frequently Asked Questions about claudex-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does claudex routing choose which provider subagent to use?

It ranks selected_workers by remaining quota headroom, using min(seven-day, five-hour) windows when reported, and excludes providers at 0% remaining. Exact-model concurrency and the disabled_subagent_models denylist further filter candidates before any Agent/Task launch.

How do I disable a specific model for subagent routing?

Add the exact model ID to a gitignored per-machine denylist such as ~/.config/claudex/disabled-subagent-models.local.json, or set CLAUDEX_DISABLED_SUBAGENT_MODELS for terminal-only entries. The merged denylist overrides even explicit user model requests.

Can subagents call the built-in advisor() tool?

No. The built-in parameterless advisor() is main-session only; subagents receive a No such tool available error. For strategic review inside delegated work, launch the custom-advisor subagent with claude-opus-5 at medium effort instead.

What happens when a provider's usage data is unavailable?

Providers with unknown or unmetered usage stay eligible but never outrank providers with known remaining headroom. A failed CodexBar refresh disables only its own providers, and Qwen falls back to a non-generative GET /models availability check.

Why does routing limit parallel subagents on low-memory Macs?

Each hook invocation samples macOS memory and lowers max_parallel_workers when reclaimable RAM is tight, forcing worker reuse at high pressure. This prevents spawning subagents until macOS starts killing applications; disable it with CLAUDEX_MEMORY_MANAGEMENT=0.