Deep codebase exploration using semantic search and relationship mapping
Performs deep codebase exploration using semantic search and relationship mapping to find relevant code, then guides you to investigate implementations and connections. Use when you need to understand how specific features, patterns, or concepts are implemented across the codebase.
/plugin marketplace add bartolli/codanna-plugins/plugin install codanna@codanna-plugins<query>User's Original Query: "$ARGUMENTS"
Codanna's semantic search works best with technical terms and specific concepts. Analyze the query above and improve it for code search:
OptimizedQuery: {Claude: Write your improved query here, then use it below}
Execute this command with your optimized query:
Use the Bash tool to perform semantic code search:
Execute: node .claude/scripts/codanna/context-provider.js find "$OptimizedQuery" --limit=5
What Codanna returns:
Analyze the results with their relevance scores (focus on results with score > 0.6 (if possible))
To see actual implementation of interesting results:
src/io/exit_code.rs:108-120"file_path: src/io/exit_code.rs (use the working directory from your environment context <env> to construct the absolute path)offset: 108 (start line)limit: 13 (calculated as: 120 - 108 + 1)limit = end_line - start_line + 1Read(file_path="/full/path/to/src/io/exit_code.rs", offset=108, limit=13)When relationships are shown (called_by, calls, defines, implements):
node .claude/scripts/codanna/context-provider.js describe <relationship_symbol_name|symbol_id:ID>initialize_registry [symbol_id:123]", run: node .claude/scripts/codanna/context-provider.js describe initialize_registry or describe symbol_id:123Build a complete picture by following key relationships and reading relevant code sections
If needed, repeat <Step_1: GatherContext> with a refined query based on what you learned.
The results include:
sed (native on unix only):
You can also see actual implementation with sed: (works native on Unix based environments):
src/io/exit_code.rs:108-120"sed -n '108,120p' src/io/exit_code.rs to read lines 108-120Add --lang=rust (or python, typescript, etc.) to narrow results by language if you work on multi-language projects
Follow relationships that appear in multiple results (they're likely important)
Use the describe command to get full details about interesting relationships
Token awareness:
This command is for exploration:
Based on the gathered context, engage with the user to narrow focus and help the user with further request.