cc.nvim CLAUDE.md

Repository instructions for cc.nvim, a Neovim plugin that replaces Claude Code’s terminal interface with editable prompt and foldable output buffers.

In plain words
What is it for?
Use them when modifying cc.nvim, its Claude or Codex providers, the message parser and renderer, or related tests and documentation.
Why use it?
Contributors need shared guidance about the plugin’s architecture, providers, testing, coding style, and known pitfalls. The instructions also explain how Claude and Codex subprocesses connect to the editor.

Instructions file

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/robcmills/cc.nvim/claude-md
Clone the repo
git clone --depth 1 https://github.com/robcmills/cc.nvim
Per session 1,467 This file is loaded in full into every session.
When invoked 1,467 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01467 $0.01467
Opus 5 $0.00733 $0.00733
Sonnet 5 $0.00293 $0.00293
Haiku 4.5 $0.00147 $0.00147

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

Security

Grade A, and why

cc.nvim CLAUDE.md scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 117 lines

How it starts

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

cc.nvim

Pure-Lua Neovim plugin that replaces the Claude Code TUI with two buffers — an editable markdown prompt and a foldable output buffer. Spawns the claude CLI as a persistent subprocess via vim.uv.spawn() and renders its NDJSON stream-json protocol. Zero runtime dependencies beyond claude in $PATH and Neovim 0.10+.

User-facing docs live in README.md; contributor guidance in CONTRIBUTING.md. This file is for agents working in the repo.

Architecture

Sessions are backed by a provider (lua/cc/providers/) selected by config.provider: claude (default) or codex. A provider owns its subprocess, wire protocol, history listing, and approval encoding, and drives the shared renderer through provider-neutral entry points (output.lua methods, session.lua fields). Never leak provider wire messages into shared UI code; translate inside the provider.

Claude pipeline (one direction, top to bottom):

providers/claude.lua   provider interface (spawn/send/interrupt/history)
process.lua            spawn + stdio pipes (vim.uv)
parser.lua             NDJSON line buffer
router.lua             dispatch by message type
output.lua             render to buffer  ←→  session.lua  (turn/token/cost state)

Codex pipeline: providers/codex.lua spawns codex app-server, reuses parser.lua for line splitting, and does JSON-RPC correlation + thread-item → render translation itself (no router). Protocol reference: codex app-server generate-json-schema --out <dir> from the installed CLI; verified against codex-cli 0.144.5.

  • plugin/cc.lua registers :Cc* commands; lua/cc/init.lua is the public module and instance manager. Multiple sessions are supported, keyed by prompt bufnr in a module-level instances table. attach_provider in init.lua is the single construction path for new/clear/resume sessions.
  • lua/cc/output/ holds extracted render helpers (cost, foldtext, timers, tool_body). Most rendering work lands in output.lua plus one of these.
  • NDJSON protocol reference (when extending message handling): ~/src/claude-code/src/entrypoints/sdk/coreSchemas.ts and ~/src/claude-code/src/cli/structuredIO.ts. Caveat: this local copy is a snapshot from around March 2026 and will never be updated. Treat any determination made from it as suspect and verify against the running CLI before relying on it. The further we get from that snapshot date, the more likely the source has drifted, and the more we'll have to reverse-engineer observed CLI behavior when it doesn't match what the source predicts.

Read the full file on GitHub · 117 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 · 117 lines · 1,467 tokens per session scan A 28a1e7668e74

Subscribe to this mod's changes

cc.nvim CLAUDE.md is an instructions file published in the GitHub repository robcmills/cc.nvim (2 stars, last pushed 6d ago), licensed MIT. It adds 1,467 tokens to every session, about $0.0073 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.