[BUG] Built-in CLI commands passed to AI as regular messages, causing unintended actions
Resolved 💬 3 comments Opened Feb 15, 2026 by mtskf Closed Feb 18, 2026
Bug Description
Built-in CLI commands (like /rename) are being passed to the AI as regular user messages, causing the AI to interpret and take unintended actions.
Steps to Reproduce
- Start a Claude Code session
- Execute a built-in command, e.g.,
/rename new-session-name - Observe that:
- The command is passed to AI as a regular message
- AI attempts to interpret it (e.g., as a file rename request)
- AI takes unintended actions (e.g., renaming files instead of the session)
- The built-in command is eventually processed correctly, but after the AI has already acted
Expected Behavior
Built-in CLI commands should be intercepted and processed by the CLI before being passed to the AI. The AI should never receive these commands as regular messages.
Actual Behavior
/rename chrome-issueis received by AI as a regular user message- AI interprets it as a file rename request
- AI executes:
mv /path/to/file.md /path/to/chrome-issue.md - Then the built-in command is processed:
Session and agent renamed to: chrome-issue
Impact
Critical: This can cause unintended file system modifications, data loss, or other destructive actions when AI misinterprets built-in commands.
Examples of potential issues:
/clearmight cause AI to delete files/helpmight trigger unexpected actions- Any built-in command could be misinterpreted
Environment
- Claude Code Version: 2.1.42
- OS: macOS (Darwin 25.3.0)
- Shell: zsh
Evidence
The AI received the command with this system reminder:
The user sent a new message while you were working:
/rename chrome-issue
IMPORTANT: After completing your current task, you MUST address the user's message above.
Then later, the command was processed:
<command-name>/rename</command-name>
<command-args>chrome-issue</command-args>
<local-command-stdout>Session and agent renamed to: chrome-issue</local-command-stdout>
Related Issues
- #18754 (Slash commands not working)
- #16072 (System prompt conflates skills and slash commands)
Suggested Fix
Built-in CLI commands should be:
- Intercepted by the CLI parser before being sent to AI
- Processed immediately without AI involvement
- Never appear in AI context as user messages
Only user-defined skills should be passed to AI via the Skill tool.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗