agentleFS
petekppetekp/claude-code-setup/skills/calldiff/SKILL.md

calldiff

Skill47 starsChanged 3 months agoMITView on GitHub

Call-graph evidence from git via the calldiff CLI: which functions reach a symbol, and how a change moved the call structure. Use when you need blast radius before editing (does anything reach this function, and by what path), when scoping which files a change really touches, or when reviewing a diff whose risk is structural rather than textual. Tree-sitter based, 22 languages, no build step. Do not use it as a general replacement for git diff.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add --max-depth <n> when a tree runs long.

    line 23

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

calldiff

calldiff answers "who calls whom", read straight from a git tree. It is syntactic (tree-sitter, no type checking), so it is fast and needs no build, and it will miss dynamic dispatch. Treat its output as evidence that narrows attention — never as proof that nothing else is affected.

Installed globally: run calldiff, not npx calldiff.

The three modes worth using

commanduse for
calldiff reach --entry <fn> --to <symbol> --locsblast radius. Every call path from an entrypoint down to a target, each hop with file:line. Use before editing a shared function, and to answer "can this change reach X".
calldiff diff --file <path>structural review of one changed file: which calls this change added, removed, or swapped, shown in tree context.
calldiff tree --file <path>a call outline of one module, when you need its shape before reading it.

Add --max-depth <n> when a tree runs long. --locs is cheap and almost always worth it — line numbers make the output actionable.

Do not run bare calldiff diff

It reprints whole unchanged call trees around every change. Measured on a mid-size React monorepo: 36k tokens, versus ~18k for the raw git diff — double the cost for less information. Positional path scoping (diff HEAD <path>) silently returned nothing in the same test; do not rely on it.

Scope with --file or --entry, one target at a time. When output size is uncertain, preflight it:

calldiff diff --file <path> --token-count

Where this earns its place

  • Before editing a shared helper — reach from the app entrypoint tells you which callers exist and where, in seconds, instead of a Grep sweep.
  • Scoping a review — drive diff --file from the changed-file list (git diff --name-only), not across the whole repo.
  • Framework noise is real. In React code every useState() and useRef() counts as a call, so component trees are mostly noise. calldiff is most useful on plain modules of named functions, least useful on component trees.

Where it does not help

Dynamic dispatch, higher-order functions, DI containers, and hook indirection do not resolve. If the answer must be complete, calldiff is a starting point and not the answer. Say so when you report what it found.

Other output formats (--format json|md) and an MCP mode exist; the CLI text output is the right default for reading and for pasting into a review.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.