Skip to content

[BUG] Diff view does not appear when Claude suggests changes #136

@DEV-Thierry

Description

@DEV-Thierry

Bug Description

When using claudecode.nvim with Claude Code CLI, the diff view does not appear in Neovim when Claude suggests code changes. Instead of opening the native Neovim diff as described in the documentation, no diff window is shown and I am unable to accept or reject changes using the provided keybindings or commands.

To Reproduce

Steps to reproduce the behavior:

  1. Configure claudecode.nvim with Claude Code CLI and start integration.
  2. Request a code change or suggestion from Claude.
  3. Notice that no diff view is opened in Neovim.
  4. Attempt to use keybindings (e.g., <leader>aa, <leader>ad) or diff commands, but nothing happens.

Expected Behavior

When Claude suggests changes, the plugin should open a native Neovim diff view so I can review, accept, or reject the changes.

Environment

  • Neovim version: [e.g. 0.11.4J]
  • Claude Code CLI version: [e.g. 2.0.1]
  • Arch linux + hyprland

Error Messages

No error messages are shown in Neovim or the Claude CLI terminal.

Additional Context

Here are my custom configuration options:

return {
  "coder/claudecode.nvim",
  dependencies = { "folke/snacks.nvim" },
  config = true,
  keys = {
    { "<leader>a", nil, desc = "AI/Claude Code" },
    { "<leader>aa", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
    { "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
    { "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" },
    { "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Continue Claude" },
    { "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", desc = "Select Claude model" },
    { "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Add current buffer" },
    { "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
    {
      "<leader>as",
      "<cmd>ClaudeCodeTreeAdd<cr>",
      desc = "Add file",
      ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
    },
    -- Diff management
    { "<leader>ay", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
    { "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
    { "<leader>an", "<cmd>ClaudeCodeDiffNext<cr>", desc = "Next diff" },
    { "<leader>ap", "<cmd>ClaudeCodeDiffPrev<cr>", desc = "Previous diff" },
    { "<leader>al", "<cmd>ClaudeCodeDiffList<cr>", desc = "List diffs" },
  },
  opts = {
    terminal = {
      snacks_win_opts = {
        position = "bottom",
        height = 0.6,
        width = 1.0,
        border = "single",
      },
    },
    diff_opts = {
      auto_close_on_accept = true,
      vertical_split = true,
      open_in_current_tab = true,
      keep_terminal_focus = true,
      show_diff_preview = true,
    },
  },
}

Any help or guidance on how to fix the diff view would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions