Two coding agents inside nvim · Claude Code and opencode, side by side
| <leader>ac | Toggle the Claude panel (spawns claude in a snacks terminal, auto-connects to this nvim) |
| <leader>af | Focus the Claude panel |
| <leader>ar / aC | Resume a past session / continue the last one |
| <leader>am | Select model |
| <leader>ab | Add the current buffer to Claude's context |
| <leader>as | Send visual selection · or add a file from the neo-tree sidebar |
| <leader>aa / ad | Accept / deny a proposed edit (shown as a native nvim diff) |
| :ClaudeCode | Same as <leader>ac · run /ide inside to confirm "Connected to Neovim" |
| <leader>oo | Toggle the opencode panel |
| <leader>oa | Ask about cursor (normal) / selection (visual) |
| <leader>o+ | Append the current buffer to the prompt |
| <leader>os | Pick a prompt |
| <leader>on / oi | New session / interrupt |
| <leader>oe | Explain selection in detail |
| 1. server | nvim opens a WebSocket server and writes a lock file to ~/.claude/ide/<pid>.lock |
| 2. spawn | :ClaudeCode launches a fresh claude with CLAUDE_CODE_SSE_PORT set to that port |
| 3. connect | That claude dials the port — one nvim window pairs with one Claude session |
| verify | ss -tnp | grep <port> shows an ESTABLISHED socket between claude & nvim |
| note | A claude started in a plain terminal does not connect — it must be spawned from inside nvim |
| claudecode.nvim | ~/.config/nvim/lua/plugins/claudecode.lua |
| opencode.nvim | ~/.config/nvim/lua/plugins/opencode.lua · model in ~/.config/opencode/opencode.jsonc |
| which-key groups | ~/.config/nvim/lua/plugins/which-key.lua · <leader>a = AI/Claude, <leader>o = opencode |
| claude CLI | ~/.local/bin/claude |