ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 liawzishen

git-diff-timeline

一个将 Git Diff 时间线放在提示列上方的 Claude Code mod,包含 commit 历史卡片、分支比较和 GitHub 风格的文件变更视图。只读取本地 git,因此适用于任何 remote。

已翻译

关于这个 mod

git-diff-timeline 是一个 Claude Code 插件,会在提示列上方渲染 Git diff 时间线。History 标签页显示分支的 commit 卡片(第一个 parent,因此合并的 PR 算作一个 commit);点击 commit 可查看其变更,或点击两个 commit 进行比较,commit message 会显示在时间线下方,合并则以 pull/merge request 标题命名。Branches 标签页像 pull request 一样比较两个分支(base...compare):领先和落后的 commit、分叉位置,以及 compare 分支新增的内容。侧边栏会列出比较中的 commit 和每个发生变更的文件及其 diff。它只读取本地 git,因此适用于 GitHub、GitLab 或任何其他 remote。通过 ~/.claude/settings.json 的 env block 加载文件夹作为插件目录(CLAUDE_CODE_PLUGIN_DIRS 和 CLAUDE_CODE_PLUGIN_DIR_WATCH),或通过 claude --plugin-dir /path/to/git-diff-timeline 为单个工作阶段加载。`/gitdiff 打开文件视图,position 选项(band 或 pane)在提示列上方的 strip 和侧边窗格之间选择。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add liawzishen/git-diff-timeline
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 .

其他同名作品

更多类似作品