{"slug": "show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages", "title": "Show HN: Calldiff – a CLI to see callstack diffs in all major languages", "summary": "Calldiff, a new open-source CLI tool, lets developers diff call stacks across git commits in 22 programming languages, showing which callees appeared, disappeared, or moved under an entrypoint. Built for agentic code review, it supports commands like `calldiff diff`, `calldiff tree`, and `calldiff reach`, and integrates with the incur framework for agent skills and MCP server registration.", "body_md": "Diff call stacks across git commits — like `git diff`\n\n, but for who-calls-whom.\n\nBuilt for **agentic code review**: when an agent (or you) rewires call flow, plain line diffs bury the shape of the change. `calldiff`\n\nshows which callees appeared, disappeared, or moved under an entrypoint — across **22 languages**.\n\n```\n  PiService.createAgentSession(options)\n- ├─ AuthStorage.create()\n- ├─ new ModelRegistry\n- ├─ createCodingTools()\n+ ├─ PiService.getServices()\n+ │  ├─ SettingsManager.create()\n+ │  ├─ AuthStorage.create()\n+ │  └─ new ModelRegistry\n```\n\nPaste this when you want a walkthrough of call-flow changes:\n\ndearest clod, walk me through the code changes you made using\n\n`npx calldiff@latest`\n\n```\nnpx calldiff@latest\n# or\nnpm install -g calldiff\n# HEAD vs working tree\ncalldiff diff\n\n# one ref vs working tree\ncalldiff diff main\n\n# two commits / branches\ncalldiff diff abc123 def456\ncalldiff diff --from main --to feature\n\n# force entrypoints (functionName or ClassName.method)\ncalldiff diff main feature --entry createAgentSession\ncalldiff diff main feature -e PiService.createAgentSession -e boot\n\n# limit to paths (trailing positionals; leading -- also accepted)\ncalldiff diff main feature src/lib\n\n# view a call tree (no diff) — requires --entry\ncalldiff tree -e createAgentSession\ncalldiff tree HEAD -e PiService.createAgentSession\ncalldiff tree main -e boot --max-depth 8 src/lib\ncalldiff tree -e runCheckout --locs examples/checkout\n\n# find all call paths from one symbol to another — requires --entry and --to\ncalldiff reach -e runCheckout --to sendEmail\ncalldiff reach HEAD -e runCheckout --to sendEmail examples/checkout\n\n# agent / machine-readable output (via incur)\ncalldiff diff --format json\ncalldiff --llms\ncalldiff skills add   # install agent skill files\ncalldiff mcp add      # register as MCP server\n```\n\n| Invocation | From | To |\n|---|---|---|\n`calldiff diff` |\n`HEAD` |\nworking tree |\n`calldiff diff <from>` |\n`<from>` |\nworking tree |\n`calldiff diff <from> <to>` |\n`<from>` |\n`<to>` |\n\n`-`\n\nlines were present in **from** and gone in **to**.\n\n`+`\n\nlines are new in **to**.\n\nIf you omit `--entry`\n\n, calldiff infers exported functions whose expanded call trees changed (and may show several).\n\n| Invocation | Tree from |\n|---|---|\n`calldiff tree -e <name>` |\nworking tree |\n`calldiff tree <ref> -e <name>` |\nthat commit/ref |\n\nPrints a plain ASCII call tree (no `+/−`\n\nmarkers). `--entry`\n\n/ `-e`\n\nis required.\nWith `--locs`\n\n, each node shows a source location: the root uses the definition\n`file:line`\n\n, and children use the **call site** in the parent (`file:line`\n\nor\n`file:line-line`\n\n) — same idea as LSP Call Hierarchy `fromRanges`\n\n, not Go to\nDefinition.\n\n| Invocation | Paths from |\n|---|---|\n`calldiff reach -e <from> --to <target>` |\nworking tree |\n`calldiff reach <ref> -e <from> --to <target>` |\nthat commit/ref |\n\nPrints every call path from the entrypoint to the target (including alternate `if`\n\n/ `else`\n\narms). Both `--entry`\n\n/ `-e`\n\nand `--to`\n\nare required.\n\n`functionName`\n\n— free function`ClassName.method`\n\n— class method`new ClassName`\n\n— constructor /`new`\n\ncall`Component`\n\n— JSX/TSX component tags (`<Button />`\n\n); children nest under the parent`if (cond)`\n\n/`else`\n\n/`else if (cond)`\n\n— conditional arms (no continuing`│`\n\nrail)`file:line`\n\n— call-site (or root definition) location; enable with`--locs`\n\n(default off)\n\nTypeScript, TSX, JavaScript, JSX, Python, Go, Rust, Java, Ruby, C, C++, C#, PHP, Kotlin, Swift, Scala, Lua, Elixir, Bash, Haskell, Zig, Solidity, OCaml.\n\n**Default:** colored ASCII callstack trees (TTY) / colorless ASCII when piped — same shape as before.structured result (`--format json|yaml|md|jsonl`\n\n:`from`\n\n/`to`\n\n/`trees`\n\nor`paths`\n\nwith nested nodes + per-entry`ascii`\n\n) for agents and scripts.- Built on\n[incur](https://github.com/wevm/incur):`skills add`\n\n,`mcp add`\n\n,`--llms`\n\n, CTAs after diffs, typed flags.\n\n- Reads source from both git trees (\n`git show`\n\n/ working tree) - Detects language by file extension, loads a\n[tree-sitter](https://tree-sitter.github.io/tree-sitter/)grammar (bundled or on-demand into`~/.cache/calldiff/grammars`\n\n), and parses - Builds per-function callee lists and expands them into call trees\n- Diffs the trees, prints a tree, or searches paths — plus structured output for agents\n\nGrammars install on first use (override cache with `CALLDIFF_GRAMMAR_CACHE`\n\n). This is syntactic (AST-based), not a full typechecker — dynamic calls won’t resolve.\n\n```\nnpm run dev -- diff main HEAD --entry PiService.createAgentSession\nnpm run dev -- tree -e runCheckout -- examples/checkout\nnpm run dev -- reach -e runCheckout --to sendEmail -- examples/checkout\n```\n\n", "url": "https://wpnews.pro/news/show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages", "canonical_source": "https://github.com/tanishqkancharla/calldiff", "published_at": "2026-08-10 21:47:03+00:00", "updated_at": "2026-08-10 22:11:49.010385+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["Calldiff", "incur", "wevm"], "alternates": {"html": "https://wpnews.pro/news/show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages", "markdown": "https://wpnews.pro/news/show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages.md", "text": "https://wpnews.pro/news/show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages.txt", "jsonld": "https://wpnews.pro/news/show-hn-calldiff-a-cli-to-see-callstack-diffs-in-all-major-languages.jsonld"}}