claude desktop: cascade slash commands / skills / subagents up the folder tree (not just project root)

Open 💬 0 comments Opened Jul 9, 2026 by Kizuno18

follow-up to #76111 — that one's about loading CLAUDE.md across nested folders, this is the same idea for the executable .claude bits: commands, skills, subagents

what

discover .claude/commands/, .claude/skills/, .claude/agents/ along the ancestor chain (and for the opened project, its nested subfolders), not only the single project root — nearest folder wins on name conflict

my real setup

a superrepo where the commands are scattered across 4 different .claude/commands/ by scope:

  • root .claude/commands/: grant-license-days, migrate-machine, pause-machines-and-licenses, restart-all, copy-waypoints, change-plan-type
  • kizubot/.claude/commands/: deploy-bot, run-container-manager, setup-dc-monitoring, setup-monitoring-server
  • api-server/.claude/commands/: run-api-server
  • wpp_announcer/.claude/commands/: run-alarm-kizubot, run-mariadb, run-wpp-bot

the pain

  • open a session inside kizubot and the root-level ops commands (grant-license-days, migrate-machine) aren't there — even though they're the exact things i run while working on the bot
  • open at the root and the submodule commands (deploy-bot, run-api-server) aren't there either
  • so the command set i can reach depends entirely on which folder i launched from, and it's never the full set i actually need

ask

  • walk the ancestor chain up to the project root (or a user root marker) and register every .claude/commands|skills|agents on the way
  • also discover nested ones in subfolders of the opened project
  • nearest-folder definition wins on name collision, so a submodule can override a root command
  • same precedence model as the CLAUDE.md ask in #76111 so the two stay consistent

related: #76111

View original on GitHub ↗