| name | Exploration Tools |
| description | Tool definitions and usage patterns for codebase exploration (Glob, Grep, Read, LSP). Agents reference this skill instead of inline tool definitions. |
| version | 2.0.0 |
Provide standardized tool definitions and usage patterns for codebase exploration. This skill centralizes tool knowledge that was previously duplicated across agents, ensuring consistent search strategies and result formatting.
Fast file pattern matching for finding files by name
Glob pattern (e.g., **/*.ts, src/**/*.md)
Directory to search in (defaults to cwd)
Find files by name pattern when you know the file extension or naming convention
Pattern: **/*.tsx
Result: All TypeScript React files in the project
Content search with regex support across files
Regex pattern to search for
File or directory to search in
Filter files by glob pattern
File type filter (js, py, rust, etc.)
content, files_with_matches (default), or count
Lines after match
Lines before match
Lines of context around match
Case insensitive search
Enable multiline matching for cross-line patterns
Search file contents for patterns, keywords, or code constructs
Pattern: useState
Glob: **/*.tsx
Result: All useState usages in React components
Read file contents with optional line range
Absolute path to file
Starting line number
Number of lines to read
View file contents after locating with Glob or Grep
file_path: /path/to/file.ts
offset: 50
limit: 30
Result: Lines 50-80 of the file
Navigate to symbol definition using Language Server Protocol
File containing the symbol reference
Line number of the reference
Column position of the reference
Find where a function, class, or variable is defined
Find all references to a symbol using Language Server Protocol
File containing the symbol definition
Line number of the definition
Column position of the definition
Find all usages of a function, class, or variable across the codebase
Get all symbols in a document using Language Server Protocol
File to analyze
Get an overview of classes, functions, and variables in a file
Choosing appropriate search boundaries to balance speed and completeness
Narrow: Single file or directory
Medium: File type across project
Broad: All files in project
Start narrow, expand only if results are insufficient
</example>
Prioritizing search results by relevance
High relevance: Exact matches, definition sites
Medium relevance: Usage sites, related patterns
Low relevance: Comments, test files, generated code
Pattern for finding files by name or extension
1. Use Glob with pattern to find candidate files
2. Filter results by relevance
3. Read specific files for details
Pattern for searching file contents
1. Use Grep with pattern and file type filter
2. Review matches with context (-C flag)
3. Follow up with Read for full file context
Pattern for navigating code symbols
1. Use LSP_goToDefinition to find symbol source
2. Use LSP_findReferences to find usages
3. Use LSP_documentSymbol for file overview
<decision_tree name="tool_selection">
What type of search is needed?
Use Glob
Use Grep
Use LSP_goToDefinition or Serena find_symbol
Use LSP_findReferences or Serena find_referencing_symbols
Use Read
</decision_tree>
<best_practices>
Use Glob for file discovery, Grep for content search
Always return file:line references for findings
Start with narrow search scope, expand if needed
Use LSP tools when available for accurate symbol navigation
Filter out binary and generated files
Limit results to manageable size using head_limit
</best_practices>
<anti_patterns>
Searching entire codebase without filters
Start with file type or directory filters
Reading files without first using Glob/Grep to locate them
Use search tools to find relevant files first
Returning matches without surrounding context
Use -C flag with Grep or read surrounding lines
Exploration operations must be read-only; never modify files during search
Always use absolute file paths in Read tool calls
Keep guidance evidence-based and version-aware
Prefer Grep over shell grep/rg commands for consistent behavior
Prefer project conventions over generic defaults
<error_escalation inherits="core-patterns#error_escalation">
Minor inconsistency
Ambiguous guidance
Conflicting constraints
Unsafe or misleading retrieval guidance
</error_escalation>
<related_agents>
Locate relevant code patterns
Review output consistency
</related_agents>
Return file paths with line numbers for all findings
Limit results to manageable size
Maintain read-only operations during exploration
Modifying files during exploration
Returning raw dumps without filtering
Searching binary or generated files
<related_skills>
Alternative symbol navigation via Serena MCP
Evidence collection methodology using these tools
</related_skills>