npx skills add ...
npx skills add yoanbernabeu/grepai-skills --skill grepai-trace-callers
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
npx skills add yoanbernabeu/grepai-skills --skill grepai-trace-callers
This skill covers using grepai trace callers to find all code locations that call a specific function or method.
grepai trace callers answers: "Who calls this function?"
Output:
For programmatic use:
Output:
Output:
TOON format offers ~50% fewer tokens than JSON:
Output:
Note:
--jsonand--toonare mutually exclusive.
GrepAI offers two extraction modes:
Uses regex patterns. Fast and dependency-free.
Uses tree-sitter AST parsing. More accurate but requires tree-sitter.
| Mode | Speed | Accuracy | Dependencies |
|---|---|---|---|
fast | ⚡⚡⚡ | Good | None |
precise | ⚡⚡ | Excellent | tree-sitter |
Configure trace in .grepai/config.yaml:
| 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 |
If your function name is common, results may include unrelated code:
Use together for comprehensive understanding:
❌ Problem: No callers found ✅ Solutions:
enabled_languagesgrepai watch to update symbol index❌ Problem: Too many false positives ✅ Solutions:
jq❌ Problem: Missing some callers ✅ Solutions:
--mode precise for better accuracygrepai watch firstjq or grepTrace callers result: