MCPInstall

grepai-trace-callees

Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.

Installs
765
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callees
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads grepai-trace-callees automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

GrepAI Trace Callees

This skill covers using grepai trace callees to find all functions called by a specific function.

When to Use This Skill

  • Understanding function dependencies
  • Mapping function behavior
  • Finding deeply nested dependencies
  • Code comprehension and documentation

What is Trace Callees?

grepai trace callees answers: "What does this function call?"

func ProcessOrder(order) {
    validateOrder(order)
    calculateTotal(order)
    sendConfirmation(order.email)
}
        │
        ↓
┌───────┴───────────────────┐
│  What does ProcessOrder   │
│  call?                    │
├───────────────────────────┤
│ • validateOrder           │
│ • calculateTotal          │
│ • sendConfirmation        │
└───────────────────────────┘

Basic Usage

grepai trace callees "FunctionName"

Example

grepai trace callees "ProcessOrder"

Output:

🔍 Callees of "ProcessOrder"

Found 4 callees:

1. validateOrder
   File: services/order.go:45
   Context: validateOrder(order)

2. calculateTotal
   File: services/order.go:48
   Context: total := calculateTotal(order.Items)

3. applyDiscount
   File: services/order.go:51
   Context: total = applyDiscount(total, order.Coupon)

4. sendConfirmation
   File: services/order.go:55
   Context: sendConfirmation(order.Email, total)

JSON Output

grepai trace callees "ProcessOrder" --json

Output:

{
  "query": "ProcessOrder",
  "mode": "callees",
  "count": 4,
  "results": [
    {
      "file": "services/order.go",
      "line": 45,
      "callee": "validateOrder",
      "context": "validateOrder(order)"
    },
    {
      "file": "services/order.go",
      "line": 48,
      "callee": "calculateTotal",
      "context": "total := calculateTotal(order.Items)"
    },
    {
      "file": "services/order.go",
      "line": 51,
      "callee": "applyDiscount",
      "context": "total = applyDiscount(total, order.Coupon)"
    },
    {
      "file": "services/order.go",
      "line": 55,
      "callee": "sendConfirmation",
      "context": "sendConfirmation(order.Email, total)"
    }
  ]
}

Compact JSON (AI Optimized)

grepai trace callees "ProcessOrder" --json --compact

Output:

{
  "q": "ProcessOrder",
  "m": "callees",
  "c": 4,
  "r": [
    {"f": "services/order.go", "l": 45, "fn": "validateOrder"},
    {"f": "services/order.go", "l": 48, "fn": "calculateTotal"},
    {"f": "services/order.go", "l": 51, "fn": "applyDiscount"},
    {"f": "services/order.go", "l": 55, "fn": "sendConfirmation"}
  ]
}

TOON Output (v0.26.0+)

TOON format offers ~50% fewer tokens than JSON:

grepai trace callees "ProcessOrder" --toon

Note: --json and --toon are mutually exclusive.

Extraction Modes

Fast Mode (Default)

grepai trace callees "ProcessOrder" --mode fast

Precise Mode

grepai trace callees "ProcessOrder" --mode precise
ModeSpeedAccuracyDependencies
fast⚡⚡⚡GoodNone
precise⚡⚡Excellenttree-sitter

Use Cases

Understanding Function Behavior

# What does this complex function do?
grepai trace callees "handleRequest"

# Map the data flow
grepai trace callees "processPayment"

Finding Dependencies

# What external services does this call?
grepai trace callees "syncData"

# What database operations happen?
grepai trace callees "saveUser"

Code Review

# What side effects does this function have?
grepai trace callees "updateProfile"

# Is this function doing too much?
grepai trace callees "doEverything"  # Lots of callees = code smell

Documentation

# Generate dependency list for docs
grepai trace callees "initialize" --json | jq '.results[].callee'

Callers vs Callees

CommandQuestionUse Case
trace callersWho calls me?Impact analysis
trace calleesWhat do I call?Behavior analysis
# Combined analysis
grepai trace callers "processOrder"   # Who uses this?
grepai trace callees "processOrder"   # What does it do?

Filtering Results

By File Type

# Get callees and filter to only .go files
grepai trace callees "main" --json | jq '.results[] | select(.file | endswith(".go"))'

Exclude Test Functions

grepai trace callees "Login" --json | jq '.results[] | select(.callee | startswith("Test") | not)'

Count by Category

# Count how many database vs. API calls
grepai trace callees "processOrder" --json | jq '.results[].callee' | grep -c "db"

What Callees Includes

The trace finds:

  • Direct function calls
  • Method calls
  • Built-in function calls (depending on mode)

Example

func ProcessOrder(order Order) error {
    // Direct call
    validateOrder(order)

    // Method call
    order.Validate()

    // Package function
    utils.Log("processing")

    // Built-in (may or may not be captured)
    fmt.Println("done")

    return nil
}

Callees found:

  • validateOrder
  • Validate (method)
  • Log (from utils)
  • Println (depending on mode)

Limitations

What Callees Might Miss

  • Dynamic/runtime calls
  • Callbacks and closures
  • Interface method calls (may show interface, not implementation)
  • Reflection-based calls

Example of Undetected Call

func process(fn func()) {
    fn()  // Callee is unknown at static analysis time
}

Combining with Trace Graph

For recursive dependency analysis, use trace graph:

# Direct callees only
grepai trace callees "main"

# Full dependency tree (recursive)
grepai trace graph "main" --depth 3

Scripting Examples

List All Callees

grepai trace callees "main" --json | jq -r '.results[].callee' | sort -u

Check for Specific Callee

# Does processOrder call sendEmail?
grepai trace callees "processOrder" --json | jq -e '.results[] | select(.callee == "sendEmail")' && echo "Yes" || echo "No"

Generate Dependency Report

#!/bin/bash
echo "# Function Dependencies Report"
echo ""
for fn in main initialize processOrder; do
    echo "## $fn"
    grepai trace callees "$fn" --json | jq -r '.results[].callee' | sed 's/^/- /'
    echo ""
done

Common Issues

❌ Problem: Function not found ✅ Solution: Check spelling and ensure function exists in indexed files

❌ Problem: No callees found (but function has calls) ✅ Solutions:

  • Try --mode precise
  • Check language is in enabled_languages
  • Ensure symbols.gob is up to date (grepai watch)

❌ Problem: Missing some callees ✅ Solution: Use --mode precise for better accuracy

Best Practices

  1. Use for understanding: Great for learning new codebases
  2. Combine with callers: Full dependency picture
  3. Use graph for deep analysis: When you need recursion
  4. Filter results: Focus on relevant callees
  5. Document findings: Export to markdown for docs

Output Format

Trace callees result:

🔍 Callees of "ProcessOrder"

Mode: fast
Function found in: services/order.go:40

Found 4 callees:

1. validateOrder
   File: services/order.go:45
   Context: validateOrder(order)

2. calculateTotal
   File: services/order.go:48
   Context: total := calculateTotal(order.Items)

3. applyDiscount
   File: services/order.go:51
   Context: total = applyDiscount(total, order.Coupon)

4. sendConfirmation
   File: services/order.go:55
   Context: sendConfirmation(order.Email, total)

Tip: Use 'grepai trace graph ProcessOrder' for recursive analysis

FAQ

What does the grepai-trace-callees skill do?

Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.

How do I install grepai-trace-callees?

Run npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-trace-callees in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/grepai-trace-callees/ (personal) or .claude/skills/grepai-trace-callees/ (project).

Which AI agents can use grepai-trace-callees?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is grepai-trace-callees safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains grepai-trace-callees?

It is published by yoanbernabeu in yoanbernabeu/grepai-skills. It has 765 recorded installs.

More from yoanbernabeu/grepai-skills

View all →

grepai-search-basics

yoanbernabeu/grepai-skills

Basic semantic code search with GrepAI. Use this skill to learn fundamental search commands and concepts.

grepai-search-advanced

yoanbernabeu/grepai-skills

Advanced search options in GrepAI. Use this skill for JSON output, compact mode, and AI agent integration.

AI & Agents828 installs

grepai-trace-graph

yoanbernabeu/grepai-skills

Build complete call graphs with GrepAI trace. Use this skill for recursive dependency analysis.

805 installs

grepai-ollama-setup

yoanbernabeu/grepai-skills

Install and configure Ollama for local embeddings with GrepAI. Use this skill when setting up private, local embedding generation.

AI & Agents799 installs

grepai-trace-callers

yoanbernabeu/grepai-skills

Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.

787 installs

grepai-search-tips

yoanbernabeu/grepai-skills

Tips and best practices for effective GrepAI searches. Use this skill to improve search result quality.

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs