2.4 KiB
2.4 KiB
description, argument-hint
| description | argument-hint |
|---|---|
| Smart semantic search for code with full context | <query> |
Search Query Analysis
User's Original Query: "$ARGUMENTS"
Query Optimization
Claude, analyze the query above and improve it for code search:
- If vague (e.g., "that parsing thing") → Make it specific (e.g., "language parser implementation")
- If a question (e.g., "how does parsing work?") → Extract keywords (e.g., "parsing implementation process")
- If conversational (e.g., "the stuff that handles languages") → Use technical terms (e.g., "language handler processor")
- If too broad (e.g., "errors") → Add context (e.g., "error handling exception management")
YourOptimizedQuery: {Claude: Write your improved query here, then use it below}
Execute this command with your optimized query:
Your task
Use the Bash tool to perform semantic code search.
Workflow:
- Execute:
node .claude/scripts/context-provider.js find "$YourOptimizedQuery" --limit=5 - Analyze the results with their relevance scores
- To see actual implementation of interesting results:
- Use the line range from the Location field to read just the relevant code
- Example: If you see "Location:
src/io/exit_code.rs:108-120" - Execute:
sed -n '108,120p' src/io/exit_code.rsto read lines 108-120 - This shows the actual code implementation, not just the signature
- When relationships are shown (called_by, calls, defines, implements):
- If a relationship looks relevant to answering the query, investigate it
- Execute:
node .claude/scripts/context-provider.js symbol <relationship_symbol_name> - Example: If you see "Called by:
initialize_registry", run:node .claude/scripts/context-provider.js symbol initialize_registry
- Build a complete picture by following 1-2 key relationships and reading relevant code sections
- Present findings to the user with context from search results, relationships, and actual code snippets
The results include:
- Relevance scores (how well each result matches the query)
- Symbol documentation and signatures
- Relationships (who calls this, what it calls, what it defines)
- System guidance for follow-up investigation
Tips:
- Add
--lang=rust(or python, typescript, etc.) to narrow results by language - Follow relationships that appear in multiple results (they're likely important)
- Use the
symbolcommand to get full details about interesting relationships