Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

fix: target multi-word guard for CLI subcommands only

bellmanb3a5a7423727
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 })),