跳到正文
Skillpedia
通用编程13k · #11382

calldiff

它能做什么

它展示两个 git 提交或工作区之间函数调用链的变化。适用于审查代码更改、并想了解其对程序运行方式影响的开发者。

适用场景

  • ✓当你在审查更改,并想了解新增或删除了哪些调用时。
  • ✓当你需要在更新后确认某个函数是否能从给定入口点调用到时。
  • ✓当你想看执行路径的差异,而不只是文本差异时。

技能链接

https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/calldiff/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/calldiff/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能