All skills
Skillintermediate

🚦 Routing

<div align="center">

Claude Code Knowledge Pack7/10/2026

Overview

<div align="center">

šŸ  Home › Workflows › 🚦 Routing

← 01 Prompt Chaining ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 03 Parallelization →

</div>

🚦 Routing

TL;DR: Classify an input and direct it to a specialized handler. Like a train switch — one input takes ONE track.


Diagram

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart TB
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef subagent fill:#ec4899,stroke:#db2777,stroke-width:2px,color:#ffffff
    classDef idle fill:#94a3b8,stroke:#64748b,stroke-width:2px,color:#ffffff

    INPUT["šŸ™‹ā€ā™€ļøšŸ“„ User Request"]:::user --> ROUTER{"šŸ”šŸš¦ Classify & Route"}:::main

    ROUTER -.->|"Type A"| HA["šŸ¦šŸ’¤ Handler A"]:::idle
    ROUTER -->|"šŸ”šŸŖŗ Type B"| HB["🐦⚔ Handler B"]:::subagent
    ROUTER -.->|"Type C"| HC["šŸ¦šŸ’¤ Handler C"]:::idle
    ROUTER -.->|"Unknown"| DEFAULT["šŸ”šŸ’¤ Default"]:::idle

    HB -->|"šŸ¦šŸ“¤"| FINAL["šŸ’ā€ā™€ļøšŸ“¤ User Receives"]:::user

Key Insight

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  🚦 ROUTING: Choose ONE branch                                              │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│                                                                             │
│  Logic: if/else, switch/case                                                │
│  Question: "Where should I send this?"                                      │
│  Result: Single output from chosen handler                                  │
│                                                                             │
│  Analogy: Train switch → One train takes ONE track                          │
│                                                                             │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Characteristics

PropertyValue
ComplexityLow
ParallelismNone
Human-LoopNone
IterationNone

When to Use

Routing works well for complex tasks where there are distinct categories that are better handled separately, and where classification can be handled accurately.

Use CaseRoutes
Customer supportBug → Tech Team, Billing → Finance, General → FAQ
Code tasksBug fix → Debugger, New feature → Builder
Model routingEasy → Claude Haiku 4.5, Hard → Claude Sonnet 4.5
ContentQuestion → Q&A handler, Task → Executor

When NOT to Use

  • All inputs require same processing
  • Classification is unreliable
  • Categories overlap significantly

<div align="center">

← 01 Prompt Chaining ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 03 Parallelization →

</div>