Sidekick: keep using neovim while a dozen agents rewrite your code Sidekick, a new open-source tool, acts as a conduit between Neovim and AI coding agents like Claude Code and Codex, blocking edits to files with unsaved changes to prevent data loss. The tool also auto-refreshes Neovim buffers when AI agents modify open files and can inject visual selections from Neovim into AI prompts. Sidekick aims to protect developers' flow states by ensuring AI agents wait while they are actively editing, without requiring confirmation prompts or policy files. Protects your unsaved Neovim work from Claude Code, Codex, opencode, pi, and Crush. A conduit between Neovim and your AI agents — so they wait when you're typing. Skip to 1:20 to see a block. The same recording is bundled in the binary — run sidekick demo after install to play it back offline. I do less and less coding by hand. The part I still do, I do very deliberately — pop open a new pane, open Neovim, start editing. It's a flow state I have to push myself into. The catch: Neovim is the only thing in the system that knows I'm typing. When the agent in the next pane decides the file I'm in needs editing, the buffer reloads, my work gone. So I decided to do something about it. Sidekick is the conduit between the editor and the agents. When you have unsaved changes in a buffer, the agents wait — the edit is denied, your buffer is untouched. Save the file and the next attempt proceeds. No flags, no confirmation prompts, no policy file. The 99% of edits that don't conflict with you go through untouched. The other direction works too: when the AI modifies a file you have open, Sidekick refreshes the buffer in every Neovim instance, cursor position preserved. - The AI waits on a file while you're editing it. You'll see this in Neovim: Edit blocked — file has unsaved changes . - A file the AI edits while you have it open is auto-reloaded — no :e dance. - A current or recent visual selection in Neovim can be added to your next Claude Code, Codex, opencode, or pi prompt as context. Select code, type the prompt, hit enter. Everything else stays the same. You keep using nvim like normal. The one-liner installs the binary with Cargo, registers Claude Code edit/refresh hooks, and adds the shell alias. Pipe through less first if you want to read it. curl -sSL https://raw.githubusercontent.com/NishantJoshi00/sidekick/main/scripts/install.sh | bash Then restart your shell, or source the rc file the installer updated, and verify with sidekick doctor : sidekick doctor ✓ sidekick v0.6.0 on PATH ~/.cargo/bin/sidekick ✓ NVIM v0.10.0 on PATH · AI harnesses: Claude Code, Codex ✓ Claude Code hook registered ✓ Codex plugin installed ✓ nvim alias: nvim → sidekick neovim zsh · no Neovim opened here · last activity: never If a row fails, sidekick doctor --fix offers consent-gated repairs for the Claude Code hook, Codex plugin, opencode plugin, pi extension, and nvim alias. It shows the diff before writing anything. The installer covers protection and buffer refresh for Claude Code. For Claude Code prompt-context injection, install the Claude Code plugin or add the UserPromptSubmit hook shown below. For Codex, run sidekick init or sidekick doctor --fix after installing the binary. Sidekick installs the Codex plugin into your personal Codex marketplace, enables plugin hooks , and enables sidekick@personal . Manual install cargo + Claude Code plugin 1. Install the binary cargo install sidekick 2. Inside Claude Code, register the hooks bundled in this repo /plugin marketplace add NishantJoshi00/claude-plugins /plugin install sidekick@nishant-plugins 3. Add the shell alias to ~/.zshrc or ~/.bashrc alias nvim='sidekick neovim' Don't have Rust? curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh . Manual Claude Code hook configuration no plugin Add to ~/.claude/settings.json : { "hooks": { "PreToolUse": { "matcher": "MultiEdit|Edit|Write", "hooks": { "type": "command", "command": "sidekick hook" } } , "PostToolUse": { "matcher": "MultiEdit|Edit|Write", "hooks": { "type": "command", "command": "sidekick hook" } } , "UserPromptSubmit": { "matcher": "", "hooks": { "type": "command", "command": "sidekick hook" } } } } The UserPromptSubmit entry is optional. It is the one that adds your Neovim visual selection to Claude's prompt context. sidekick doctor prints this matrix per harness; here it is in one place. A ✓ is a feature sidekick exercises fully through that harness's hook surface; a — is an upstream gap the harness doesn't expose the hook event sidekick would need . | Harness | Edit deny | Buffer refresh | Selection injection | |---|---|---|---| | Claude Code | ✓ | ✓ | ✓ | | Codex | ✓ | ✓ | ✓ | | opencode | ✓ | ✓ | ✓ | | pi | ✓ | ✓ | ✓ | | Crush | ✓ | — | — | Use with Codex Codex uses plugin-bundled hooks. After installing the sidekick binary, let Sidekick wire the plugin and config: sidekick init or: sidekick doctor --fix The repair writes the plugin to ~/plugins/sidekick , registers it in ~/.agents/plugins/marketplace.json , enables features .plugin hooks = true , and enables plugins."sidekick@personal" .enabled = true in ~/.codex/config.toml . Codex may ask you to review and trust the new hook before it runs. Run sidekick doctor to confirm. See plugins/codex/ /NishantJoshi00/sidekick/blob/main/plugins/codex for details. Use with opencode opencode uses a plugin system instead of CLI hooks. After installing the sidekick binary, drop the plugin into your global opencode config: mkdir -p ~/.config/opencode/plugin curl -sSL https://raw.githubusercontent.com/NishantJoshi00/sidekick/main/plugins/opencode/sidekick.ts \ -o ~/.config/opencode/plugin/sidekick.ts opencode loads it at startup. If sidekick is not on PATH , the plugin no-ops rather than blocking opencode. For a per-project install, use