[BUG] Slash commands with same name in different namespaces always execute the first one alphabetically

Resolved 💬 2 comments Opened Jul 6, 2025 by gifflet Closed Jul 14, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.43
  • Operating System: macOS 15.5
  • Terminal: zsh

Bug Description

When creating slash commands with the same name in different namespaces, Claude Code always executes the command from the first namespace (alphabetically) regardless of which namespace is selected in the command palette.

Steps to Reproduce

  1. Create the following command structure:
.claude/
└── commands/
    ├── bar/
    │   └── test.md
    └── foo/
        └── test.md
  1. Add different content to each command:
  • .claude/commands/bar/test.md: Say "Hello, Bar!"
  • .claude/commands/foo/test.md: Say "Hello, Foo!"
  1. In Claude Code, type /test in the command palette
  1. Two options should appear:
  • /test Say "Hello, Bar!" (project:bar)
  • /test Say "Hello, Foo!" (project:foo)
  1. Select the second option (project:foo)

Expected Behavior

The command from the foo namespace should execute, displaying "Hello, Foo!"

Actual Behavior

The command from the bar namespace executes instead, displaying "Hello, Bar!"

Additional Context

  • The issue appears to be related to command resolution not properly considering the namespace qualifier
  • Commands are likely being matched only by the base name (test) without considering the full namespace path
  • This prevents organizing commands with common names across different namespaces as documented

View original on GitHub ↗

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