Skip to content

Add /list-slash-commands for workspace command discovery#43166

Open
V0latix wants to merge 4 commits intoanthropics:mainfrom
V0latix:list-slash-commands-discovery
Open

Add /list-slash-commands for workspace command discovery#43166
V0latix wants to merge 4 commits intoanthropics:mainfrom
V0latix:list-slash-commands-discovery

Conversation

@V0latix
Copy link
Copy Markdown

@V0latix V0latix commented Apr 3, 2026

Context

Users currently need to know slash command names in advance. This change adds an explicit discovery command for commands that are actually introspectable from this repository/workspace.

Problem

There was no dedicated command to list currently detectable slash commands in the active workspace. This hurts discoverability, especially for project and plugin commands.

Solution

  • Add local slash command /list-slash-commands.
  • Add scripts/list-slash-commands.sh as a single collection/normalization point.
  • Detect and display commands from:
    • .claude/commands (Project)
    • plugins/*/commands (Plugins)
  • Output is stable and sorted:
    • grouped by source (Project, then Plugins)
    • sorted by command name within each group
    • includes name, source, description, usage (from argument-hint), and origin
  • Robustness behavior:
    • command does not fail if some sources are unavailable
    • emits note: Some command sources could not be introspected.
  • Hardening included:
    • robust plugin manifest parsing (python3 with jq fallback)
    • fallback to plugin directory name when manifest is invalid/unavailable

Scope and honesty

This command reports detected slash commands in current workspace. It does not claim to list all runtime Claude Code commands (for example built-ins or non-introspectable MCP-backed runtime commands).

Tests

Added scripts/test-list-slash-commands.sh covering:

  • empty result set
  • project command detection
  • plugin command detection
  • stable output/sorting
  • unavailable source tolerance (no crash)
  • invalid plugin manifest fallback + warning

Run:

bash scripts/test-list-slash-commands.sh

Documentation

Updated README with a short Local slash command discovery section documenting both supported sources and explicit non-guarantees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant