
Grepai Trace Callers
List every file and line that calls a function before you refactor or change a public API.
Install
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callersWhat is this skill?
- Runs `grepai trace callers "FunctionName"` with human-readable caller list and file:line context
- Supports `--json` output with query, mode, count, and per-caller file and context fields
- Maps direct callers for refactor planning, dependency review, and exploration
- Surfaces calling sites across handlers, tests, and CLI entrypoints in one pass
Adoption & trust: 558 installs on skills.sh; 17 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Azure Diagnosticsmicrosoft/azure-skills
Diagnosemattpocock/skills
Systematic Debuggingobra/superpowers
Safe Debuglllllllama/rigorpilot-skills
Mastramastra-ai/skills
Insforge Debuginsforge/agent-skills
Journey fit
Common Questions / FAQ
Is Grepai Trace Callers safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Grepai Trace Callers
# 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 ```bash grepai trace callers "FunctionName" ``` ### Example ```bash 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: ```bash grepai trace callers "Login" --json ``` Output: ```json { "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) ```bash grepai trace callers "Login" --json --compact ``` Output: ```json { "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: ```bash 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:** `--json` and `--toon` are mutually exclusive. ## Extraction Modes GrepAI offers two extraction modes: ### Fast Mode (Default) Uses regex patterns. Fast and dependency-free. ```bash grepai trace callers "Login" --mode fast ``` ### Precise Mode Uses tree-sitter AST parsing. More accurate but requires tree-sitter. ```bash grepai trace callers "Login" --mode precise ``` ### Comparison | Mode | Speed | Accuracy | Dependencies | |------|-------|----------|--------------| | `fast` | ⚡⚡⚡ | Good | None | | `precise` | ⚡⚡ | Excellent | tree-sitter | ## Configuration Configure trace in `.grepai/config.yaml`: ```yaml trace: mode: fast # fast or precise enabled_languages: - .go - .js - .ts - .py - .php - .rs exclude_patterns: - "*_test.go" - "*.spec.ts" ``` ## 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 ```bash # Find all usages before renaming grepai trace callers "getUserById" # Check impact of changing signature grepai trace callers "processPayment" ``` ### Understanding Codebase ```bash # Who uses this co