From b0edaf77f2fc4d96c3bdd13f7aff2e6463746743 Mon Sep 17 00:00:00 2001 From: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:06:03 -0400 Subject: [PATCH] Add hint for focus mode when used on file paths for `analyze` tool (#5069) --- crates/goose-mcp/src/developer/analyze/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/goose-mcp/src/developer/analyze/mod.rs b/crates/goose-mcp/src/developer/analyze/mod.rs index a6dccd7a..9c30a336 100644 --- a/crates/goose-mcp/src/developer/analyze/mod.rs +++ b/crates/goose-mcp/src/developer/analyze/mod.rs @@ -318,6 +318,14 @@ impl CodeAnalyzer { outgoing_chains: &outgoing_chains, }; - Ok(Formatter::format_focused_output(&focus_data)) + let mut output = Formatter::format_focused_output(&focus_data); + + if path.is_file() { + let hint = "NOTE: Focus mode works best with directory paths. \ + Use a parent directory in the path for cross-file analysis.\n\n"; + output = format!("{}{}", hint, output); + } + + Ok(output) } }