[FEATURE] Commands should traverse parent directories like CLAUDE.md does
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
Title: Commands should traverse parent directories like CLAUDE.md does
Description:
CLAUDE.md files are discovered by traversing up the directory tree, allowing teams to share configuration via a parent directory. However, .claude/commands/ are only discovered at the project level and ~/.claude/commands/ (personal), with no parent directory traversal.
This inconsistency makes it impossible to share custom commands across a team using the same pattern that works for CLAUDE.md.
Current Behavior
~/src/
├── .claude/commands/start-ticket.md ← NOT discovered when in ~/src/project/
├── CLAUDE.md ← Discovered (traverses up) ✓
└── project/
├── .claude/commands/ ← Discovered ✓
└── CLAUDE.md ← Discovered ✓
Expected Behavior
Commands should traverse parent directories and merge, just like CLAUDE.md:
~/src/.claude/commands/(shared team commands)~/src/project/.claude/commands/(project-specific commands)~/.claude/commands/(personal commands)
Proposed Solution
Apply the same parent directory traversal logic used for CLAUDE.md to .claude/commands/ discovery. Commands found in child directories could override parent commands with the same name.
Alternative Solutions
- Symlinks in every project - Each project symlinks
.claude/commands/to a shared location. Unacceptable maintenance burden. - Personal symlinks - Each developer symlinks shared commands into
~/.claude/commands/. Doesn't auto-update, requires manual maintenance per developer. - Git submodules per project - Each project includes shared repo as submodule with committed symlink. Works but requires setup in every repo.
None of these match the elegant CLAUDE.md solution where parent directory + symlink just works.
Priority
High - Critical for team adoption
Feature Category
CLI commands and flags
Use Case Example
Our team has 20+ repositories. We share workflows via a team-shared git submodule at ~/src/team-shared/. Currently:
~/src/CLAUDE.mdsymlinks toteam-shared/CLAUDE.md→ Works everywhere ✓~/src/.claude/commands/symlinks toteam-shared/.claude/commands/→ Not discovered ✗
We want shared commands (/start-ticket, /pr-feedback) available in all projects without per-project setup.
Additional Context
Related issues requesting similar parent directory traversal:
- #12962 - Settings.json parent directory traversal
- #18029 - settings.json should traverse like CLAUDE.md
- #18192 - Recursive skill discovery (different but related)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗