Skip to content

3-pane code review system for AI-generated code with structured feedback

License

Notifications You must be signed in to change notification settings

Ginger-Labs/diff-feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diff Feedback

A 3-pane code review system for Claude Code that makes reviewing AI-generated code efficient and systematic.

Features

  • 3-Pane Layout: Side-by-side diff viewer, Claude chat, and comment editor
  • Pre-populated Comments: File list automatically generated in diff order
  • Batch Feedback: Collect all review comments before Claude addresses them
  • Smart Overview: High-level summary skipping trivial changes
  • Systematic Fixes: Prioritized issue resolution with progress tracking
  • Centralized Sessions: Sessions stored in ~/.diff-feedback/sessions/ (no repo clutter)

Installation

Via Claude Code Plugin System (Recommended)

# Install latest version
claude plugin install diff-feedback@github.com/Ginger-Labs/diff-feedback

# Or install specific version
claude plugin install diff-feedback@github.com/Ginger-Labs/diff-feedback#v1.0.0

Verify Dependencies

Before first use, verify you have required dependencies:

# Run dependency checker (optional)
bash ~/.claude/plugins/cache/github.com/Ginger-Labs/diff-feedback/*/install.sh

Required:

  • git (usually pre-installed)
  • nvim - Install with: brew install neovim

Recommended:

  • git-delta - Install with: brew install git-delta (provides rich diff viewing, falls back to less -R if not installed)

Post-Installation

  1. Restart Claude Code to activate the plugin (may be required)
  2. Verify with /help - should see /diff-feedback:overview, /diff-feedback:address, /diff-feedback:refresh, /diff-feedback:start
  3. The launcher script is available directly after installation - no alias needed!

Quick Start

1. Generate Code with Claude

$ claude
> "Implement dark mode with Redux"
[Claude generates code with multiple files]

2. Launch Review

$ diff-feedback
# Or for branch comparison:
$ diff-feedback --base staging

This opens a 3-pane layout:

┌─────────────────────┬─────────────────────┐
│                     │  Claude Code        │
│  Diff Viewer        │  (Ask questions)    │
│  (delta)            │                     │
│                     ├─────────────────────┤
│                     │  Comment Editor     │
│                     │  (nvim)             │
└─────────────────────┴─────────────────────┘

3. Review Changes

  • Left pane: Read the diff
  • Top-right: Ask Claude questions (/diff-feedback:overview for summary)
  • Bottom-right: Write review comments in nvim

4. Address Feedback

> /diff-feedback:address

Claude reads all comments, creates todos, and fixes issues systematically.

Usage

Launch Review

# Review uncommitted changes
diff-feedback

# Review branch vs base branch
diff-feedback --base main

# Review specific files only
diff-feedback src/components/*.tsx

During Review

Optional: Get high-level overview

> /diff-feedback:overview

Output:

Overview (8 files changed):

Core Implementation:
- store/theme/slice.ts (NEW): Redux slice for theme state
  • Three-way theme mode with system detection
  • Persists to localStorage

[Skips trivial changes like imports]

Architectural Notes:
- Chose Redux over Context (accessed by 20+ components)

Process Comments

> /diff-feedback:address

Claude will:

  1. Parse comments by file and line
  2. Prioritize: HIGH (bugs) → MEDIUM (quality) → LOW (style)
  3. Create todos with TodoWrite
  4. Fix issues one by one
  5. Provide summary and next steps

Refresh After Changes

After addressing comments, refresh the review to see remaining changes:

> /diff-feedback:refresh

This command:

  1. Archives your current comments (with timestamp)
  2. Regenerates the comment template with the NEW diff
  3. Refreshes the diff viewer pane
  4. Shows remaining changes

Use this to continue reviewing after fixing some (but not all) issues.

Comment File Format

Comments are automatically saved to ~/.diff-feedback/sessions/[repo-id]/comments.txt:

# Code Review Comments

<!-- Session: 2025-12-29-143022 | Created: 2025-12-29 14:30:22 -->
<!-- Branch: main | Base: staging | Files: 12 changed -->

## File: services/app/src/components/ThemeToggle.tsx

Line 42:
- Missing dependency in useEffect array

Line 67-73:
- Need error handling for theme fetch failure

## File: services/app/src/store/theme/slice.ts

General:
- Consider memoizing the theme selector

## General Comments

- Extract theme utilities to shared file
- Add tests for theme toggle

Files are pre-populated in the same order they appear in the diff for easy navigation.

Workflow Example

# 1. Claude implements a feature
$ claude
> "Add user preferences panel"
[Claude generates code]

# 2. Launch review
$ diff-feedback --base staging

# 3. (Optional) Get overview
> /diff-feedback:overview

Claude: "Overview (12 files):
- PreferencesPanel.tsx (NEW): User settings UI with form validation
- preferencesSlice.ts (NEW): Redux state management
[...]"

# 4. Review diff and add comments in nvim
# (Files already listed in same order as diff)

## File: PreferencesPanel.tsx
Line 42:
- Missing error handling for save button

## File: preferencesSlice.ts
General:
- Add JSDoc to exported selectors

# 5. Save and exit nvim, then address comments
> /diff-feedback:address

Claude: "Found 5 comments across 3 files.

Creating todos:
- [HIGH] Add error handling - PreferencesPanel.tsx:42
- [LOW] Add JSDoc - preferencesSlice.ts

Fixing error handling in PreferencesPanel.tsx:42...
✓ Fixed. Added try-catch with user feedback.

[...]

Summary: ✓ Addressed 5 comments across 3 files
Next steps:
1. Review: git diff
2. Test: yarn test
3. Commit when ready"

Configuration

Dependencies

Required:

  • git
  • nvim
  • One of the following terminal emulators:
    • WezTerm - Full native support
    • iTerm2 - Full native support (AppleScript)
    • Kitty - Native support (requires allow_remote_control yes in kitty.conf)
    • Terminal.app - Uses tmux wrapper (requires brew install tmux)
    • Alacritty - Uses tmux wrapper (requires brew install tmux)
    • tmux - Universal fallback

Recommended:

  • delta (brew install git-delta) - Rich diff viewing
    • Fallback: Uses less -R if delta not installed

Terminal Support Matrix:

Terminal Native Splitting Setup Required
WezTerm ✅ Yes None
iTerm2 ✅ Yes None
Kitty ✅ Yes Add allow_remote_control yes to kitty.conf
Terminal.app ❌ No (uses tmux) brew install tmux
Alacritty ❌ No (uses tmux) brew install tmux
tmux ✅ Yes None

Session Management

  • Session storage: ~/.diff-feedback/sessions/[repo-id]/comments.txt
  • One session per repo (identified by sanitized repo path)
  • Metadata embedded in comment file header (HTML comments)
  • Diff generated on-the-fly (not stored)
  • No clutter in your repositories

Troubleshooting

"Unsupported terminal"

Solution: diff-feedback requires one of the supported terminals: WezTerm, iTerm2, Kitty, Terminal.app (with tmux), Alacritty (with tmux), or tmux. If using Terminal.app or Alacritty, install tmux first: brew install tmux

"Kitty remote control not enabled"

Solution: Add allow_remote_control yes to your ~/.config/kitty/kitty.conf file and restart Kitty.

"No active review session"

Solution: Run diff-feedback first to start a review before using /diff-feedback:address.

"No changes to review"

Solution: Make some changes first, or check your branch comparison is correct.

Delta not found

The plugin falls back to less -R automatically. For better diff viewing:

brew install git-delta

Commands not appearing in /help

Solution: Restart Claude Code after plugin installation.

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test locally (see below)
  5. Submit a pull request

Local Testing

# Use --plugin-dir flag for development
claude --plugin-dir /path/to/diff-feedback

# Or test installation from local directory
claude plugin install --local /path/to/diff-feedback

# Test in a git repository
cd your-project
bash ~/.claude/plugins/cache/*/diff-feedback/*/scripts/diff-feedback.sh

License

MIT License - see LICENSE file for details.

Author

Created by Jeff Woodhull

Acknowledgments

  • Built for Claude Code
  • Inspired by code review workflows in professional development
  • Uses delta for rich diffs

About

3-pane code review system for AI-generated code with structured feedback

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages