GrepAI Trace Callers
This skill covers using grepai trace callers to find all code locations that call a specific function or method.
When to Use This Skill
- Finding all usages of a function before refactoring
- Understanding function dependencies
- Impact analysis before changes
- Code navigation and exploration
What is Trace Callers?
grepai trace callers answers: "Who calls this function?"
Basic Usage
Example
Output:
JSON Output
For programmatic use:
Output:
Compact JSON (AI Optimized)
Output:
TOON Output (v0.26.0+)
TOON format offers ~50% fewer tokens than JSON:
Output:
Note:
--jsonand--toonare mutually exclusive.
Extraction Modes
GrepAI offers two extraction modes:
Fast Mode (Default)
Uses regex patterns. Fast and dependency-free.
Precise Mode
Uses tree-sitter AST parsing. More accurate but requires tree-sitter.
Comparison
Configuration
Configure trace in .grepai/config.yaml:
Supported Languages
Use Cases
Before Refactoring
Understanding Codebase
Debugging
Code Review
Handling Common Names
If your function name is common, results may include unrelated code:
Problem
Solutions
- Use more specific name:
- Filter results by path:
Combining with Semantic Search
Use together for comprehensive understanding:
Scripting Examples
Bash
Python
Common Issues
❌ Problem: No callers found ✅ Solutions:
- Check function name spelling (case-sensitive)
- Ensure file type is in
enabled_languages - Run
grepai watchto update symbol index
❌ Problem: Too many false positives ✅ Solutions:
- Use more specific function name
- Add exclude patterns in config
- Filter results with
jq
❌ Problem: Missing some callers ✅ Solutions:
- Try
--mode precisefor better accuracy - Check if files are in ignore patterns
Best Practices
- Use exact function name: Case matters
- Check symbol index: Run
grepai watchfirst - Use JSON for scripts: Easier to parse
- Combine with search: Semantic + trace = full picture
- Filter large results: Use
jqor grep
Output Format
Trace callers result:


