grepai-trace-callers

yoanbernabeu/grepai-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers
0 commentsdiscussion
summary

This skill covers using grepai trace callers to find all code locations that call a specific function or method.

skill.md

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: --json and --toon are mutually exclusive.

Extraction Modes

GrepAI offers two extraction modes:

Fast Mode (Default)

Uses regex patterns. Fast and dependency-free.

grepai trace callers "Login" --mode fast

Precise Mode

Uses tree-sitter AST parsing. More accurate but requires tree-sitter.

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:

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

# 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

  1. Use more specific name:
grepai trace callers "getUserProfile"
  1. 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 who uses Login (trace)
grepai trace callers "Login"

Scripting Examples

Bash

# Count callers
grepai trace callers "MyFunction" --json | jq '.count'

# Get caller function names
grepai trace callers "MyFunction" --json | jq -r '.results[].caller'

# Get file paths only
grepai trace callers "MyFunction" --json | jq -r '.results[].file' | sort -u

Python

import subprocess
import json

result = subprocess.run(
    ['grepai', 'trace', 'callers', 'Login', '--json'],
    capture_output=True,
    text=True
)

data = json.loads(result.stdout)
print(f"Found {data['count']} callers of Login:")
for r in data['results']:
    print(f"  - {r['caller']} in {r['file']}:{r['line']}")

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:

🔍 Callers of "Login"

Mode: fast
Language files scanned: 245
how to use grepai-trace-callers

How to use grepai-trace-callers on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add grepai-trace-callers
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callers

The skills CLI fetches grepai-trace-callers from GitHub repository yoanbernabeu/grepai-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/grepai-trace-callers

Reload or restart Cursor to activate grepai-trace-callers. Access the skill through slash commands (e.g., /grepai-trace-callers) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.430 reviews
  • Jin Khan· Dec 12, 2024

    Keeps context tight: grepai-trace-callers is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Emma Rao· Dec 8, 2024

    grepai-trace-callers is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Chaitanya Patil· Dec 4, 2024

    grepai-trace-callers fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Kwame Jain· Nov 27, 2024

    Solid pick for teams standardizing on skills: grepai-trace-callers is focused, and the summary matches what you get after install.

  • Piyush G· Nov 23, 2024

    Registry listing for grepai-trace-callers matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Emma Thomas· Nov 19, 2024

    Useful defaults in grepai-trace-callers — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Min Diallo· Nov 11, 2024

    I recommend grepai-trace-callers for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Jin Torres· Nov 3, 2024

    grepai-trace-callers has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Advait Dixit· Oct 22, 2024

    Solid pick for teams standardizing on skills: grepai-trace-callers is focused, and the summary matches what you get after install.

  • Emma Bansal· Oct 18, 2024

    grepai-trace-callers has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 30

1 / 3