Run a fresh-context code review on current changes, then apply fixes based on findings. Useful after implementing a feature to catch issues with an unbiased review.
Run a code review with fresh context (no knowledge of implementation decisions), then apply your judgment to fix legitimate issues. This mimics having a separate reviewer look at your code.
When you implement a feature, you have context about why decisions were made. A fresh reviewer only sees what was done, which helps catch:
# Get the diff that will be reviewed
git diff main...HEAD 2>/dev/null || git diff HEAD~5
# Get list of changed files
git diff --name-only main...HEAD 2>/dev/null || git diff --name-only HEAD~5
# Get CODEX.md for context the reviewer should have
cat CODEX.md 2>/dev/null || true
CRITICAL: Use spawn_agent with agent_type: explorer to create a fresh-context reviewer. This
reviewer has NO implementation context beyond what you pass it.
spawn_agent(agent_type="explorer", message="
You are reviewing code changes with NO prior context. You don't know why decisions were made -
you only see the diff. This is intentional.
## Project Guidelines (from CODEX.md)
[paste relevant CODEX.md content]
## Diff to Review
[paste full diff]
## Your Task
Review this diff for issues. Be critical but fair. For each issue:
1. Describe the problem
2. Explain why it's a problem (not just 'looks wrong')
3. Rate confidence (0-100):
- 90+: Definitely a bug or will cause problems
- 75-89: Very likely an issue, should fix
- 50-74: Possible issue, worth considering
- <50: Nitpick or uncertain
IMPORTANT:
- Only flag issues in the ADDED lines (+ lines in diff)
- Don't flag pre-existing issues
- Don't flag things a linter would catch
- If something looks intentional, note it but lower confidence
## Output Format
For each issue:
[CONFIDENCE: XX] file:line - Issue description
WHY: Explanation of the impact
If no significant issues: 'No issues found - code looks good.'
End with a 1-2 sentence summary.
")
Execution discipline:
explorer).When the review agent returns, YOU (the parent agent with full context) must evaluate each finding:
For each issue, consider:
Categorize findings into:
For issues you're fixing:
Do NOT fix:
If delegating code changes, use spawn_agent with agent_type: worker and assign explicit file
ownership per worker to avoid conflicts.
After implementing fixes, create a commit:
git add -A
git commit -m "fix: address review findings
- [list what was fixed]
- [note any clarifying comments added]"
Provide a summary:
## Review Summary
**Findings from fresh-context review:** X issues
### Fixed (Y issues)
- [file:line] What was fixed
### Not fixing (Z issues)
- [file:line] Why (intentional/false positive/etc.)
### Clarified (N issues)
- [file:line] Added comment or renamed for clarity
**Commit:** [hash] [message]