codecompanion.nvim
AGENTS.md6.9k starsChanged 3 months agoApache-2.0View on GitHub
This is a Neovim plugin written in Lua, which allows developers to code with LLMs and agents from within Neovim. Tests use Mini.Test with child processes. Always run the full test suite after changes and ensure all tests pass before considering work complete. The full style guide, with worked examples: Core: lua/codecompanion/
Trending
More talk lately.about the whole repository
Who's talking about olimorris/codecompanion.nvim
- Aider-AI/aider“Feature: Add GitHub Copilot as model provider”GitHub · Nov 3, 2024 · 119 reactions
- BerriAI/litellm“[Feature]: Add GitHub Copilot as model provider”GitHub · Nov 3, 2024 · 24 reactions
- kirodotdev/Kiro“ACP support”GitHub · Jan 9, 2026 · 9 reactions
- nvim-lua/plenary.nvim“Time for a new stable release?”GitHub · Oct 27, 2024 · 4 reactions
- diegosouzapw/OmniRoute“fix: forward client x-initiator header to GitHub Copilot upstream”GitHub · Apr 13, 2026 · 3 reactions
The biggest 5 of 44 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 44
Talked about on GitHub, Bluesky and Hacker News (44 times).
On GitHub · 30
- Nov 3, 2024Feature: Add GitHub Copilot as model provider — Aider-AI/aider119 reactions · 214 comments
- Nov 3, 2024[Feature]: Add GitHub Copilot as model provider — BerriAI/litellm24 reactions · 28 comments
- Jan 9, 2026ACP support — kirodotdev/Kiro9 reactions · 3 comments
- Oct 27, 2024Time for a new stable release? — nvim-lua/plenary.nvim4 reactions · 1 comment
- Apr 13, 2026fix: forward client x-initiator header to GitHub Copilot upstream — diegosouzapw/OmniRoute3 reactions · 1 comment
25 more on GitHub
- Mar 6, 2025UI enhancements — augmentcode/augment.vim3 reactions · 11 comments
- Feb 22, 2025Commands are propagated into fzf-lua when `dot_repeat` is enabled — saghen/blink.cmp3 reactions · 14 comments
- May 20, 2026~/.config/github-copilot/apps.json not created/saved even though authentication succeeds — github/copilot.vim2 reactions · 10 comments
- Dec 22, 2025Message history not passed to ACP adapters on chat restoration — ravitemer/codecompanion-history.nvim2 reactions · 1 comment
- Oct 15, 2025Timeout on vim.pack install — neovim/neovim2 reactions · 8 comments
- Aug 2, 2025Add prompt library builder for codecompanion.nvim extension — Davidyz/VectorCode2 reactions · 2 comments
- Jul 6, 2025feat: add Fidget component for displaying Minuet request status — milanglacier/minuet-ai.nvim2 reactions
- May 19, 2025fix: add dot-repeat hack to terminal mode — saghen/blink.cmp2 reactions
- Aug 6, 2024feat(ai): add `codecompanion.nvim` as alternative to `copilotchat.nvim` — LazyVim/LazyVim2 reactions · 6 comments
- Jul 5, 2026feat request: session config options — stefandevo/glm-acp-agent1 reaction · 2 comments
- May 28, 2026feature: integration for vectorcode?d — avante-corp/avante.nvim1 reaction · 5 comments
- Feb 24, 2026when a conversation is restored the default model is used — ravitemer/codecompanion-history.nvim1 reaction
- Feb 1, 2026Diff is not shown on CodeCompanion integration with OpenCode — anomalyco/opencode1 reaction · 4 comments
- Sep 23, 2025Support Claude $ARGUMENTS variable — dyamon/codecompanion-filewise.nvim1 reaction
- Jul 27, 2025[BUG] CodeCompanion tools should work with relative paths. — Davidyz/VectorCode1 reaction · 5 comments
- Oct 5, 2026Bump the submodules group with 9 updates — z0rc/dotfiles0 reactions
- Sep 30, 2026Bump the submodules group with 5 updates — sscoolqaz/dotfiles0 reactions
- Sep 30, 2026build(deps): Bump the submodules group with 5 updates — yindia/dotfiles0 reactions
- Sep 29, 2026Bump the submodules group with 7 updates — z0rc/dotfiles0 reactions
- Jun 19, 2026[feature] support rockspec — carlos-algms/agentic.nvim0 reactions · 1 comment
- Jun 6, 2026[Add] CodeCompanion.nvim (olimorris/codecompanion.nvim) — PyTorchKR/landscape0 reactions
- May 7, 2026Bug: Optional tool parameters generate invalid schema for Azure/OpenAI compatible providers — cairijun/codecompanion-agentskills.nvim0 reactions · 1 comment
- Mar 12, 2026feat: codecompanion.nvim ekle - AI chat ve inline edit — makbulut1/nvim0 reactions
- Sep 15, 2025Add codecompanion — rentziass/dotfiles0 reactions · 3 comments
- Apr 17, 2025Select multiple files from file picker — azorng/goose.nvim0 reactions · 1 comment
On Bluesky · 12
- Nov 19, 2024📦 olimorris / codecompanion.nvim ⭐ 1,074 (+16) 🗒 Lua ✨ AI-powered coding, seamlessly in Neovim. Supports Anthropic, Copilot, Gemini,… — @github-trending.bsky.social3 likes and reposts
- Dec 11, 2024I use github.com/olimorris/co... with ollama and quen2.5-coder for ai features in nvim. It works pretty well — @barnabasj.bsky.social2 likes and reposts · 1 reply
- Feb 21, 2026also started dabbling in CodeCompanion and it is *so sick*. i spend so much time writing, and the opencode experience is adequate but… — @jauntywunderkind.bsky.social1 likes and repost · 1 reply
- Feb 3, 2026Thanks for the ping! This is so cool. I'm a vim user myself but this effort to stay in the editor is so great, I love it. The composition… — @jauntywunderkind.bsky.social1 likes and repost · 1 reply
- Dec 24, 2024📦 olimorris / codecompanion.nvim ⭐ 1,544 (+9) 🗒 Lua ✨ AI-powered coding, seamlessly in Neovim — @github-trending.bsky.social1 likes and repost
7 more on Bluesky
- Dec 12, 2024watched a video on devin and the slack based workflow seems wierd. i feel like i prefer to be copiloting. i am gonna try this out tomorrow.… — @handle.invalid1 likes and repost · 1 reply
- Nov 17, 2024Here’s another one that seems popular github.com/olimorris/co... — @meangrape.com1 likes and repost · 1 reply
- Nov 10, 2024Мені знову було скучно, і я поліз дивитись які ще є цікаві інтеграції LLM з neovim. https://github.com/olimorris/codecompanion.nvim… — @partizan.twiukraine.com.ap.brid.gy1 likes and repost
- Apr 5, 2024codecompanion.nvim の設定が大きく変わったので、追従した github.com/olimorris/co... — @hokupod.dev1 likes and repost · 1 reply
- Apr 26, 2025Neovim AI plugins: really enjoying using CodeCompanion after struggling with Avante for a while. Avante's UI and buffer editing were always… — @yokelpole.bsky.social0 likes and reposts · 1 reply
- Mar 14, 2025I’ve found this one, which seems to have a bunch of stuff which looks good for getting started github.com/olimorris/co... — @chrisarmstrong.link0 likes and reposts · 1 reply
- Nov 10, 2024Still searching for the right llm assistant experience. I tried @zed.dev but it's still missing some things (leap, multibiffers and… — @dlants.bsky.social0 likes and reposts · 1 reply
On Hacker News · 2
- Aug 26, 2024LLM in Neovim with Inline Assistant. Supports Anthropic, Gemini, Ollama, OpenAI3 points
- Jun 23, 2025CodeCompanion: AI-powered coding, seamlessly in Neovim1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Plain language: avoid jargon shortcuts in code, comments, commit messages, and chat.
- Very specific: line 22
Comments earn their place: don't restate what a readable line of code already says.
- Distinctive: line 28
Functions: keep under 50 lines
- Distinctive: line 29
Globals: avoid; use module-local state
- Distinctive: line 30
Code blocks: use four backticks with language spec unless in a markdown file
- Distinctive: line 46
Don't over-explore the codebase with excessive grep/read calls.
- Distinctive: line 47
When the user asks to fix tests, fix the tests - not the source code - unless explicitly asked otherwise.
- Very specific: line 48
If you're working with directories or files, utilise the functions in codecompanion/utils/files.lua ensuring you join paths with …
- Very specific: line 55
When running make test_file tests, do not append | tail -12 or similar to filter the output.
- Very specific: line 57
Test the behaviour, not the obvious.
- Distinctive: line 62
Do what has been asked; nothing more, nothing less.
- Distinctive: line 63
NEVER create files unless absolutely necessary
- Distinctive: line 64
ALWAYS prefer editing existing files
- Distinctive: line 65
NEVER proactively create documentation files
- Very specific: line 66
ALWAYS keep memory in the current working directory and memories/ folder
- Very specific: line 73
After ANY correction from the user: update the PERSONAL.md with the pattern
- Distinctive: line 74
Write rules that prevent the same mistake from happening again
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CodeCompanion.nvim
This is a Neovim plugin written in Lua, which allows developers to code with LLMs and agents from within Neovim. Tests use Mini.Test with child processes. Always run the full test suite after changes and ensure all tests pass before considering work complete.
Commands
make format- StyLua (120 cols, 2 spaces). Run before committing.make test- full test suite (Mini.Test)make test_file FILE=path- targeted testsmake docs- regenerate vimdoc. Run this after changing any docs pages. ReadVOICE.mdbefore editing anything indoc/
Code conventions
The full style guide, with worked examples:
@STYLE.md
- Naming: snake_case for files/functions, PascalCase for classes, underscore prefix for private functions
- Explicit names:
patternnotpat,should_includenotinclude_ok - Readable code: names, variables, and control flow should read like clean English. Avoid generic names like
ctx- use domain-specific names (permission,request,source) - Plain language: avoid jargon shortcuts in code, comments, commit messages, and chat. Don't say "no-op" - say what the code actually does ("returns unchanged", "does nothing", "skipped because already edited")
- Comments earn their place: don't restate what a readable line of code already says. If a guard like
if type(x) ~= "number" then return endis self-evident, a comment explaining it is noise. Comment the why that isn't in the code (e.g.-- NOTE: Not handling token tables yet), not the what - Don't narrate every change: the maintainer is an expert who knows this codebase. Do NOT add a comment to explain routine code (
-- Clear the modified flag,-- Loop over the messages,-- Return early). Default to no comment. Reserve comments for genuinely non-obvious why - a subtle API quirk, a workaround, an ordering constraint - the kind of thing that would trip up even a reader who knows the codebase - Function params: take an
optstable, not a list of positional args - a new parameter then costs one edit instead of every call site. Default tooptsalone. A leading positional is earned, not assumed: it must be the single subject the function acts on and stable enough that it will never be replaced or joined by a sibling (Chat:add_message(data, opts),markdown.form_codeblock(content, opts)). If you're weighing whether an argument qualifies, it doesn't. Normalise it on the first line withopts = opts or {}and annotate the shape inline:---@param opts? { auto_submit?: boolean } - Error handling:
pcall+log:error(), return nil on failure - Type annotations: LuaCATS for public APIs. Keep doc blocks concise - one description line, params should be self-explanatory without inline comments
- Function descriptions: exactly one line. No multi-paragraph rationale, no usage examples, no "why we cache this" essays - that belongs in commit messages or a single inline
--comment at the relevant line. If you can't summarise the function in one line, the function is doing too much - Functions: keep under 50 lines
- Globals: avoid; use module-local state
- Code blocks: use four backticks with language spec unless in a markdown file
Architecture
Core: lua/codecompanion/
- Interactions (
interactions/):chat/,inline/,cmd.lua,init.lua(workflows) - Adapters (
adapters/):http/(Anthropic, OpenAI, Copilot, Ollama, Gemini, etc.),acp/(Claude Code, Codex, etc.) - Tools (
interactions/chat/tools/builtin/):ask_questions,run_command,read_file,create_file,delete_file,insert_edit_into_file/,grep_search,file_search,web_search,fetch_webpage,memory,get_changed_files,get_diagnostics,cmd_tool(factory for custom command tools) - Slash Commands (
interactions/chat/slash_commands/builtin/):/buffer,/command,/compact,/fetch,/file,/help,/image,/mcp,/mode,/now,/rules,/symbols - Editor Context (
interactions/chat/editor_context/):buffer,buffers,diagnostics,diff,messages,quickfix,selection,terminal,viewport - Config:
config.lua- tool groups (agent,files), adapter defaults, all settings - Entry point:
plugin/codecompanion.lua→lua/codecompanion/init.lua
General rules
- Don't over-explore the codebase with excessive grep/read calls. If you haven't converged on an approach after 3-4 searches, pause and share what you've found so far rather than continuing to search.
- When the user asks to fix tests, fix the tests - not the source code - unless explicitly asked otherwise.
- If you're working with directories or files, utilise the functions in
codecompanion/utils/files.luaensuring you join paths withvim.fs.joinpath - Never read
adapter.schema.model.defaultdirectly - it holds a function on Ollama and anyopenai_compatibleadapter.adapter_utils.model(adapter)gives the model as a string without ever calling that function;adapter_utils.resolve_model(adapter)calls it for the places that need the value and can afford the HTTP round-trip it may cost. Both returnstring|nil - To change an adapter's model,
adapters.set_model({ adapter = adapter, model = "gpt-4o" }), oradapters.resolve(name, { model = "gpt-4o" })when starting from an adapter name. Don't assign the schema yourself
Testing
make test_file FILE=takes a single file (tests/interactions/code_review/test_ui.lua), never a directory. Run one file per invocation- When running
make test_filetests, do not append| tail -12or similar to filter the output. This prevents the user's rules governing what can be auto-accepted, from applying - Chat buffer cursor position, scrolling and folds are verified by hand in real use. Don't add test cases for them, even alongside a fix. Ask first
- Test the behaviour, not the obvious. A case that only proves a guard clause returns
false, or that a value passes through a shared utility unchanged, earns nothing - cut it and keep the cases where the outcome could genuinely go either way - Name a case for the behaviour it pins down, and lean on contrast so a pair reads as a pair:
DOES NOT truncate a tool that is INSIDE the limit/truncates a tool that is OUTSIDE the limit
Important instructions
- Do what has been asked; nothing more, nothing less.
- NEVER create files unless absolutely necessary
- ALWAYS prefer editing existing files
- NEVER proactively create documentation files
- ALWAYS keep memory in the current working directory and
memories/folder
Self-improvement loop
The user may have shared a PERSONAL.md file with specific instructions for how they like to work. If so, follow these instructions carefully:
- Review the
PERSONAL.mdat the start of every session - After ANY correction from the user: update the
PERSONAL.mdwith the pattern - Write rules that prevent the same mistake from happening again
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

