Feature Request: Autocomplete Support for Custom Slash Commands

Resolved 💬 2 comments Opened Jul 22, 2025 by jonpastore Closed Jul 26, 2025

Feature Request: Autocomplete Support for Custom Slash Commands

Summary

Add autocomplete support for custom slash commands defined in the commands/ directory, similar to how built-in commands like /help and /mcp are autocompleted.

Current Behavior

  • Custom slash commands in commands/ directory work when typed manually
  • No autocomplete suggestions appear for these custom commands
  • Users must remember exact command names or maintain separate documentation

Desired Behavior

  • When typing / in Claude Code, custom commands from commands/ should appear in autocomplete
  • Commands should show with descriptions (extracted from first line of markdown file)
  • Autocomplete should update when new command files are added/removed

Implementation Suggestion

1. Command Discovery

// On startup or workspace load
const commandFiles = await workspace.findFiles('commands/*.md');
const customCommands = commandFiles.map(file => ({
  name: path.basename(file.fsPath, '.md'),
  description: await extractFirstLine(file)
}));

2. Autocomplete Provider

// Register custom commands with autocomplete provider
customCommands.forEach(cmd => {
  registerCommand(`/${cmd.name}`, {
    description: cmd.description,
    source: 'custom',
    file: `commands/${cmd.name}.md`
  });
});

3. Dynamic Updates

  • Watch commands/ directory for changes
  • Update autocomplete registry when files are added/removed/renamed

Use Case

Projects using frameworks like Morpheus define many custom slash commands for workflows:

  • /process-requirements
  • /library-docs
  • /consult-gemini
  • /grok-review
  • etc.

Without autocomplete, users must memorize these or constantly reference documentation.

Benefits

  1. Improved Discoverability: Users can explore available commands
  2. Reduced Errors: No typos in command names
  3. Better UX: Consistent with built-in command experience
  4. Framework Support: Enables rich command ecosystems like Morpheus

Example

User types: /proc[TAB]
Autocomplete shows: /process-requirements - Transform requirements into comprehensive artifacts

Additional Considerations

  • Support command descriptions from markdown frontmatter or first line
  • Handle naming conflicts between custom and built-in commands
  • Performance impact of scanning large commands/ directories
  • Option to disable for projects without custom commands

Related Issues

  • Enhanced slash command system
  • Custom command parameters/arguments
  • Command validation and error handling

View original on GitHub ↗

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