Diff Review
Review a git diff for potential bugs, security issues, error handling and test gaps. Returns findings with severity and file references.
diff-review Example
{
"diff": "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -1 +1,2 @@\n # Project\n+Added docs.\n"
} The fields it answers with are listed under Output fields.
Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
diff | string | Yes | Unified diff text (output of `git diff`) |
focus | string | No | Optional focus area (bugs, security, performance, test-gaps, or all) |
context | string | No | Optional project context (e.g. "TypeScript API server using Hono") |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
issues | array | Always (present in every successful answer) |
summary | string | Always (present in every successful answer) |
diff_stats | object | Always (present in every successful answer) |
risk_level | string | Always (present in every successful answer) |
todos_added | array | Always (present in every successful answer) |
missing_tests | array | Always (present in every successful answer) |
approval_reason | string | Always (present in every successful answer) |
hardcoded_values | array | Always (present in every successful answer) |
approval_recommendation | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "diff-review",
"inputs": {
"diff": "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -1 +1,2 @@\n # Project\n+Added docs.\n"
},
"max_price_cents": 10
}' {
"tool": "strale_execute",
"arguments": {
"slug": "diff-review",
"inputs": {
"diff": "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -1 +1,2 @@\n # Project\n+Added docs.\n"
},
"max_price_cents": 10
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "diff-review",
inputs: {
"diff": "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -1 +1,2 @@\n # Project\n+Added docs.\n"
},
max_price_cents: 10,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="diff-review",
inputs={
"diff": "diff --git a/README.md b/README.md\n--- a/README.md\n+++ b/README.md\n@@ -1 +1,2 @@\n # Project\n+Added docs.\n",
},
max_price_cents=10,
)) Limitations
Diff size limited to ~12,000 characters
Input diffs are limited to about 12,000 characters and larger diffs are truncated. Split large changes into separate file diffs.
AI-generated analysis
Generated findings can include false positives or miss subtle issues requiring wider project context.
Output size cap per call
Structured output is limited to about 2000 output tokens per call; requests exceeding this limit are refused rather than returned truncated. A dense diff can exceed the output limit even within the 12,000-character input limit; an identical retry does not help.
What to do instead: Provide a smaller diff (fewer files or lines) per call
Bundled checks that include it
- Pre-Merge Check €0.32
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05