serena
Semantic code search, analysis, and editing. Use for understanding code structure, finding classes/functions, refactoring, and impact analysis. Triggers on "where is this function", "show references", "analyze impact" queries
When & Why to Use This Skill
Serena is a high-performance semantic code search and analysis tool designed to streamline navigation and editing in large-scale codebases. By operating at the symbol level, it allows developers to understand complex code structures, track dependencies, and perform precise refactoring without the overhead of reading entire files, making it an essential utility for impact analysis and architectural exploration.
Use Cases
- Large-scale Codebase Navigation: Quickly locate the definitions of classes, functions, or variables across hundreds of files using semantic symbol search.
- Impact Analysis for Refactoring: Trace all callers and referencing symbols of a specific function to evaluate the potential side effects of a code change.
- Surgical Code Editing: Perform precise modifications at the symbol level, ensuring accuracy while maintaining a minimal context footprint.
- Pattern and Debt Discovery: Search for specific code patterns, API endpoint usages, or technical debt like TODO comments throughout the entire repository.
- Dependency Mapping: Build a comprehensive understanding of how different components interact by tracing dependency chains and symbol references.
| name | serena |
|---|---|
| description | Semantic code search, analysis, and editing. Use for understanding code structure, finding classes/functions, refactoring, and impact analysis. Triggers on "where is this function", "show references", "analyze impact" queries |
Serena Tool Guide
Semantic code analysis. Searches and edits at symbol level without reading entire files.
Core Tools
find_symbol
Locate class, function, or variable definitions.
Examples:
- "Where is the UserService class defined?"
- "Find the authenticate function definition"
search_for_pattern
Search for code patterns or strings.
Examples:
- "Find all TODO comments"
- "Locate all API endpoint usages"
edit_symbol
Edit at symbol level without loading entire files.
find_referencing_symbols
Track symbol references and dependencies.
Examples:
- "Show all callers of this function"
- "Find dependency chain"
When to Use
- Large codebases (100+ files)
- Semantic search (understanding code meaning)
- Refactoring (precise edits required)
- Dependency tracking
- Code structure analysis
Common Workflows
Code understanding:
find_symbolto locate main classes/functionsfind_referencing_symbolsto trace callers- Build overall understanding
Refactoring:
find_symbolto identify targetedit_symbolto modifyfind_referencing_symbolsto verify impact
Bug fixing:
search_for_patternto find error-related codefind_symbolto examine detailsedit_symbolto fix
Examples
User: Find authentication code
Agent: Uses Serena to search for authentication-related code and explains
User: What calls UserService?
Agent: Shows all references
User: Refactor this code
Agent: Analyzes impact and proposes changes