codanna-codebase-intelligence
npx machina-cli add skill NickCrew/claude-cortex/codanna-codebase-intelligence --openclawCodanna Codebase Intelligence
Codanna indexes your codebase and provides semantic search, call graphs, and dependency analysis via MCP tools. Use codanna before grep/find - it understands code structure, not just text patterns.
When to Use
- Finding code: "Where do we handle authentication?" →
semantic_search_docs - Understanding dependencies: "What calls this function?" →
find_callers - Impact analysis: "What breaks if I change this?" →
analyze_impact - Exploring symbols: "Show me the Parser struct" →
find_symbol
Core Tools
Discovery
# Natural language search - finds code by intent, not keywords
semantic_search_docs query:"error handling patterns" limit:5
# Search symbols by name/pattern
search_symbols query:"parse" kind:"function"
# Get full details on a specific symbol
find_symbol name:"process_file"
Relationships
# Who calls this function? (upstream)
find_callers symbol:"validate_input"
# What does this function call? (downstream)
get_calls symbol:"process_request"
# Full dependency graph - what breaks if I change this?
analyze_impact symbol:"DatabaseConnection" depth:3
Documentation (RAG)
# Search indexed markdown/docs
search_documents query:"API authentication" collection:"docs"
Tool Selection Guide
| Task | Tool | Example |
|---|---|---|
| Find code by concept | semantic_search_docs | "database migrations" |
| Find symbol by name | search_symbols | Pattern: "auth*" |
| Get symbol details | find_symbol | Exact: "UserService" |
| Trace callers | find_callers | "Who uses this?" |
| Trace dependencies | get_calls | "What does this call?" |
| Assess refactor risk | analyze_impact | "What breaks?" |
Workflow Patterns
Before Refactoring
find_symbol- understand current implementationfind_callers- identify all usage sitesanalyze_impact- assess blast radius- Then proceed with changes
Understanding Unfamiliar Code
semantic_search_docs- "how does X work"find_symbol- get entry point detailsget_calls- trace execution flow
Finding Where to Add Code
semantic_search_docs- "similar patterns"find_callers- how existing code integrates- Follow established patterns
Why Codanna Over Grep
| Grep/Find | Codanna |
|---|---|
| Text matching | Semantic understanding |
| String "parse" matches comments | find_symbol finds the actual function |
| Manual call tracing | find_callers shows full graph |
| Guessing impact | analyze_impact shows dependencies |
Tips
- Start broad with
semantic_search_docs, then drill down withfind_symbol - Use
analyze_impactbefore any refactor touching shared code find_callerswith depth > 1 shows transitive callers- Results include file paths and line numbers - use for navigation
Source
git clone https://github.com/NickCrew/claude-cortex/blob/main/skills/codanna-codebase-intelligence/SKILL.mdView on GitHub Overview
Codanna Codebase Intelligence indexes your codebase to enable semantic search, call graphs, and dependency analysis using MCP tools. It helps you understand code structure before grepping or hunting with text patterns, improving accuracy and reducing waste.
How This Skill Works
Codanna relies on MCP tools to interpret code semantics. Semantic_search_docs performs intent-based searches, while search_symbols and find_symbol locate symbols and entry points. Then find_callers, get_calls, and analyze_impact map call relationships and assess risk before edits.
When to Use It
- Find code by concept using semantic_search_docs
- Understand who calls a function with find_callers
- Assess risk before refactoring with analyze_impact
- Explore a symbol like Parser using find_symbol
- Search indexed docs for API patterns with search_documents
Quick Start
- Step 1: semantic_search_docs query: concept limit:5
- Step 2: find_symbol name: EntryPoint
- Step 3: analyze_impact symbol: EntryPoint depth:3
Best Practices
- Start broad with semantic_search_docs, then drill down with find_symbol
- Run analyze_impact before any refactor touching shared code
- Use find_callers with depth > 1 to see transitive callers
- Rely on results that include file paths and line numbers for navigation
- Prefer tracing downstream with get_calls to see what a change affects
Example Use Cases
- Finding where authentication is handled with semantic_search_docs
- Question: Who calls a function? use find_callers
- What breaks if DatabaseConnection changes? use analyze_impact
- Show me the Parser struct with find_symbol
- Search docs for API authentication patterns with search_documents