# rust-call-graph

Builds a Rust function call graph through LSP: who calls a function and what it calls. Useful when reading unfamiliar code or checking what a change will touch.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3200 installs · ★ 1545
- Author: actionbook
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/actionbook/rust-skills/tree/HEAD/skills/rust-call-graph/SKILL.md
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/skills/rust-call-graph

## What it does

The skill maps relationships between Rust functions using LSP call hierarchy. You pass a function name, it locates the definition, prepares the hierarchy and expands it to the depth you ask for. Output comes as a tree, a box diagram, a flat list or Mermaid you can drop into docs.

Direction is set with `--direction in` for callers, `out` for callees, `both` for the full picture. Traversal depth is `--depth N`, default 3 levels. Once the graph is drawn, the skill adds a short read: entry points, leaf functions, the hot path, and spots worth a second look such as a function with unusually high fan-out.

It runs on the LSP tool, so a Rust language server has to be running against an open project — without indexing there is no call hierarchy to walk. Dynamic dispatch shows up as a marker in the tree rather than a concrete implementation. The skill reads files and globs for symbols; it does not edit your code.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-call-graph -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/rust-call-graph/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/rust-call-graph/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-call-graph -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/rust-call-graph/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-call-graph -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/rust-call-graph/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install actionbook/rust-skills rust-call-graph
```

2. **Manually: put the files in place**
- File: `.github/skills/rust-call-graph/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-call-graph -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/actionbook/rust-skills --path skills/rust-call-graph
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/rust-call-graph/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill rust-call-graph -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/actionbook/rust-skills/tree/HEAD/skills/rust-call-graph/SKILL.md

## When to use it
- find every call site of a function before changing its signature
- trace the execution path from `main` down to a handler
- spot overloaded functions by their fan-out
- export a call graph to Mermaid for docs
- get oriented in an unfamiliar Rust codebase through its call tree

## Example prompts
- /rust-call-graph process_request
- /rust-call-graph handle_error --direction in
- /rust-call-graph main --direction out --depth 5

## Similar
- [rust-analyzer-lsp](https://affpapa.org/en/nevibecode/plugins/rust-analyzer-lsp.md) — plugin · ★ 44635
- [lsp-code-analysis](https://affpapa.org/en/nevibecode/skills/lsp-code-analysis.md) — skill · 920 installs
- [grepai-trace-graph](https://affpapa.org/en/nevibecode/skills/grepai-trace-graph.md) — skill · 802 installs
- [lsp-setup](https://affpapa.org/en/nevibecode/skills/lsp-setup.md) — skill · 1100 installs
- [rust-best-practices](https://affpapa.org/en/nevibecode/skills/rust-best-practices.md) — skill · 21100 installs
- [rust-skills](https://affpapa.org/en/nevibecode/skills/rust-skills.md) — skill · 6500 installs

From the same set: [actionbook/rust-skills](https://affpapa.org/en/nevibecode/by/actionbook/rust-skills.md) — 35 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
