grepai-trace-callers
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
By yoanbernabeu · 712 installs
npx skills add yoanbernabeu/grepai-skills --skill grepai-trace-callers
Source repository · Upstream listing
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: json and toon are 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
Mode Speed Accuracy Dependencies
fast ⚡⚡⚡ Good None
precise ⚡⚡ Excellent tree sitter
Configuration
Configure trace in .grepai/config.yaml :
Supported Languages
Language Extensions
Go .go
JavaScript .js , .jsx
TypeScript .ts , .tsx
Python .py
PHP .php
C/C++ .c , .h , .cpp , .hpp , .cc , .cxx
Rust .rs
Zig .zig
C .cs
Java .java
Pascal/Delphi .pas , .dpr
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
1. Use more specific name:
2. 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 watch to 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 precise for better accuracy
Check if files are in ignore patterns
Best Practices
1. Use exact function name: Case matters
2. Check symbol index: Run grepai watch first
3. Use JSON for scripts: Easier to parse
4. Combine with search: Semantic + trace = full picture
5. Filter large results: Use jq or grep
Output Format
Trace callers result: