Skip to main content
command CX Codex

select-tool — Claude Code command: MCP server routing by complexity

select-tool is a Claude Code command that routes operations to Serena or Morphllm based on complexity, balancing accuracy and speed.

MIT ★ 23,950 updated 2026-09-27

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/select-tool.md
Open on GitHub

What select-tool does

select-tool evaluates an operation across multiple dimensions—task type, file count, language, and framework dependencies—and assigns a complexity score. Based on this analysis, it selects the right server: Serena for semantic operations (symbol refactoring, code navigation, project context) or Morphllm for pattern-based work (bulk replacements, regex-driven transformations).

The command uses a decision matrix with direct mappings (symbol ops → Serena, pattern edits → Morphllm) and threshold-based routing rules. Scores above 0.6 route to Serena, below 0.4 to Morphllm; in the 0.4–0.6 range, the choice depends on specific operation flags. It can check system configuration and validate selections through execute_sketched_edit.

While select-tool runs automatically within other commands (refactor, edit, implement, improve), you can invoke it directly with --analyze to see the scoring breakdown or --explain to understand the routing decision.

What it helps with

  • choose between MCP servers for refactoring tasks using complexity scoring
  • route edit operations to the server that best fits accuracy and speed requirements
  • automatically match task characteristics to the optimal MCP server

Example prompts for the agent

  • /sc:select-tool "rename function across 10 files" --analyze
  • /sc:select-tool "replace console.log with logger.info project-wide" --explain
  • /sc:select-tool "save project context and discoveries"

How to install select-tool

Manually: put the files in place

.claude/commands/select-tool.md

Call it with /select-tool. For all projects use ~/.claude/commands/

Questions about select-tool

How do I install select-tool in Claude Code?

Add the select-tool.md file to your project's .claude/commands/ directory. The command will then be available as /sc:select-tool.

What does select-tool do?

It analyzes an operation, computes its complexity score, and chooses the best MCP server—Serena for semantic tasks or Morphllm for pattern-based operations.

When does select-tool pick Serena versus Morphllm?

Serena handles symbol work, refactoring, and context-aware operations. Morphllm is chosen for bulk replacements, regex-driven transforms, and when speed is the priority.

Source text

select-tool.md · MIT
---
name: select-tool
description: "Intelligent MCP tool selection based on complexity scoring and operation analysis"
category: special
complexity: high
mcp-servers: [serena, morphllm]
personas: []
---

# /sc:select-tool - Intelligent MCP Tool Selection

## Triggers
- Operations requiring optimal MCP tool selection between Serena and Morphllm
- Meta-system decisions needing complexity analysis and capability matching
- Tool routing decisions requiring performance vs accuracy trade-offs
- Operations benefiting from intelligent tool capability assessment

## Usage
```
/sc:select-tool [operation] [--analyze] [--explain]
```

## Behavioral Flow
1. **Parse**: Analyze operation type, scope, file count, and complexity indicators
2. **Score**: Apply multi-dimensional complexity scoring across various operation factors
3. **Match**: Compare operation requirements against Serena and Morphllm capabilities
4. **Select**: Choose optimal tool based on scoring matrix and performance requirements
5. **Validate**: Verify selection accuracy and provide confidence metrics

Key behaviors:
- Complexity scoring based on file count, operation type, language, and framework requirements
- Performance assessment evaluating speed vs accuracy trade-offs for optimal selection
- Decision logic matrix with direct mappings and threshold-based routing rules
- Tool capability matching for Serena (semantic operations) vs Morphllm (pattern operations)

## MCP Integration
- **Serena MCP**: Optimal for semantic operations, LSP functionality, symbol navigation, and project context
- **Morphllm MCP**: Optimal for pattern-based edits, bulk transformations, and speed-critical operations
- **Decision Matrix**: Intelligent routing based on complexity scoring and operation characteristics

## Tool Coordination
- **get_current_config**: System configuration analysis for tool capability assessment
- **execute_sketched_edit**: Operation testing and validation for selection accuracy
- **Read/Grep**: Operation context analysis and complexity factor identification
- **Integration**: Automatic selection logic used by refactor, edit, implement, and improve commands

## Key Patterns
- **Direct Mapping**: Symbol operations → Serena, Pattern edits → Morphllm, Memory operations → Serena
- **Complexity Thresholds**: Score >0.6 → Serena, Score <0.4 → Morphllm, 0.4-0.6 → Feature-based
- **Performance Trade-offs**: Speed requirements → Morphllm, Accuracy requirements → Serena
- **Fallback Strategy**: Serena → Morphllm → Native tools degradation chain

## Examples

### Complex Refactoring Operation
```
/sc:select-tool "rename function across 10 files" --analyze
# Analysis: High complexity (multi-file, symbol operations)
# Selection: Serena MCP (LSP capabilities, semantic understanding)
```

### Pattern-Based Bulk Edit
```
/sc:select-tool "update console.log to logger.info across project" --explain
# Analysis: Pattern-based transformation, speed priority
# Selection: Morphllm MCP (pattern matching, bulk operations)
```

### Memory Management Operation
```
/sc:select-tool "save project context and discoveries"
# Direct mapping: Memory operations → Serena MCP
# Rationale: Project context and cross-session persistence
```

## Boundaries

**Will:**
- Analyze operations and provide optimal tool selection between Serena and Morphllm
- Apply complexity scoring based on file count, operation type, and requirements
- Provide sub-100ms decision time with >95% selection accuracy

**Will Not:**
- Override explicit tool specifications when user has clear preference
- Select tools without proper complexity analysis and capability matching
- Compromise performance requirements for convenience or speed

© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set56

The whole set →
analyze analyze reviews code for quality, security, performance, and architecture. Use it for a whole project or a selected directory. CX Codex +1 ★ 23,950repo stars load Loads project context via Serena MCP and restores cross-session memory. Runs at session start or when switching between projects. CX Codex +1 ★ 23,950repo stars design design plans system architecture, API specifications, and database schemas before coding starts. Useful for creating technical contracts and component diagrams. CX Codex +1 ★ 23,950repo stars save save preserves session context, discoveries, and recovery points through Serena MCP. Use it when work needs to continue across sessions. CX Codex +1 ★ 23,950repo stars business-panel business-panel runs document analysis through a panel of simulated business thinkers to deliver structured strategic synthesis. CX Codex +1 ★ 23,950repo stars research research — a command for investigating complex questions beyond your knowledge cutoff. It breaks down the task automatically, runs parallel searches, and collects evidence with source attribution. CX Codex +1 ★ 23,950repo stars reflect reflect evaluates task adherence and session progress using Serena MCP analysis tools. Useful for quality checks before marking tasks as complete. CX Codex +1 ★ 23,950repo stars explain A command to explain code, system architecture, and concepts at the right level of depth. Helps you understand unfamiliar code or teach concepts to others. CX Codex +1 ★ 23,950repo stars

Project sponsors

Companies that keep this analytics open