opencode.nvim AGENTS.md

Repository guidance for opencode.nvim, a Neovim plugin that connects the editor to the opencode command-line tool. It describes the plugin’s entry points, configuration, dependencies, and editor events.

In plain words
What is it for?
Use it when modifying opencode.nvim’s Lua code, configuration, user commands, prompts, sessions, status display, permissions, or edit-review features.
Why use it?
It gives coding agents the project-specific details needed to change this plugin without guessing how its configuration or editor integration works.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/nickjvandyke/opencode.nvim/agents-md
Clone the repo
git clone --depth 1 https://github.com/nickjvandyke/opencode.nvim

Made for: Codex, OpenCode.

Per session 1,133 This file is loaded in full into every session.
When invoked 1,133 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01133 $0.01133
Opus 5 $0.00566 $0.00566
Sonnet 5 $0.00227 $0.00227
Haiku 4.5 $0.00113 $0.00113

Measured yesterday against content hash 3c9cd1c8acb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode.nvim AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Required**: `opencode` CLI, `curl`
AGENTS.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

opencode.nvim — agent guide

What it is

A Neovim Lua plugin that bridges Neovim and the opencode CLI (external binary). It discovers or starts an opencode server, communicates via REST + SSE, and provides UI for prompting, context injection, session management, and edit review.

Entrypoints

  • Public API: lua/opencode.lua — exports ask(), select(), prompt(), command(), operator(), format(), statusline
  • Config: vim.g.opencode_opts global (not a setup() call); merged with defaults from lua/opencode/config.lua
  • Plugin files: plugin/highlights.lua sets highlight groups; plugin/events/ registers four autocmd groups (OpencodeReload, OpencodeStatus, OpencodePermissions, OpencodeEdits) that listen for OpencodeEvent:* User events to reload edited buffers, update statusline, display permission requests, and diff edit proposals

Config quirks

  • Config is passed via vim.g.opencode_opts for simpler UX and faster startup (see lua/opencode/config.lua:6)
  • snacks.nvim nested opts go under ask.snacks / select.snacks, then get merged into the passed options at usage time (lua/opencode/ui/ask/init.lua, lua/opencode/ui/select.lua)
  • vim.o.autoread is automatically set to true when events.reload.enabled = true (the default) unless the user has explicitly configured it
  • Neovim doesn't support mixed integer/string keys in vim.g, which affects some snacks.input options; workaround: modify require("opencode.config").opts directly

Dependencies

  • Required: opencode CLI, curl
  • Auto-discovery: pgrep + lsof (Unix, unless server.url is set)
  • Optional: snacks.nvim (enhances ask() with snacks.input, select() with snacks.picker), blink.cmp (completion plugin with LSP source)
  • No hard Lua dependencies beyond Neovim itself

Verification commands

# Type-check (requires neovim + lua-language-server + cloned snacks/blink)
lua-language-server --configpath .luarc.ci.json --check=.

# Format check
stylua --check .

# Format in place
stylua .

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 77 lines · 1,133 tokens per session scan A 3c9cd1c8acb4

Subscribe to this mod's changes

opencode.nvim AGENTS.md is an instructions file published in the GitHub repository nickjvandyke/opencode.nvim (3,797 stars, last pushed 10d ago), licensed MIT. It adds 1,133 tokens to every session, about $0.0057 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.