Bug: Claude cannot execute custom slash commands from within conversations
Bug Report: Claude cannot execute custom slash commands from within conversations
Description
When using Claude Code with custom slash commands (in .claude/commands/), Claude is unable to execute these commands from within the conversation, even though they appear to work when a user runs them directly.
Steps to Reproduce
- Set up a project with custom Claude commands in
.claude/commands/directory - Start a conversation with Claude
- Ask Claude to execute one of these custom commands (e.g.,
project:pr-reviewb) - Observe that nothing happens when Claude tries to run the command
Expected Behavior
Claude should be able to execute custom slash commands from within the conversation, just as a user can.
Actual Behavior
When Claude attempts to run a custom command (either with or without the slash prefix), nothing happens. The command isn't recognized or executed.
Context
I was having a conversation with Claude about PR review commands in my project. I could run commands like project:pr-reviewc and project:pr-reviewb directly from my terminal, and Claude could see the outputs. However, when I asked Claude to execute the same commands, Claude was unable to do so.
This creates a confusing experience where Claude can analyze the commands and see their output when I run them, but cannot execute them itself when asked to.
Environment
- Claude Model: claude-3-7-sonnet
- Using Claude Code CLI
- Custom commands defined in .claude/commands/ directory
Additional Information
This limitation significantly reduces Claude's ability to be proactive in helping with project-specific tasks. If Claude could execute custom commands, it could perform more complex project-specific tasks without requiring the user to manually type each command.
Additional Information: PR Review Command Files
For reference, here are the PR review command files that were mentioned in the bug report:
1. pr-review.md (Original PR review command)
{
"type": "text",
"text": "# EXECUTION INSTRUCTIONS FOR CLAUDE - AUTOMATED PR REVIEW COMMAND
BEGIN EXECUTION - This is an automated agent workflow to review, approve, and optionally merge pull requests
...
[truncated for brevity - full implementation in the file]
...
END EXECUTION"
}
2. pr-reviewb.md (Basic/descriptive PR review command)
{
"type": "text",
"text": "# You are a Pull Request Reviewer, Approver and Merger
As an automated PR reviewer, your task is to thoroughly analyze GitHub pull requests, provide detailed feedback, and make informed decisions about approving and merging code changes....
[truncated for brevity - full implementation in the file]
...
3. pr-reviewc.md (Enhanced PR review command)
{
"type": "text",
"text": "# EXECUTION INSTRUCTIONS FOR CLAUDE - ENHANCED PR REVIEW COMMAND
BEGIN EXECUTION - This is an automated agent workflow to review, approve, and optionally merge pull requests
...
[truncated for brevity - full implementation in the file]
...
END EXECUTION"
}
The issue is that when these commands are invoked by the user through the terminal, Claude can see and analyze their output, but when asked to run them directly (e.g., /project:pr-reviewb 60), Claude can't execute them. This creates a confusing user experience since Claude seems aware of the commands but can't directly interact with them.
Should work if you use my repo! I made a hook to parse them
https://github.com/jleechanorg/claude-commands
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.