Send file:line references and review comments from Neovim to CLI coding
agents (Claude Code, Pi, OpenCode, …) running in other panes of the same
Rex session.
- Finds your agents. Uses the agent in the same tab, or the only one in the session. If there are several, it asks which one.
- References. Type
path:12orpath:12-20at the agent's cursor in the middle of a message you're writing. - Review comments. Comment on lines or selections like a code review, then send them all at once with file:line and the code they refer to.
- Neovim ≥ 0.10
- Nvim running inside a Rex terminal (
REX_SESSION/REX_BLOCKset), withrexonPATH
Run :checkhealth rex-relay to check your setup and see the agents it finds.
{ "crierr/rex-relay.nvim", opts = {} }Options (defaults shown):
opts = {
prefix = "<leader>a", -- keymap prefix
keymaps = true, -- false: no keymaps, use :Relay or the Lua API
}:Relay works without calling setup(). setup() only adds the keymaps.
| Key | Command | Does |
|---|---|---|
<leader>aI |
:[range]Relay ref |
type path:12 (path:12-20 for a range) at the agent's cursor; never submits |
<leader>ai |
:[range]Relay ref-focus |
same, then focus the agent's pane |
<leader>ac |
:[range]Relay comment |
comment the line / selection |
<leader>ae |
:Relay edit |
edit the comment under the cursor |
<leader>ad |
:Relay delete |
delete the comment under the cursor |
<leader>al |
:Relay list |
comments in the quickfix list |
<leader>as |
:Relay send |
paste all comments into the agent's input, then clear them |
<leader>aS |
:Relay submit |
same, and press Enter |
:Relay clear |
drop all comments |
In :Relay list, e edits and d deletes the entry under the cursor.
Edit and delete ask which one when several comments cover a line. Comments are kept in
memory only and follow your edits. Paths are relative to
the agent's working directory. In Neo-tree and the Snacks explorer, ref sends the paths of the
selected files or folders (no line numbers). comment, edit and delete
don't work there. See :help rex-relay.
- Finding agents.
rex block lslists the session's panes, andrex block call program_statusreports which agent each one runs (claude-code,pi,opencode, …). No guessing from process names. - Sending.
rex block call writetypes the text, wrapped in bracketed paste when the agent has enabled it, so multi-line text arrives as one paste.submitpresses Enter 300 ms later.
nvim --headless -u NONE -l tests/run.luaTo use a local checkout, point lazy.nvim at it with
{ dir = "~/src/rex-relay.nvim", opts = {} }. lazy doesn't build help tags for
dir plugins, so run :helptags ~/src/rex-relay.nvim/doc once.
Inspired by herdr-nvim.