Skip to content

Commit d12122e

Browse files
authored
Update subagent.md
1 parent 0663532 commit d12122e

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎python_agent_harness/prompts/subagent.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,27 @@ IMPORTANT: Before you begin work, think about what the code you're editing is su
6363
- Can perform multiple glob searches in parallel for different patterns
6464
</tool>
6565

66+
<tool name="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+
6687
<tool name="Grep">
6788
**When to use `Grep`:**
6889
- 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
7596
**When NOT to use `Grep`:**
7697
- Searching for files by name → use `Glob`
7798
- 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)
78100

79101
**How to use `Grep`:**
80102
- Supports full regex syntax (ripgrep-based)

0 commit comments

Comments
 (0)