[BUG] CLI Commands being treated improperly during other operation
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Situation: While Claude Code is working on a task, I tell it something, then I enter a built-in CLI command, e.g. "/stats", on a new line.
Behavior: It queues the CLI command, then passes the text of the command to Claude when finished, so that Claude responds, e.g., "Regarding /stats — that's a built-in CLI command, not something I handle. It should have been processed by the Claude Code client directly. If it didn't trigger, try running it again on its own line."
What Should Happen?
Expected Behavior: Either immediately executing the CLI command during other operation, or waiting, then executing the CLI command after current operation is complete rather than passing it to Claude.
(This seems like it should be intercepted in the interface, when a command is used, not passed to the LLM.)
Error Messages/Logs
As noted above:
"Regarding /stats — that's a built-in CLI command, not something I handle. It should have been processed by the Claude Code client directly. If it didn't trigger, try running it again on its own line."
Steps to Reproduce
- Ask Claude to do any task that takes time.
- (Possibly required, unsure.) During the task, ask for something else, which get queued.
- Still during the task, enter a CLI command as a new response.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.39
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗