git_diff
Show uncommitted changes or compare branches as a unified diff. Use stat_only to preview file changes before loading full diff.
Instructions
Show changes as a unified diff. against="worktree" (default, unstaged changes), "staged", "head" (staged + unstaged), or a branch/commit name to compare the current branch against it (uses the merge base). Use stat_only=true first on a large change to see which files moved before pulling in the full diff.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "git_diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No | Limit the diff to these paths. | |
| against | No | "worktree" | "staged" | "head" | branch or commit ref. Default "head". | |
| stat_only | No | Only per-file change counts. Default false. | |
| workspace | No | Workspace alias. Defaults to the active workspace. | |
| context_lines | No | Context lines around each hunk. Default 3. |