# CodeCompanion.nvim > AI coding, Vim style. CodeCompanion is a plugin which enables you to code with AI, using LLMs and agents, in Neovim. ## Table of Contents ### Guides - [Choosing an Adapter](/guides/choosing-an-adapter.md): Pick between GitHub Copilot, an API provider, a local model, an OpenAI-compatible endpoint or an agent for CodeCompanion in Neovim, and set it up. - [Coding with an Agent](/guides/coding-with-an-agent.md): Use Claude Code, Codex and other agents in a CodeCompanion chat buffer via the Agent Client Protocol, including choosing a default model and mode. - [Running Local Models](/guides/running-local-models.md): Run CodeCompanion against a local model in Neovim with Ollama, including choosing the model, connecting to another machine and using tools. - [Connecting an OpenAI-Compatible Provider](/guides/openai-compatible-providers.md): Connect CodeCompanion to any provider that speaks the OpenAI API, such as a company gateway, LM Studio or vLLM, without writing an adapter. - [Controlling Tool Approvals](/guides/tool-approvals.md): Decide which tools an LLM can run in CodeCompanion without asking, and which need your approval first. - [Reviewing an Agent's Changes](/guides/reviewing-changes.md): Review the edits an LLM or agent has made in Neovim like a pull request, then accept, revert or comment on each one. - [Setting Up Web Search](/guides/web-search.md): Give the LLM in a CodeCompanion chat buffer access to web search, pick the search provider it uses, and fetch specific pages. - [Sharing Rules and Skills Across Projects](/guides/sharing-rules-and-skills.md): Give the LLM your conventions once, with rules files like AGENTS.md and CLAUDE.md and with skills, and have them apply in every project. - [Running Background Tasks on a Cheaper Model](/guides/background-model.md): Run chat titles, compaction and the tool judge on a cheaper model than your main chat. ### Usage - [Using the Action Palette](/usage/action-palette.md): Open chats, sessions, prompts and workflows from a single menu in Neovim. - [Using the Chat Buffer](/usage/chat-buffer.md): Converse with an LLM or an agent in a Neovim buffer, sharing context and switching adapters as you go. - [Using the CLI](/usage/cli.md): Share context and send prompts from Neovim to CLI agents like Claude Code and Codex. - [Using Code Reviews](/usage/code-review.md): Leave comments on an agent's changes where the code is, send them all at once, and iterate in rounds - a pull request review, in Neovim. - [Using the Inline Interaction](/usage/inline.md): Edit code directly in a Neovim buffer with CodeCompanion's inline interaction, with diff review and visual selections. - [Using the Prompt Library](/usage/prompt-library.md): Run prompts from your prompt library with a keymap, the command line or a slash command in the chat buffer. - [Using Workflows](/usage/workflows.md): Run a chain of prompts that CodeCompanion sends to the LLM in turn, from the Action Palette. - [Using the UI](/usage/ui.md): Style CodeCompanion's highlight groups and read chat metadata to build your own statusline. #### Chat Buffer - [Using Agents and Tools](/usage/chat-buffer/agents-tools.md): Let an LLM edit files, run commands and search the web from the chat buffer, with tool groups, approvals and approval modes. - [Using Editor Context](/usage/chat-buffer/editor-context.md): Share buffers, diagnostics, git diffs, terminal output and other Neovim state with an LLM from the chat buffer. - [Using Rules](/usage/chat-buffer/rules.md): Add rules files such as AGENTS.md, CLAUDE.md and Cursor rules to the chat buffer, giving an LLM persistent instructions and project context. - [Using Skills](/usage/chat-buffer/skills.md): Add agent skills to the chat buffer, so an LLM can read their instructions when a task calls for them. - [Using Slash Commands](/usage/chat-buffer/slash-commands.md): Add files, buffers, URLs, help tags and symbols to the chat buffer, and manage sessions, MCP servers and ACP agents, with slash commands. ### Configuration - [Configuring the Action Palette](/configuration/action-palette.md): Change how the Action Palette looks, which picker it uses and which built-in items it lists. - [Configuring ACP Adapters](/configuration/adapters-acp.md): Connect CodeCompanion to agents such as Claude Code, Codex and Gemini CLI over the Agent Client Protocol. - [Configuring HTTP Adapters](/configuration/adapters-http.md): Connect CodeCompanion to an LLM provider, and set its API key, model and parameters. - [Configuring the Chat Buffer](/configuration/chat-buffer.md): Set the chat buffer's adapter, completion, keymaps, editor context, slash commands and syncing. - [Configuring the CLI](/configuration/cli.md): Define CLI agents such as Claude Code and Codex, install their hooks and choose how their terminal looks and behaves. - [Configuring Code Reviews](/configuration/code-review.md): Change how code review comments look, remap the review window's keymaps, auto-accept files and choose where reviews are stored. - [Configuring Extensions](/configuration/extensions.md): Install and configure extensions that add features to CodeCompanion, whether from a plugin or your own config. - [Configuring the Inline Interaction](/configuration/inline.md): Choose the adapter, keymaps, editor context and layout for the inline interaction, which writes an LLM's response straight into a Neovim buffer. - [Configuring MCP Servers](/configuration/mcp.md): Connect MCP servers to CodeCompanion, choose which start with every chat and override the behaviour of their tools. - [Configuring the Prompt Library](/configuration/prompt-library.md): Write your own prompts for the prompt library, in Markdown or Lua, and run them from the Action Palette, a keymap or a slash command. - [Configuring Rules](/configuration/rules.md): Create rule groups from files such as AGENTS.md, CLAUDE.md and Cursor rules, choose which load with every chat and set how they're parsed. - [Configuring Skills](/configuration/skills.md): Choose where CodeCompanion finds SKILL.md files, group skills together and load them into every chat. - [Configuring System Prompts](/configuration/system-prompt.md): Replace or extend the system prompts CodeCompanion sends with every chat and tool request. - [Configuring Other Options](/configuration/others.md): Set the language LLMs respond in, the log level, per-project config and whether code can be sent to an LLM. #### Chat Buffer - [Configuring Callbacks](/configuration/callbacks.md): Hook into the chat buffer's lifecycle to block a submission, trim tool output or edit the message history. - [Configuring Context Management](/configuration/context-management.md): Keep a chat buffer inside the LLM's context window by editing old tool results and compacting the conversation. - [Configuring the Diff](/configuration/diff.md): Choose when CodeCompanion shows a diff, where it appears and how it's highlighted. - [Configuring Sessions](/configuration/sessions.md): Save chats to disk and resume them later, choosing when they're saved and where. - [Configuring Tools](/configuration/tools.md): Add your own tools and tool groups, control approvals, set default tools and configure the LLM judge and web search. - [Configuring the Chat Buffer UI](/configuration/ui.md): Change the chat buffer's window layout, icons, folding, scrolling, headers and reasoning output. ### Extending - [Extending with Adapters](/extending/adapters.md): Build your own HTTP adapter to connect CodeCompanion to any LLM. - [Extending with Agentic Workflows](/extending/agentic-workflows.md): Chain prompts with tool calls so an LLM can edit code, run your tests and keep fixing until they pass. - [Extending with Extensions](/extending/extensions.md): Build a CodeCompanion extension, distributed as a Neovim plugin or defined in your own config. - [Extending with Rules Parsers](/extending/parsers.md): Write your own rules parser to transform a rules file before it's shared with an LLM. - [Extending with Tools](/extending/tools.md): Build your own tools that an LLM can call to run functions and shell commands in Neovim. - [Extending with UI Recipes](/extending/ui.md): Recipes for showing CodeCompanion's progress and chat metadata in Neovim with Fidget.nvim, lualine.nvim and heirline.nvim. ### Reference - [Commands](/commands.md): Look up every CodeCompanion command and the arguments each one takes. - [Keymaps](/keymaps.md): The default keymaps in CodeCompanion's chat buffer, inline diff and code review window. - [Events](/usage/events.md): Every event CodeCompanion fires, and how to hook into them from your Neovim config. - [Architecture](/architecture.md): Understand how CodeCompanion keeps a conversation inside the LLM's context window, for contributors and curious users. - [Agent Client Protocol (ACP)](/agent-client-protocol.md): Check which parts of the Agent Client Protocol (ACP) CodeCompanion implements, and how it talks to agents. - [Model Context Protocol (MCP)](/model-context-protocol.md): Check which parts of the Model Context Protocol (MCP) CodeCompanion implements, and how MCP servers reach the chat buffer. - [Integrations](/integrations.md): Connect CodeCompanion to other applications, including herdr, which shows whether CodeCompanion is idle, working or blocked. - [Upgrading CodeCompanion](/configuration/upgrading.md): Update your config for the breaking changes in each major version of CodeCompanion. - [Troubleshooting](/troubleshooting.md): Diagnose problems with CodeCompanion in Neovim with the health check, the log file and the debug window. ### Other - [Getting Started](/getting-started.md): Go from a fresh install of CodeCompanion to an LLM editing code in your project, and review what it changed. - [Installation](/installation.md): Install CodeCompanion.nvim and its dependencies, then add extensions and the plugins it works with.