From cba31c4f957a80d1cdd285e3891dba1cc3c5cf2c Mon Sep 17 00:00:00 2001 From: Yeachan-Heo Date: Tue, 31 Mar 2026 21:03:49 +0000 Subject: [PATCH] Tighten help and clear messaging across the CLI surface Refresh shared slash help and REPL help wording so the command surface reads more like an integrated console, and make successful /clear output match the newer structured reporting style. This keeps discoverability consistent now that status, model, permissions, config, and cost all use richer operator-oriented copy. Constraint: Help text must stay synchronized with the actual implemented command surface and resume behavior Rejected: Larger README/doc pass in the same commit | keeping the slice limited to runtime help/output makes it easier to review and revert Confidence: high Scope-risk: narrow Reversibility: clean Directive: Prefer shared help-copy changes in commands crate first, then layer REPL-specific additions in the CLI binary Tested: cargo fmt --manifest-path ./rust/Cargo.toml --all; cargo clippy --manifest-path ./rust/Cargo.toml --workspace --all-targets -- -D warnings; cargo test --manifest-path ./rust/Cargo.toml --workspace Not-tested: Manual comparison of help wording against upstream Claude Code terminal screenshots --- rust/crates/commands/src/lib.rs | 8 +++--- rust/crates/rusty-claude-cli/src/main.rs | 31 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/rust/crates/commands/src/lib.rs b/rust/crates/commands/src/lib.rs index b3609bf..983588a 100644 --- a/rust/crates/commands/src/lib.rs +++ b/rust/crates/commands/src/lib.rs @@ -174,8 +174,8 @@ pub fn resume_supported_slash_commands() -> Vec<&'static SlashCommandSpec> { #[must_use] pub fn render_slash_command_help() -> String { let mut lines = vec![ - "Available commands:".to_string(), - " (resume-safe commands are marked with [resume])".to_string(), + "Slash commands".to_string(), + " [resume] means the command also works with --resume SESSION.json".to_string(), ]; for spec in slash_command_specs() { let name = match spec.argument_hint { @@ -288,7 +288,7 @@ mod tests { #[test] fn renders_help_from_shared_specs() { let help = render_slash_command_help(); - assert!(help.contains("resume-safe commands")); + assert!(help.contains("works with --resume SESSION.json")); assert!(help.contains("/help")); assert!(help.contains("/status")); assert!(help.contains("/compact")); @@ -340,7 +340,7 @@ mod tests { let result = handle_slash_command("/help", &session, CompactionConfig::default()) .expect("help command should be handled"); assert_eq!(result.session, session); - assert!(result.message.contains("Available commands:")); + assert!(result.message.contains("Slash commands")); } #[test] diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index 7442ea4..994099e 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -623,7 +623,14 @@ impl LiveCli { true, permission_mode_label(), )?; - println!("Cleared local session history."); + println!( + "Session cleared + Mode fresh session + Preserved model {} + Permission mode {}", + self.model, + permission_mode_label() + ); Ok(()) } @@ -685,10 +692,16 @@ impl LiveCli { } fn render_repl_help() -> String { - format!( - "{} - /exit Quit the REPL", - render_slash_command_help() + [ + "REPL".to_string(), + " /exit Quit the REPL".to_string(), + " /quit Quit the REPL".to_string(), + String::new(), + render_slash_command_help(), + ] + .join( + " +", ) } @@ -1351,9 +1364,17 @@ mod tests { ); } + #[test] + fn shared_help_uses_resume_annotation_copy() { + let help = commands::render_slash_command_help(); + assert!(help.contains("Slash commands")); + assert!(help.contains("works with --resume SESSION.json")); + } + #[test] fn repl_help_includes_shared_commands_and_exit() { let help = render_repl_help(); + assert!(help.contains("REPL")); assert!(help.contains("/help")); assert!(help.contains("/status")); assert!(help.contains("/model [model]"));