Git diff
git_diffSee what changed in the workspace with git diff. Use staged to view the index, stat for a summary, and path to filter a file. Reports '(no changes)' when empty.
Instructions
Read-only git diff of the workspace: runs 'git diff' without a shell (LC_ALL=C, 30 s timeout) and returns the patch text. Use staged=true for the index (--cached), stat=true for a diffstat (--stat), and path to limit the diff to one workspace-relative file (passed after '--'). Reports '(no changes)' when the diff is empty. Output longer than 64 KiB keeps the first 32 KiB and the last 32 KiB. No --shell flag is needed for this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Workspace-relative file or directory to limit the diff to. Absolute paths inside the workspace are also accepted. | |
| stat | No | Return a diffstat (git diff --stat) instead of the full patch. Defaults to false. | |
| staged | No | Diff the staged changes (git diff --cached) instead of the working tree. Defaults to false. | |
| workspace | No | Workspace name (see workspace_list). Defaults to the primary workspace. |