guard_diff_audit
Audit working-tree diff size against configured line and file thresholds before large edits; get added and deleted lines, file count, and a warn or hard verdict.
Instructions
Audit the working tree's size against the configured line and file thresholds.
Use it before a large edit, or when status shows a warn or hard diff, to
see added/deleted lines, file count, and the verdict. baseline is an
optional git ref string, default None (HEAD). Thresholds come from config:
warn at 400 lines or 10 files, hard at 800 lines, unless the project or
personal config overrides them. It returns the rendered diff audit,
including a bounded-scan note when untracked reads hit their caps, and a
Nudge. Outside a git repo the text says the diff is unavailable. Side
effects: creates .agent-guard/ and seeds config.json if that file is
missing, and runs git. Untracked content reads are capped (1000 files,
1 MB per file, 8 MB total). It does not modify the worktree or the ledgers.
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": "guard_diff_audit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baseline | No | Git ref to diff the working tree against. String or omitted. Default None, which means HEAD (an unborn repository is compared as an unborn HEAD). Example: a commit sha. A ref git cannot resolve is reported in the text; it is not raised. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |