Custom slash commands and agents fail to load in project directories with spaces in path

Resolved 💬 2 comments Opened Mar 31, 2026 by ctrl-stef Closed May 5, 2026

Bug

Project-level custom commands (.claude/commands/*.md) and agents (.claude/agents/*.md) stop appearing in autocomplete and cannot be invoked via /command-name. The files exist, are properly formatted, and were working previously.

Pattern

Both affected projects have spaces in their directory path:

  • /Users/.../Downloads/Financial Benchmarks/.claude/commands/competitor-analysis.md
  • /Users/.../Downloads/Reservations Source of Truth/.claude/agents/reservation-reconciler.md

Steps to reproduce

  1. Create a project in a directory with spaces in the name (e.g. ~/Downloads/My Project/)
  2. Add a .claude/commands/my-command.md or .claude/agents/my-agent.md file
  3. The command/agent works initially in the session
  4. After restarting the session (exit + relaunch), /my-command or the agent no longer appears in autocomplete and cannot be invoked
  5. The files are still present and unchanged on disk

Expected behavior

Custom commands and agents should load regardless of spaces in the project directory path.

Environment

  • OS: macOS Darwin 25.1.0 (arm64)
  • Claude Code: CLI (latest)
  • Shell: zsh

View original on GitHub ↗

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