grepai-trace-callers
БесплатноБез исполняемых скриптовНе проверенFind function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
от yoanbernabeu★ 20 звёзд на GitHubОб этом скилле
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?"
func Login(user, pass) {...}
↑
│
┌───────┴───────────────────┐
│ Who calls Login()? │
├───────────────────────────┤
│ • HandleAuth (auth.go:42) │
│ • TestLogin (test.go:15) │
│ • CLI (main.go:88) │
└───────────────────────────┘
Basic Usage
grepai trace callers "FunctionName"
Example
grepai trace callers "Login"
Output:
🔍 Callers of "Login"
Found 3 callers:
1. HandleAuth
File: handlers/auth.go:42
Context: user.Login(ctx, credentials)
2. TestLoginSuccess
File: handlers/auth_test.go:15
Context: result := Login(testUser, testPass)
3. RunCLI
File: cmd/main.go:88
Context: err := auth.Login(username, password)
JSON Output
For programmatic use:
grepai trace callers "Login" --json
Output:
{
"query": "Login",
"mode": "callers",
"count": 3,
"results": [
{
"file": "handlers/auth.go",
"line": 42,
"caller": "HandleAuth",
"context": "user.Login(ctx, credentials)"
},
{
"file": "handlers/auth_test.go",
"line": 15,
"caller": "TestLoginSuccess",
"context": "result := Login(testUser, testPass)"
},
{
"file": "cmd/main.go",
"line": 88,
"caller": "RunCLI",
"context": "err := auth.Login(username, password)"
}
]
}
Compact JSON (AI Optimized)
grepai trace callers "Login" --json --compact
Output:
{
"q": "Login",
"m": "callers",
"c": 3,
"r": [
{"f": "handlers/auth.go", "l": 42, "fn": "HandleAuth"},
{"f": "handlers/auth_test.go", "l": 15, "fn": "TestLoginSuccess"},
{"f": "cmd/main.go", "l": 88, "fn": "RunCLI"}
]
}
TOON Output (v0.26.0+)
TOON format offers ~50% fewer tokens than JSON:
grepai trace callers "Login" --toon
Output:
callers[3]:
- call_site:
context: "user.Login(ctx, credentials)"
file: handlers/auth.go
line: 42
symbol:
name: HandleAuth
...
Note:
--jsonand--toonare mutually exclusive.
Extraction Mode
Symbols and calls are always extracted with regular expressions (the "fast" extractor used by grepai watch and grepai index); output reports "mode": "fast". The --mode flag is deprecated since grepai 1.0.0: it is still accepted for existing scripts, prints a deprecation warning and changes nothing. Do not pass --mode precise.
Configuration
Configure trace in .grepai/config.yaml:
trace:
enabled_languages:
- .go
- .js
- .ts
- .py
- .php
- .rs
To keep files (tests, generated code) out of the symbol index, use the top-level ignore list. trace.mode and trace.exclude_patterns never had any effect and were removed in grepai 1.0.0.
Supported Languages
| Language | Extensions |
|---|---|
| Go | .go |
| JavaScript | .js, .jsx |
| TypeScript | .ts, .tsx |
| Vue SFC | .vue |
| Python | .py |
| PHP | .php |
| Lua | .lua |
| Java | .java |
| C/C++ | .c, .h, .cpp, .hpp, .cc, .cxx, .hxx |
| Rust | .rs |
| Zig | .zig |
| C# | .cs |
| F# | .fs, .fsx, .fsi |
| Pascal/Delphi | .pas, .dpr |
| Ruby | .rb |
| GDScript | .gd |
A config created by an older version may lack newer extensions (.vue, .lua, .java, F#, .rb, .gd): add them to trace.enabled_languages by hand.
Use Cases
Before Refactoring
# Find all usages before renaming
grepai trace callers "getUserById"
# Check impact of changing signature
grepai trace callers "processPayment"
Understanding Codebase
# Who uses this core function?
grepai trace callers "validateToken"
# Find entry points to a module
grepai trace callers "initialize"
Debugging
# Where is this function called from?
grepai trace callers "problematicFunction"
Code Review
# Verify function usage before approving changes
grepai trace callers "deprecatedMethod"
Handling Common Names
If your function name is common, results may include unrelated code:
Problem
grepai trace callers "get" # Too common, many false positives
Solutions
- Use more specific name:
grepai trace callers "getUserProfile"
- Filter results by path:
grepai trace callers "get" --json | jq '.results[] | select(.file | contains("auth"))'
Combining with Semantic Search
Use together for comprehensive understanding:
# Find what Login does (semantic)
grepai search "user login authentication"
# Find w
Установить grepai-trace-callers в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл grepai-trace-callers?
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
Как установить скилл grepai-trace-callers?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл grepai-trace-callers запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic