[BUG] Slash Commands not found with Custom CLAUDE_CONFIG_DIR
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.72 (Claude Code)
- Operating System: macOS Darwin 24.6.0
- Terminal: iTerm2
Bug Description
When using a custom CLAUDE_CONFIG_DIR environment variable, Claude Code doesn't properly discover global slash commands. It fails to look in $CLAUDE_CONFIG_DIR/.claude/commands/ as would be expected.
Steps to Reproduce
- Set environment variable:
export CLAUDE_CONFIG_DIR=~/GitHub/claude-config - Create slash commands in
$CLAUDE_CONFIG_DIR/.claude/commands/ - Start Claude Code session
- Try to use custom slash commands (e.g.,
/ctx) - Commands are not found/available
Expected Behavior
Claude Code should check for slash commands in $CLAUDE_CONFIG_DIR/.claude/commands/ when CLAUDE_CONFIG_DIR is set, then fall back to ~/.claude/commands/ if not found.
Actual Behavior
Claude Code only checks ~/.claude/commands/ regardless of CLAUDE_CONFIG_DIR setting. Custom slash commands are not discovered.
Additional Context
Workaround currently in use:
# Create symlinks to make commands discoverable
ln -s $CLAUDE_CONFIG_DIR ~/.claude
ln -s .claude/commands $CLAUDE_CONFIG_DIR/commands
This allows Claude Code to find commands via the default ~/.claude path while keeping all configuration in the custom directory.
Impact: Without the workaround, custom slash commands are not available when using a custom config directory, affecting workflow automation and productivity.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗