When exploring this codebase, follow these rules strictly.
Prefer indexed and semantic tools first. Only fall back to raw text/pattern search when the better tools cannot answer the question.
At the beginning of a new codebase investigation, do these first when relevant:
- Call
lsp_capabilitiesto learn what navigation features are supported. - Call
get_indexer_criteriato learn which symbol kinds are indexed and summary-supported. - If the task is broad or the repo is unfamiliar, call
get_project_summary.
get_project_summaryfor repo/subsystem orientationget_file_summaryfor file responsibilityget_symbol_summaryfor symbol responsibilitysemantic_search(...)for behavior, intent, or conceptual lookupquery_symbols(...)for known or partial nameslsp_definition(...)for definitionslsp_declaration(...)for declarationslsp_implementation(...)for implementationslsp_references(...)for usageslsp_hover(...)for quick symbol info
lsp_document_symbols(...)only when you explicitly need a full symbol inventory for one file
- grep, glob, or raw pattern matching to find files or symbols
- direct pattern search as the first step
- expensive broad scans when indexed tools can narrow the scope first
- Use
semantic_search(...) - Inspect returned justifications
- Open the most relevant symbols/files with summary or LSP tools
- Use
query_symbols(...) - Then use
get_symbol_summary(...)or LSP navigation tools
- Use
get_file_summary(...) - Then use symbol/LSP tools inside that area
- Find the symbol with
query_symbols(...)orsemantic_search(...) - Use
lsp_references(...) - Use
lsp_definition(...)/lsp_implementation(...)as needed
- If a summary indicates it may be stale, refresh it before relying on it.
- Use
refresh_project_summaryorrefresh_file_summarywhen freshness matters.
- Do not use raw text search first when
semantic_search,query_symbols, summaries, or LSP tools can answer the question. - Do not use
lsp_document_symbolsby default on large files. - Always explain briefly why a chosen tool is the highest-signal next step.
- Prefer narrowing the search space before opening large files.
- When multiple tools could work, choose the cheapest high-signal tool first.
- Capabilities and index coverage:
lsp_capabilitiesget_indexer_criteria
- High-level orientation:
get_project_summary
- Find candidates:
semantic_search(...)orquery_symbols(...)
- Understand candidates:
get_file_summary(...)/get_symbol_summary(...)
- Navigate precisely:
lsp_definition(...),lsp_references(...),lsp_implementation(...),lsp_hover(...)
- Only if needed:
- raw pattern search
When reporting findings:
- State which tool you chose and why
- Prefer concise reasoning
- Mention when a summary may be stale
- Mention when you are falling back to raw search and why the preferred tools were insufficient