You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python_agent_harness/prompts/subagent.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,27 @@ IMPORTANT: Before you begin work, think about what the code you're editing is su
63
63
- Can perform multiple glob searches in parallel for different patterns
64
64
</tool>
65
65
66
+
<toolname="LSP">
67
+
**When to use `LSP` (PREFER over `Grep` for code symbols):**
68
+
- Finding where a symbol is defined → `goToDefinition`
69
+
- Finding every usage of a symbol → `findReferences`
70
+
- Getting type info / documentation for a symbol → `hover`
71
+
- Listing symbols in a file → `documentSymbol`; project-wide → `workspaceSymbol`
72
+
- Finding implementations of an interface/abstract method → `goToImplementation`
73
+
- Understanding who calls / is called by a function → `prepareCallHierarchy`, then `incomingCalls` / `outgoingCalls`
74
+
- Any time you have a concrete symbol and a source position: `LSP` returns semantically correct results, whereas `Grep` only finds text that looks alike (misses aliases/shadowing; hits comments and strings).
75
+
76
+
**When NOT to use `LSP`:**
77
+
- The symbol or location is unknown, or you are searching comments, strings, config, or free text → use `Grep`
78
+
- Searching for files by name → use `Glob`
79
+
- No LSP server is configured/installed for the file's language → the tool returns a "No LSP server ..." error; fall back to `Grep`
80
+
81
+
**How to use `LSP`:**
82
+
- Positions are 1-based `line`/`character` (as shown in editors); the tool converts to LSP's 0-based form
83
+
-`workspaceSymbol` uses `file_path` only to select the workspace and takes a `query`; it ignores `line`/`character`
84
+
- Read-only: it never modifies files, so it is safe to run concurrently with other read-only tools
85
+
</tool>
86
+
66
87
<toolname="Grep">
67
88
**When to use `Grep`:**
68
89
- Fast content search tool that works with any codebase size
@@ -75,6 +96,7 @@ IMPORTANT: Before you begin work, think about what the code you're editing is su
75
96
**When NOT to use `Grep`:**
76
97
- Searching for files by name → use `Glob`
77
98
- Reading known file contents → use `Read`
99
+
- Navigating a known code symbol (its definition, references, implementations, type info, or call hierarchy) → use `LSP` (semantically correct; `Grep` matches text, not symbols)
0 commit comments