jonathan warykowskijwarykowski

herdr.nvim

Send code from Neovim to a coding agent running in herdr, without leaving the editor.

Select some lines, run :HerdrSend and type what you want (“why does this panic?”, “add a test for this”). The agent in the next herdr pane gets your instruction, the file:line, the code and any diagnostics on those lines. It works with any agent herdr runs: Claude Code, Codex, OpenCode and others.

Install

You need Neovim 0.11 or later, running in a herdr pane with an agent in another pane of the same workspace. With lazy.nvim:

return {
	"jwarykowski/herdr.nvim",
	cmd = { "HerdrSend", "HerdrFocus" },
	keys = {
		{ "<leader>ai", "<cmd>HerdrSend<cr>", desc = "agent: ask about this line" },
		{ "<leader>ai", ":HerdrSend<cr>", mode = "x", desc = "agent: ask about selection" },
		{ "<leader>af", "<cmd>HerdrFocus<cr>", desc = "agent: focus its pane" },
	},
	opts = {},
}

:checkhealth herdr checks the binary, the pane and the agents it can see.

Commands

CommandWhat it does
:HerdrSendSend an instruction with the cursor’s line, or a selection, to an agent
:HerdrSend!The same, choosing the agent again
:HerdrFocusJump to the agent’s pane; :HerdrFocus! to choose

With one agent in the workspace it goes straight there; with several you pick once and later sends go to the same one. The pane Neovim runs in is never offered, so an agent running Neovim can’t prompt itself.

Configuration

require("herdr").setup({
	cmd = nil,           -- herdr binary; default $HERDR_BIN_PATH, else herdr on $PATH
	diagnostics = true,  -- add diagnostics on the sent lines
	scope = "workspace", -- or "all": agents from every herdr workspace
})