# Repository Briefing: olimorris/codecompanion.nvim
> Source: https://repoforai.com/repo/olimorris/codecompanion.nvim (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/olimorris/codecompanion.nvim
- **Official Docs / Website**: https://codecompanion.olimorris.dev
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Lua
- **License**: Apache-2.0
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v20.5.0 (2026-12-03) — https://github.com/olimorris/codecompanion.nvim/releases
- **Review Snapshot**: 2026-12-02 (Note: v20.5.0 on 2026-12-03 shipped after this review; verify latest release notes)
- **Deployment / Stack Signals**: Docker, MCP, CLI, API, Local AI
- **Momentum**: 6,965 ★ total (+1 24h / +9 7d) · 478 forks
- **Topics**: `acp`, `agent`, `agent-client-protocol`, `anthropic`, `claude-code`, `copilot`, `deepseek`, `gemini`, `google-gemini`, `kimi`, `llm`, `neovim`
- **When to Use**: Best for: Neovim users who want editor-native chat and inline assistance, with the option to switch between direct model APIs, local Ollama inference, and external ACP agents. Skip if: You do not use Neovim, prefer an agent's terminal interface, or require a turnkey offline stack with inference, agents, and tool permissions already configured.

## Overview
```text
### Architecture & Core Mechanics
CodeCompanion is a Lua plugin that runs inside Neovim. The repository separates plugin files into `plugin/`, Lua code into `lua/`, and queries into `queries/`. The installation example lists `plenary.nvim` and `nvim-treesitter` as dependencies. Chat buffers and inline interactions provide editor-native entry points without moving model inference into the editor.

There are two distinct backend paths: HTTP adapters connect to model services, while ACP connects to external coding-agent processes that manage their own sessions. MCP addresses tool and context integration rather than agent lifecycle or inference. Custom adapters and an extensions API make the integration layer extensible, but the selected provider or agent still determines what runs outside Neovim.

### Key Capabilities & Differentiators
The HTTP adapter lineup covers Anthropic, OpenAI, Gemini, DeepSeek, GitHub Copilot, Azure OpenAI, OpenRouter, Ollama, and other backends, giving users a choice between hosted APIs and a locally operated inference service. ACP covers a different workflow: Claude Code, Codex, Gemini CLI, and OpenCode are examples of external coding agents, not interchangeable model endpoints.

A chat buffer gives longer tasks a dedicated workspace, while inline interaction keeps requests close to the code. Tools extend chat beyond text: `@{search_help}` searches CodeCompanion help, and v20.2.0 added `overwrite_file`, which can replace file contents. For teams adopting tool-enabled workflows, the important distinction is whether a request only produces a response or can also modify the workspace.

### Trade-offs & Limitations
Compared with running Claude Code or Codex directly in a terminal, CodeCompanion adds Neovim-native interaction and lets users keep the same editor interface when switching to a direct model adapter. In return, there are more components to configure and troubleshoot: the editor dependencies, the adapter or agent, and any tools attached to the workflow. Protocol support does not make every backend behave the same way.

Hosted APIs avoid local inference sizing but introduce network dependence, provider charges, and a data-handling boundary. Ollama can keep inference local, but that alone does not establish that the full workflow is offline: agents and tools need their own review. The plugin's Apache-2.0 license is separate from provider and model terms. When using file-writing tools, establish what they can write and how changes will be reviewed before giving them access to a shared workspace.

### Hardware & Deployment Guide
Install CodeCompanion with a Neovim package manager and configure it through `require("codecompanion").setup(...)`. Add the chosen backend separately: configure hosted provider access, run Ollama for local inference, or install and configure the external agent for ACP. Start troubleshooting with `:checkhealth codecompanion`; if the problem persists, use DEBUG or TRACE logging and reproduce it with `nvim --clean -u minimal.lua`.

The Ubuntu 24.04 Dockerfile provisions Neovim nightly and development tooling, including Rust 1.93.0 and Tree-sitter CLI v0.26.5. Those are choices made by the container build, not universal runtime prerequisites for the plugin. The v20.3.0 release added ACP subagents and sends `session/close` before terminating the agent process. v20.4.0 added `:CodeCompanionCLI Resume` and refined Claude Code interactions.
```

## Key Capabilities
```text
- Editor integration: A Lua-based Neovim plugin with a chat buffer, inline interaction, and a CLI workflow.
- Model adapters: Built-in HTTP integrations include Anthropic, OpenAI, Gemini, GitHub Copilot, and Ollama; custom adapters can extend the set.
- Protocol separation: ACP connects external coding agents such as Claude Code and Codex; MCP addresses tool and context integration.
- Session lifecycle: v20.3.0 added ACP subagent support and sends `session/close` before agent termination; v20.4.0 added `:CodeCompanionCLI Resume`.
- Diagnostics: `:checkhealth codecompanion` reports dependency status and the log path; DEBUG or TRACE logging and `nvim --clean -u minimal.lua` help isolate configuration issues.
- Container scope: The Dockerfile uses Ubuntu 24.04 and provisions Neovim nightly, Tree-sitter CLI v0.26.5, and other development tools; it is not a bundled inference backend.
```

## Quick Start / Clone
```bash
-- 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"
  }
})
```
