Deep codebase exploration using semantic search and relationship mapping
Deep codebase exploration using semantic search and relationship mapping to find relevant code, signatures, and connections. Use when you need to understand unfamiliar codebases or locate specific implementations without reading entire files.
/plugin marketplace add bartolli/codanna-plugins/plugin install codanna-cc@codanna-plugins<query>CLAUDE_PLUGIN_ROOT = !node -e "console.log(process.env.CLAUDE_PLUGIN_ROOT)"
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_PLUGIN_ROOT}/codanna-cc/scripts/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)⚠️ CRITICAL: Do NOT read entire files! Use offset/limit based on Location fields!
node ${CLAUDE_PLUGIN_ROOT}/codanna-cc/scripts/context-provider.js describe <relationship_symbol_name|symbol_id:ID>initialize_registry [symbol_id:123]", run: node ${CLAUDE_PLUGIN_ROOT}/codanna-cc/scripts/context-provider.js describe initialize_registry or describe symbol_id:123⚠️ CRITICAL: Do NOT read entire files! Use offset/limit based on Location fields!
Build 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.