CodeCompanion.nvim
codecompanion.nvim
A Neovim AI assistant with LLM chat and Claude Code, Codex, Gemini CLI running right inside the editor via ACP and MCP
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Launches third-party CLI agents with access to project files right from the editor
Install
Manual install
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {},
}Snippet for lazy.nvim. See the docs for other plugin managers.
This is third-party code. Review the repository files before installing.
What it does
CodeCompanion.nvim adds a chat buffer to Neovim for working with LLMs (Anthropic, OpenAI, Gemini, GitHub Copilot and others) and, separately, Agent Client Protocol support that runs full coding agents right inside the editor: Claude Code, Codex, Gemini CLI, OpenCode, Copilot CLI and others. A built-in MCP client lets you wire external MCP servers in as chat tools. The editor gets slash commands to pull a buffer, file, or command output into context, plus diffs to review edits before accepting them.
Who it is for. For Neovim developers who want an LLM chat and coding agents inside the editor instead of switching to a separate terminal or IDE.
Good fit when
- You work in Neovim and want an LLM chat with buffer context without switching windows
- You need to run Claude Code, Codex or Gemini CLI right inside an editor tab via ACP
- You need to wire external MCP servers in as chat tools in Neovim
Not a fit when
- You do not use Neovim at all
- You need a ready agent out of the box with no Lua config and adapter setup
Example request
Open the CodeCompanion chat, pull in the current buffer, and explain why this test is failingLimitations
Requires Neovim and familiarity with configuring plugins in Lua. Cloud providers need your own API keys, and ACP agents like Claude Code or Codex need their own CLI installed separately.
How to disable. Remove the codecompanion.nvim block from your plugin manager's config (lazy.nvim, packer and others) and restart Neovim.
Security check
- Launches third-party CLI agents with access to project files right from the editor
README in short
The README presents CodeCompanion.nvim as a Neovim AI assistant combining LLM chat (Anthropic, OpenAI, Gemini, Copilot, Ollama and others) with Agent Client Protocol support for running Claude Code, Codex, Gemini CLI, OpenCode, Copilot CLI and other agents inside the editor. It also documents a built-in MCP client for wiring in external servers as tools. Install via lazy.nvim or another plugin manager with plenary.nvim and nvim-treesitter as dependencies; diagnose with :checkhealth codecompanion. An actively maintained project with many community adapters.
FAQ
Is this a replacement for Claude Code or a wrapper around it?
A wrapper: via Agent Client Protocol, CodeCompanion launches the real Claude Code, Codex or another CLI agent inside a Neovim buffer instead of reimplementing an agent.
Can it be used without cloud keys?
Yes, there is an adapter for local models through Ollama.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything