calldiff
它能做什么
它展示两个 git 提交或工作区之间函数调用链的变化。适用于审查代码更改、并想了解其对程序运行方式影响的开发者。
适用场景
- ✓当你在审查更改,并想了解新增或删除了哪些调用时。
- ✓当你需要在更新后确认某个函数是否能从给定入口点调用到时。
- ✓当你想看执行路径的差异,而不只是文本差异时。
技能链接
https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/calldiff/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我展示 main 和我当前分支之间函数调用路径的变化。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会运行 calldiff 命令,比较两个 git 引用之间的调用树。然后它会用带颜色的差异代码块展示变化。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Installation
If the calldiff command is unavailable, install the latest version globally:
npm install -g calldiff@latest
Presenting output
Whenever showing calldiff output to the user, wrap it in a fenced diff code block so additions and removals receive colored syntax highlighting:
```diff
<calldiff output>
```
calldiff diff
Diff call stacks between two git trees
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
from |
string |
no | Before ref (default: HEAD) |
to |
string |
no | After ref (default: working tree) |
paths |
array |
no | Limit to these path prefixes |
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--entry |
unknown |
||
--maxDepth |
number |
12 |
Max call-tree depth |
--from |
string |
Left / "before" tree | |
--to |
string |
Right / "after" tree |
Examples
# HEAD vs working tree
calldiff diff
# One ref vs working tree
calldiff diff main
# Two commits / branches
calldiff diff abc123 def456
# Force entrypoints
calldiff diff main feature --entry createAgentSession
Semantics match git diff: no refs -> HEAD vs worktree; one ref -> that vs worktree; two refs -> compare those trees.
calldiff reach
Find all call paths from an entrypoint to a target symbol
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
ref |
string |
no | Git ref (default: working tree) |
paths |
array |
no | Limit to these path prefixes |
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--entry |
unknown |
Entrypoint(s): functionName or ClassName.method | |
--to |
string |
Target symbol to reach (functionName or ClassName.method) | |
--maxDepth |
number |
12 |
Max call-tree depth |
Examples
# Paths in the working tree
calldiff reach --entry runCheckout --to sendEmail
# Paths at a commit, limited to a directory
calldiff reach HEAD examples/checkout --entry runCheckout --to sendEmail
calldiff tree
View a call tree (no diff) for one or more entrypoints
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
ref |
string |
no | Git ref (default: working tree) |
paths |
array |
no | Limit to these path prefixes |
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--entry |
unknown |
Entrypoint(s): functionName or ClassName.method | |
--maxDepth |
number |
12 |
Max call-tree depth |
Examples
# Tree from working tree
calldiff tree --entry createAgentSession
# Tree from a commit
calldiff tree HEAD --entry PiService.createAgentSession
常见问题
它支持哪些语言?
说明中提到它涵盖 22 种语言的调用栈分析。
我需要安装什么吗?
如果缺少 calldiff 命令,智能体会用 npm 全局安装它。
如果我不提供引用,它比较什么?
它会像 git diff 一样,比较 HEAD 与当前工作区。
详情
作者的原始描述
Diff call stacks across git commits for agentic code review (22 languages). Run `calldiff --help` for usage details.
repo: humanlayer/humanlayer
热度
- GitHub 星标
- 13k
- 排名
- #11382
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
asd-ste100
13k教你的智能体把难懂的英文改写成短句、每句只有一个意思,方便人和其他软件阅读。
better-github-skill
13k帮你的智能体查看拉取请求的状态、阅读其审查评论,并借助现成的 GitHub 脚本找出 CI 构建失败的原因。
chrome-devtools-cli
13k帮你的智能体通过终端控制 Chrome,打开页面、点击、填写表单,并截取页面快照,用于浏览器自动化和测试。
effect-program-design
13k帮你的智能体设计并测试可用于生产环境的 Effect v4 程序,包括清晰的服务、类型化错误、层以及对资源的安全处理。