[FEATURE] Allow model selection in slash command frontmatter

Resolved 💬 7 comments Opened Sep 17, 2025 by TheTechChild Closed Feb 3, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Currently, slash commands in Claude Code execute using whatever model is active in the current session. This creates inefficiency as users must manually switch models before running commands, and prevents optimization where simple tasks could use faster/cheaper models while complex tasks use more capable ones. Users cannot automate model selection based on task complexity, leading to either over-usage of expensive models for simple tasks or under-powered models for complex operations.

Proposed Solution

Add a model field to slash command frontmatter that allows specifying which Claude model should execute the command. The command would temporarily switch to the specified model for execution, then return to the previously active model. This would support both explicit model names (opus, sonnet, haiku) and potentially model characteristics (fast, balanced, powerful).

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Scenario: A development team has multiple slash commands with varying complexity:

  • /format-json - Simply prettifies JSON (perfect for Haiku)
  • /pull-request-message - Analyzes git diffs and writes descriptions (good for Sonnet)
  • /architecture-review - Deep code analysis and recommendations (requires Opus)

Additional Context

# Example 1: Simple formatting command
```
description: Format and prettify JSON data
model: haiku # Use fast, efficient model for simple formatting
allowed-tools: none

Format the following JSON data with proper indentation...
```

# Example 2: Complex analysis command
```
description: Perform comprehensive architecture review
model: opus # Use most capable model for deep analysis
allowed-tools: Read(), Grep(), Bash(*)

Analyze the codebase architecture and provide recommendations...
```

# Example 3: With fallback behavior
```
description: Generate pull request message
model: sonnet # Balanced model for standard tasks
model-fallback: current # If sonnet unavailable, use current session model
allowed-tools: Bash(git diff:), Bash(git log:)

Generate a comprehensive pull request message...
```

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗