From b3a5a742372727baca958374f17d2cc1c47d3cb5 Mon Sep 17 00:00:00 2001 From: bellman Date: Fri, 5 Jun 2026 01:46:11 +0900 Subject: [PATCH] fix: target multi-word guard for CLI subcommands only Only fire the slash-command guard for multi-word commands when the first token is a known CLI subcommand (help, version, status, etc.). Slash commands with additional arguments (explain this, cost list) are treated as prompts. Generated with https://github.com/Yeachan-Heo/gajae-code Co-authored-by: Gajae Code --- rust/crates/rusty-claude-cli/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index ed683e55..b07ef9c4 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -2350,10 +2350,17 @@ fn parse_single_word_command_alias( return Some(Ok(CliAction::Help { output_format })); } - // #453: fire guard for multi-word commands too (claw cost list, claw model list, etc.) + // #453: fire guard for multi-word CLI subcommands too (claw cost list, claw model list, etc.) + // For slash commands that are commonly used as prompts (explain, cost, tokens, etc.), + // only fire the guard when there's exactly one token. if rest.is_empty() { return None; } + // Known CLI subcommands that don't accept additional arguments + const CLI_SUBCOMMANDS: &[&str] = &["help", "version", "status", "sandbox", "doctor", "state", "config", "diff"]; + if rest.len() > 1 && !CLI_SUBCOMMANDS.contains(&rest[0].as_str()) { + return None; + } match rest[0].as_str() { "help" => Some(Ok(CliAction::Help { output_format })),