Analyze a file
diffgate_analyzeAnalyze code files for review findings, flagging only changes vs git baseline. Supports unsaved or generated code via content input.
Instructions
Analyze a file for code review findings. Only flags risk on lines changed vs the git baseline (diff-aware). Pass content to analyze unsaved or generated code before it is written to disk. When a code graph is available, public-surface findings carry an impact field (caller count, suggested reviewers, test gaps) and may be tier-adjusted — fix high-blast-radius findings before surfacing the code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Repo root directory. Defaults to process.cwd(). | |
| content | No | File content to analyze. Omit to read from disk. | |
| filePath | Yes | Absolute or repo-relative path to the file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tier | Yes | Overall risk tier for the file. | |
| findings | Yes | Per-line findings, each with ruleId, tier, line, and message. | |
| _diffgate | No | Capability hint: which layers (core/graph/llm) produced this result. |