[BUG] Slash Commands not found with Custom CLAUDE_CONFIG_DIR

Resolved 💬 4 comments Opened Aug 11, 2025 by hangie Closed Jan 3, 2026

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

  1. Set environment variable: export CLAUDE_CONFIG_DIR=~/GitHub/claude-config
  2. Create slash commands in $CLAUDE_CONFIG_DIR/.claude/commands/
  3. Start Claude Code session
  4. Try to use custom slash commands (e.g., /ctx)
  5. 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.

View original on GitHub ↗

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