Call Path Finding
Find call paths between two functions using BFS over the call graph.
When to use
Use this skill when the user asks:
- •"Can function X reach function Y?"
- •"What are the call paths from X to Y?"
- •"How does function X eventually call function Y?"
- •"Is function Y reachable from function X?"
How to invoke
Invocation: Use the claudit CLI only. Do not run python -m claudit.skills.path.
bash
claudit path find <source> <target> <project_dir> [--language c|java|python] [--max-depth 10] [--overrides path.json]
- •
--languageand--max-depth N(default 10) apply toclaudit path findonly.
python
from claudit.skills.path import find
result = find("/path/to/project", "main", "vulnerable_func", max_depth=10)
Output format
json
{
"source": "main",
"target": "vulnerable_func",
"paths": [
{
"hops": [
{"function": "main", "file": "main.c", "line": 42, "snippet": "process_input(buf);"},
{"function": "process_input", "file": "input.c", "line": 15, "snippet": "parse_data(raw);"},
{"function": "vulnerable_func", "file": "vuln.c", "line": 3, "snippet": "void vulnerable_func(char *p) {"}
],
"length": 3
}
],
"path_count": 1,
"cache_used": false
}
Notes
- •Auto-builds the call graph and index if they don't exist.
- •Empty
pathsarray means no reachable path within the depth limit. - •Use
--max-depthto control how deep the BFS searches.
Limitations
- •GNU Global can miss edges across Java interface → implementation (e.g. a call in the impl is not attributed to the interface). If
path findreturns 0 paths, the path may still exist; verify by reading source and/or usingclaudit graph calleesandclaudit graph callers.
When path find returns no paths
- •Run
claudit path find <src> <tgt> <dir>first. - •If 0 paths, run
claudit graph callees <src> <dir>to see direct callees. - •Run
claudit graph callers <tgt> <dir>to see callers of the target. - •Read source of promising intermediate functions to find the missing edge.
- •Once the chain is confirmed, pass the hop list to
claudit highlight path ... --project-dir <dir>.