liawzishen/claude-code-mods/tree/main/git-diff-timeline
关于这个 mod
一个将 Git Diff 时间线放在提示符上方的 Claude Code mod:它提供分支提交的卡片(使用 first parent,因此合并的 pull request 算作一次提交);点击提交可查看其更改,再点击第二个提交可比较两者,比较中的提交消息会显示在时间线下方;Branches 标签页按 pull request 的方式(base...compare)比较两个分支,显示领先和落后提交以及它们的分叉位置;还有 GitHub 风格的文件视图,侧边面板列出比较中的提交和每个有变更文件的 diff。它只读取本地 git,因此适用于 GitHub、GitLab 或其他任何远程仓库。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add liawzishen/claude-code-mods claude plugin install git-diff-timeline
原文 / README
git-diff-timeline
A Claude Code mod that puts a Git Diff timeline above the prompt.
- History: a card of the branch's commits (first parent, so a merged pull request is one commit). Click a commit to see its changes; click a second commit to compare the two. The commit messages being compared show under the timeline, with merges named by their pull or merge request title.
- Branches: compare two branches the way a pull request would (
base...compare): commits ahead and behind, where they split, and what the compare branch adds. - Files changed: a side panel listing the compared commits and each changed file, with its diff.
It reads local git only, so it works with GitHub, GitLab or any other remote.
Install
Load the folder as a plugin directory, for every session, through the env block of ~/.claude/settings.json:
{
"env": {
"CLAUDE_CODE_PLUGIN_DIRS": "/path/to/git-diff-timeline",
"CLAUDE_CODE_PLUGIN_DIR_WATCH": "1"
}
}
Or for one session: claude --plugin-dir /path/to/git-diff-timeline.
/gitdiff opens the files view. The position option (band or pane) chooses between the strip above the prompt and a side pane.
Test
claude plugin test .
claude plugin validate .
其他同名作品
- git-diff-timelineliawzishen · ★ 0
