Code review local uncommitted git changes
Reviews uncommitted git changes for bugs and CLAUDE.md compliance violations.
/plugin marketplace add JesseNaranjo/ai-setup/plugin install jessenaranjo-local-code-review-claude-code-plugins-local-code-review@JesseNaranjo/ai-setupProvide a code review for local uncommitted git changes.
To do this, follow these steps precisely:
Launch a haiku agent to check if there are any uncommitted changes:
git diff HEAD --stat to see all uncommitted changes (staged and unstaged)git rev-parse --git-dirIf no changes exist, stop and do not proceed.
Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:
git diff HEAD --name-only to get the list of modified filesLaunch a sonnet agent to view the uncommitted changes and return a summary:
git diff HEAD to get the full diffgit branch --show-current to get the current branch nameLaunch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:
Agents 1 + 2: CLAUDE.md compliance sonnet agents Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.
Agent 3: Opus bug agent (parallel subagent with agent 4) Scan for obvious bugs. Focus only on the diff itself without reading extra context. Flag only significant bugs; ignore nitpicks and likely false positives. Do not flag issues that you cannot validate without looking at context outside of the git diff.
Agent 4: Opus bug agent (parallel subagent with agent 3) Look for problems that exist in the introduced code. This could be security issues, incorrect logic, etc. Only look for issues that fall within the changed code.
CRITICAL: We only want HIGH SIGNAL issues. This means:
We do NOT want:
If you are not certain an issue is real, do not flag it. False positives erode trust and waste reviewer time.
In addition to the above, each subagent should be told the current branch name and a summary of the changes. This will help provide context regarding the author's intent.
For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the branch name and change summary along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.
Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.
Generate the review output. The output should be written to BOTH the terminal AND a markdown file.
If NO issues were found, output:
## Local Code Review
No issues found. Checked for bugs and CLAUDE.md compliance.
Files reviewed: [list of modified files]
If issues WERE found, format the output as:
## Local Code Review
Reviewed uncommitted changes ([N] files modified)
### Issues Found: [count]
**1. [Issue title]** ([Category: Bug/CLAUDE.md violation])
`path/to/file.ts:line-range`
[Description of the issue]
```suggestion
[corrected code here - only for small fixes up to 5 lines]
2. [Next issue] ...
Write the review output:
.code-review.md in the repository root--output-file <path> argument was provided, use that path insteadFor suggestions:
Fix [file:line]: [brief description of issue and suggested fix]
IMPORTANT: Only report ONE entry per unique issue. Do not duplicate issues.
Use this list when evaluating issues in Steps 4 and 5 (these are false positives, do NOT flag):
Notes:
src/utils.ts:42-48).