calldiff

calldiff is a skill for Claude Code, Codex from petekp/claude-code-setup. It costs 100 tokens per session (735 once invoked), scanned A, original, MIT.

A command-line tool that shows which functions call a given symbol and how a code change alters those call paths. It reads the code structure from Git without building the project.

In plain words
What is it for?
Tracing callers, mapping call paths with file locations, outlining a module, and checking added, removed, or changed calls in a diff.
Why use it?
It helps estimate the blast radius of an edit before changing shared code or reviewing a risky diff. Its results are evidence, not proof, because dynamic calls may be missed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Tracing callers, mapping call paths with file locations, outlining a module, and checking added, removed, or changed calls in a diff.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/petekp/claude-code-setup/calldiff
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add petekp/claude-code-setup --skill calldiff
Clone the repo
git clone --depth 1 https://github.com/petekp/claude-code-setup

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for calldiff

README.md
[![agentmods](https://agentmods.dev/badge/skills/petekp/claude-code-setup/calldiff/github.svg)](https://agentmods.dev/skills/petekp/claude-code-setup/calldiff)
Your own site
<a href="https://agentmods.dev/skills/petekp/claude-code-setup/calldiff"><img src="https://agentmods.dev/badge/skills/petekp/claude-code-setup/calldiff/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for calldiff

Your own site · 80×15
<a href="https://agentmods.dev/skills/petekp/claude-code-setup/calldiff"><img src="https://agentmods.dev/badge/skills/petekp/claude-code-setup/calldiff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 13
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00100 $0.00735
Opus 5 $0.00050 $0.00367
Sonnet 5 $0.00020 $0.00147
Haiku 4.5 $0.00010 $0.00073

Measured 5d ago against content hash 8d46e8241741, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

calldiff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/calldiff/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

command use for
calldiff reach --entry <fn> --to <symbol> --locs blast 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 helperreach 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.

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 58 lines · 100 tokens per session scan A 8d46e8241741

Subscribe to this mod's changes

calldiff is a skill published in the GitHub repository petekp/claude-code-setup (48 stars, last pushed 5d ago), licensed MIT. It adds 100 tokens to every session and 735 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.