When you need to understand who calls a Rust function or what it calls, this skill uses LSP to build visual call hierarchies. You can trace callers (impact analysis), callees (implementation flow), or both, with configurable depth. It's especially handy when refactoring or trying to understand execution paths in unfamiliar code. The ASCII tree diagrams are clear and the bidirectional view gives you the full picture of a function's role in your codebase. One nice touch: it provides analysis like hot paths and complexity metrics after showing the graph, so you get context beyond just the visualization.

skills.sh installs
699
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill rust-call-graph --agent claude-code

Installs into .claude/skills of the current project.

Files

Rust Call Graph

Visualize function call relationships using LSP call hierarchy.

Usage

/rust-call-graph <function_name> [--depth N] [--direction in|out|both]

Options:

  • --depth N: How many levels to traverse (default: 3)
  • --direction: in (callers), out (callees), both

Examples:

  • /rust-call-graph process_request - Show both callers and callees
  • /rust-call-graph handle_error --direction in - Show only callers
  • /rust-call-graph main --direction out --depth 5 - Deep callee analysis

LSP Operations

1. Prepare Call Hierarchy

Get the call hierarchy item for a function.

LSP(
  operation: "prepareCallHierarchy",
  filePath: "src/handler.rs",
  line: 45,
  character: 8
)

2. Incoming Calls (Who calls this?)

LSP(
  operation: "incomingCalls",
  filePath: "src/handler.rs",
  line: 45,
  character: 8
)

3. Outgoing Calls (What does this call?)

LSP(
  operation: "outgoingCalls",
  filePath: "src/handler.rs",
  line: 45,
  character: 8
)

Workflow

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Category
Rust

More from zhanghandong/rust-skills

All 34

Recommended

More Rust
1zhanghandong avatarrust-dailyzhanghandong/rust-skillsrust daily635skills.sh installs
2googleworkspace avatarrecipe-transfer-file-ownershipgoogleworkspace/cliTransfer ownership of Google Drive files from one user to another.582skills.sh installs
3mohitmishra786 avatarwasm-emscriptenmohitmishra786/low-level-dev-skillsWebAssembly with Emscripten skill for C/C++ to WASM compilation. Use when compiling C/C++ to WebAssembly with emcc, configuring EXPORTED_FUNCTIONS, understandin559skills.sh installs
4longbridge avatarlongbridge-ownershiplongbridge/skillsShare structure and shareholder query — total shares, circulating shares, restricted shares, top-10 shareholders (circulating and total), major institutional ho494skills.sh installs
5dchuk avatarcalling-rust-from-tauri-frontenddchuk/claude-code-tauri-skillsGuides the user through calling Rust backend functions from the Tauri frontend using the invoke function, defining commands with the361skills.sh installs
6bobmatnyc avatarrust-desktop-applicationsbobmatnyc/claude-mpm-skillsBuild cross-platform desktop applications with Rust using Tauri framework and native GUI alternatives263skills.sh installs