Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Neovim AI coding plugin for chat and agent workflows
CodeCompanion.nvim brings AI chat, inline edits, code review, and workflow tools into Neovim. It works with many model providers and can talk to CLI agents through ACP, plus external tools through MCP.
Builders who use Neovim and want reusable AI help for coding inside the editor.
You can ask, edit, review, and refactor code from Neovim instead of moving work into separate apps.
What it does
Chat buffer
Open one or more chat buffers to ask questions, plan work, and keep context in the editor.
Inline transformations
Create or refactor code directly from selected text or the current buffer.
Code review workflow
Comment on changes and approve or reject agent-generated code.
Slash commands and prompt library
Use built-in slash commands and common prompts for tasks like explaining code or handling LSP errors.
Rules and context files
Load project rules from files like `CLAUDE.md` and `.cursor/rules`, plus custom rule files.
Agent and tool support
Work with agent-style workflows and attach tools to guide how the model responds.
ACP and MCP support
Connect to CLI agents through Agent Client Protocol and to external tools through Model Context Protocol.
Many providers
Use Anthropic, OpenAI, Gemini, Copilot, Ollama, OpenRouter, and other adapters.
README
A Neovim AI coding assistant for coding with LLMs (Anthropic, OpenAI, Gemini, Copilot and more) and AI agents. With built-in support for Agent Client Protocol (ACP), Model Context Protocol (MCP), and agents like Claude Code and Codex
New features are always announced here
:purple_heart: Sponsors
Thank you to the following people:
If you love CodeCompanion and use it in your workflow, please consider sponsoring me
:sparkles: Features
- :speech_balloon: Copilot Chat meets Zed AI, in Neovim
- :zap: Integrates Neovim with LLMs and Agents in the CLI
- :electric_plug: Support for LLMs from Anthropic, DeepSeek, Google Gemini, GitHub Copilot, GitHub Models, Kimi, Mistral, Novita, Ollama, OpenAI, Azure OpenAI, OpenRouter, HuggingFace and xAI out of the box (or bring your own)
- :robot: Support for Agent Client Protocol, enabling coding with agents like Augment Code, Cagent from Docker, Claude Code, Codex, Copilot CLI, Gemini CLI, Goose, Cursor CLI, Kimi CLI, Kiro, Mistral Vibe and OpenCode
- :heart_hands: User contributed and supported adapters
- :man_technologist: Code reviews enabling you to comment on and approve/reject agent code
- :battery: Support for Model Context Protocol (MCP)
- :rocket: Inline transformations, code creation and refactoring
- :art: Editor Context, Slash Commands, Agents/Tools and Workflows to improve LLM output
- :brain: Support for rules files like
CLAUDE.md,.cursor/rulesand your own custom ones - :sparkles: Built-in prompt library for common tasks like advice on LSP errors and code explanations
- :building_construction: Create your own custom prompts, Editor Context and Slash Commands
- :inbox_tray: Have multiple chats open at the same time
- :art: Support for images and PDFs as input
- :muscle: Async execution for fast performance
:camera_flash: In Action
:rocket: Getting Started
Everything you need to know about CodeCompanion (installation, configuration and usage) is within the docs.
:toolbox: Troubleshooting
Before raising an issue, there are a number of steps you can take to troubleshoot a problem:
Checkhealth
Run :checkhealth codecompanion and check all dependencies are installed correctly. Also take note of the log file path.
Turn on logging
Update your config and turn debug logging on:
-- lazy.nvim
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
-- NOTE: The log_level is in `opts.opts`
opts = {
log_level = "DEBUG", -- or "TRACE"
},
},
},
-- Other package managers
require("codecompanion").setup({
opts = {
log_level = "DEBUG", -- or "TRACE"
}
})
and inspect the log file as per the location from the checkhealth command.
Try with a minimal.lua file
A large proportion of issues which are raised in Neovim plugins are to do with a user's own config. That's why I always ask users to fill in a minimal.lua file when they raise an issue. We can rule out their config being an issue and it allows me to recreate the problem.
For this purpose, I have included a minimal.lua file in the repository for you to test out if you're facing issues. Simply copy the file, edit it and run neovim with nvim --clean -u minimal.lua.
:gift: Contributing
I am open to contributions but they will be implemented at my discretion. Feel free to open up a discussion before embarking on a PR and please read the CONTRIBUTING.md guide.
:clap: Acknowledgements
- Steven Arcangeli for his genius creation of the chat buffer and his feedback early on
- Wtf.nvim for the LSP assistant action
- CopilotChat.nvim for the rendering and usability of the chat buffer
- Aerial.nvim for the Tree-sitter parsing which inspired the symbols Slash Command
- Saghen for the fantastic docs inspiration from blink.cmp and continued PRs to the project
- Catwell for the queue inspiration that I use to stack agents and tools
- bassamsdata for the amazing
insert_edit_into_filetool (the list is endless) and ongoing contributions to this project - ravitemer for the fantastic extensions API
- Davidyz for his continued, excellent contributions that keep CodeCompanion going
- Conrad Irwin, Agus Zubiaga and Morgan Krey from Zed Industries for their support in implementing ACP
- Sidekick.nvim for the diff and terminal input inspiration
Files in the repo
- .codecompanion
- .github
- .greptile
- doc
- lua
- plugin
- queries
- scripts
- tests
- _typos.toml
- .dockerignore
- .gitignore
- .luarc.json
- AGENTS.md
- CHANGELOG.md
- CLAUDE.md
- CONTRIBUTING.md
- Dockerfile
- LICENSE
- Make.ps1
- Makefile
- minimal.lua
- README.md
- STYLE.md
- stylua.toml
- version.txt
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More plugins

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
OmO: Just type "mass ulw" keyword with your prompt. Now you are the master of graph engineering.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Opinionated Oxlint rules for rejecting low-evidence TypeScript and JavaScript patterns
Teams-first Multi-agent orchestration for Claude Code




