Code Preview.Nvim — Data & AI agent for Claude Code
A Neovim plugin that shows a live diff preview of AI coding agent's file edits before you accept or reject them.
How to install Code Preview.Nvim
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Cannon07/code-preview.nvim and copy the folder into
~/.claude/agents/.
What Code Preview.Nvim does
A Neovim plugin that shows a live diff preview of AI coding agent's file edits before you accept or reject them.
Alternatives in Data & AI
- Claude Mem — A Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresse 38.9k ★
- Crush — The glamourous AI coding agent for your favourite terminal 21.8k ★
- Visual Explainer — Agent skill + prompt templates that generate rich HTML pages for visual diff reviews, architecture overviews 6.8k ★
README
code-preview.nvim
A Neovim plugin that shows a **diff preview before your AI coding agent applies any file change** — letting you review exactly what's changing before accepting.
Supports [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [OpenCode](https://opencode.ai) as backends.
Demo
Claude Code

OpenCode

Table of Contents
- Features
- Requirements
- Installation
- Quick Start
- How it works
- Configuration
- Commands
- Diff Layouts
- Neo-tree Integration
- Testing
- Troubleshooting
Features
- Diff preview — side-by-side or inline diff opens in Neovim before any file is written
- Multiple layouts — tab, vsplit, or GitHub-style inline diff with syntax highlighting
- Neo-tree integration — file tree indicators show which files are being modified, created, or deleted
- Multi-backend — works with Claude Code CLI and OpenCode
- No Python dependency — file transformations use
nvim --headless -l
Requirements
- Neovim >= 0.9
**For Claude Code backend:**
- Claude Code CLI with hooks support
- jq — for JSON parsing in hook scripts
**For OpenCode backend:**
- OpenCode >= 1.3.0
Installation
lazy.nvim
{
"Cannon07/code-preview.nvim",
config = function()
require("code-preview").setup()
end,
}
Manual (path-based)
vim.opt.rtp:prepend("/path/to/code-preview.nvim")
require("code-preview").setup()
Quick Start
Claude Code
- Install the plugin and call
setup() - Open a project in Neovim
- Run
:CodePreviewInstallClaudeCodeHooks— writes hooks to.claude/settings.local.json - Restart Claude Code CLI in the project directory
- Ask Claude to edit a file — a diff opens automatically in Neovim
- Accept/reject in the CLI; the diff closes automatically on accept
- If rejected, press
dqto close the diff manually
OpenCode
- Install the plugin and call
setup() - Open a project in Neovim
- Run
:CodePreviewInstallOpenCodeHooks— copies the plugin to.opencode/plugins/ - Ensure your OpenCode config (
~/.config/opencode/opencode.json) has permission prompts enabled:{ "permission": { "edit": "ask", "bash": "ask" } } - Start OpenCode in the project directory
- Ask OpenCode to edit a file — a diff opens automatically in Neovim
- Accept/reject in OpenCode; the diff closes automatically on accept
- If rejected, press
dqto close the diff manually
How it works
AI
Related Agents
Gads Creation
Campaign creation and management wizard. Gates on user-supplied context (business, website, goal, analytics in
UX Verifier
Read-only UX verifier for a RelaxJer trip page. Use after any change to what the page shows (engine, CSS, sect
Implementation Analyst
Technical implementation specialist. Use BEFORE coding to determine algorithms, data structures, and step-by-s
Falsification Leg
Standing pre-merge falsification leg (mmnto-ai/totem-strategy:doctrine/model-tiering.md § Review legs). Dispat
Review Context
Pre-review architectural context gatherer. Explores the codebase beyond the diff to produce a structured summa
Credential Hunter
Autonomous credential-attack pipeline runner. Chains /wordlist-gen + /osint-employees + /breach-check (data-pr
Related Skills
Code Preview.Nvim
A Neovim plugin that shows a live diff preview of AI coding agent's file edits before you accept or reject the
Stuga
Self-hosted Notion alternative where AI agents' edits arrive as tracked changes you accept or reject. Docs, da
Orchestrate Consult
Run an independent external audit of a completed ZOdyssey run. Hands the plan + full git diff to the external