agentleFS
shabarabashabaraba/vibing.nvim/CLAUDE.md

vibing.nvim

CLAUDE.md14 starsChanged 12 months agoMITView on GitHub

vibing.nvim is a Neovim plugin that provides a Claude chat inside Neovim by spawning the claude CLI directly (claude -p --output-format stream-json) and parsing its stream. There is no Node.js agent wrapper process; the Node side is only the MCP server and two hook scripts. Codex, Copilot and Grok CLI backends are also supported. See .claude/rules/architecture.md. test:e2e, test:eval and test:perf spend real tokens and are deliberately outside npm test. Every script is in package.json; for manual testing, load the plugin…

  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every script is in package.json.

    line 20
  2. Very specific:

    If you add a paragraph to .claude/rules/ explaining _why_, it is in the wrong file.

    line 27
  3. Very specific:

    When adding a skill, the directory is decided by which reader it is for.

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project Overview

vibing.nvim is a Neovim plugin that provides a Claude chat inside Neovim by spawning the claude CLI directly (claude -p --output-format stream-json) and parsing its stream. There is no Node.js agent wrapper process; the Node side is only the MCP server and two hook scripts. Codex, Copilot and Grok CLI backends are also supported. See .claude/rules/architecture.md.

Commands

npm install && ./build.sh   # dependencies, then the MCP server
npm test                    # test:lua + test:node
npm run check               # Lua syntax; see also check:doc for doc/*.txt
npm run lint                # eslint only; lint:md, format and format:check are separate

test:e2e, test:eval and test:perf spend real tokens and are deliberately outside npm test. Every script is in package.json; for manual testing, load the plugin and run :VibingChat.

Where Documentation Lives

.claude/rules/*.md is loaded into every request. So it holds only two kinds of thing: invariants you would otherwise break, and this map. Reasons, measurements and rejected alternatives belong in handbook/; procedures belong in a skill. Both are read on demand. If you add a paragraph to .claude/rules/ explaining why, it is in the wrong file.

.claude/rules/Invariants for
architecture.mdCLI/hook protocol, seams, plugin dirs, process/turn, duplex, diffs
permissions.mdEvaluation order, approval state, waiting approvals, delegation
mcp-integration.mdTool prefixes, rpc_port, window/chat addressing
features.mdUsage limits, subagent output, AskUserQuestion, timestamps, dap
configuration.mdPointer to the option reference
self-development.mdThree mistakes made repeatedly when developing this repo
self-testing.mdWhat only test:e2e may run; the 3-try rule
web-workflow.mdBranch naming and push retry on Claude Code for the web
handbook/ (on demand)Contents
configuration.mdEvery setup() field, defaults, granular rule examples
ADAPTER_DEVELOPMENT.mdAdding a CLI backend: the descriptor, measure-first list
architecture/module-map.mdPer-directory listing, key entry points, adapter split
architecture/cli-integration.mdHook protocol, backend seams, per-CLI measurements
architecture/permissions.mdEvaluation order, Permission Builder, approval UI, #667
architecture/lightweight-calls.mdHow each backend restricts utility calls
architecture/plugin-and-commands.md--plugin-dir, slash command discovery, startup cost
architecture/per-request-diffs.mdgit tree snapshot, overlap guard, fallback routing
architecture/processes-and-turns.mdprocess_id vs turn_id, the id alphabet, hook scope
architecture/duplex-transport.mdThe resident CLI process: opt-in, reuse key, reclaim
architecture/approval-without-kill.mdWaiting hook, the three-timeout ordering, measurements
architecture/chat-lineage.mdConcurrency, fork, handoff, subagent chat
architecture/orchestration.mdNotification state machine, queue, tree operations
architecture/session-persistence.mdThe working_dir git-root boundary
features/usage-limits.mdAuto-resume, scheduled requests, retry budget
features/chat-ui.mdSubagent output, timestamps, AskUserQuestion
features/editor-integration.mdCode Tour, nvim-dap analysis
mutation-verification.mdBreaking what a new assertion guards; when to run it
mcp-tools.mdThe MCP tool catalogue and its non-obvious behaviour
web-container-setup.mdThe SessionStart hook for Claude Code on the web
.claude/skills/ (on demand)Invoke when
self-testingWriting or debugging an E2E spec
test-designDesigning scenarios before writing tests
ci-gatesTouching package.json scripts, CI, or a gate's test
stacked-pr-mergeMerging PRs that were cut from each other
github-flow-for-claude-on-webAny GitHub operation from the web container
remote-screenshotShowing a UI change from the web container

User-facing command, slash command and keybinding documentation is doc/vibing.txt — the one place, kept honest by npm run check:doc. Do not restate it in .claude/rules/.

Repository Layout

Everything distributed to Claude Code lives under claude-plugin/. The repository root is the marketplace root; the plugin root is one level below it. The normal path is no longer the marketplace, though: cli_command_builder passes claude-plugin/ to the CLI per session with --plugin-dir (#618). marketplace.json remains only for a manual claude plugin install.

PathContents
.claude-plugin/marketplace.jsonmarketplace definition, source: ./claude-plugin
claude-plugin/.claude-plugin/plugin.jsonplugin definition; ${CLAUDE_PLUGIN_ROOT} parent
claude-plugin/{agents,skills}/distributed subagents and skills
claude-plugin/mcp-server/the distributed MCP server
.claude/{skills,commands,rules}/for developing this repo; not distributed
AGENTS.md, .agents/skillssymlinks; see below

AGENTS.md is a symlink to this file and .agents/skills one to .claude/skills, because codex and grok look for those names and claude looks for these. There is one copy of each; do not edit through the link, and do not let a second copy reappear. Measured on the installed CLIs: claude reads CLAUDE.md only (an AGENTS.md alone reaches it not at all), codex reads AGENTS.md, and grok reads both but reports the shared content once. .claude/rules/ has no counterpart — only claude loads it automatically, so codex and grok reach those files by following the map above.

When adding a skill, the directory is decided by which reader it is for. The directory is not named plugin/ because that is a Neovim reserved name: plugin/**/*.lua on the runtimepath is sourced at every startup (:h load-plugins), so a tree containing node_modules there is walked every time Neovim starts.

Development Rules

  • Test fixtures and scaffolds go under tests/ (tests/fixtures/, tests/e2e/, tests/lua/), never as test-*/ at the repository root.

Key Constants

lua/vibing/core/constants/tools.lua is the single definition of tool names. config.lua and can_use_tool.lua reference it rather than re-listing values.

  • VALID_TOOLS — names writable in permission settings; used to warn about unknown ones.
  • DEFAULT_ALLOWED_TOOLS — the default permissions.allow. Not derived as a difference from VALID_TOOLS (see the comment in that file).
  • ALWAYS_ALLOWED_TOOLS — the floor that stays allowed regardless of allow, unless the user puts the tool in ask / deny. The criterion is "read-only built-in that creates, updates or deletes no file" (Read / Glob / Grep). Removing one from DEFAULT_ALLOWED_TOOLS does not disallow it while it is still here.
  • INTERNAL_TOOLS — the harness's own control tools. Always allowed, ahead of ALWAYS_ALLOWED_TOOLS in can_use_tool.lua, so not even ask / deny applies. No VALID_TOOLS entry needed; the check reads INTERNAL_TOOLS_MAP. The criterion is "is the harness unusable without it", not "is it read-only" — which is why NotebookEdit, Agent and EnterWorktree are in it. Read the membership from tools.lua; the four names listed here went stale while the list grew to nineteen. A tool whose absence merely costs a prompt still belongs: ListAgents was missing while SendMessage was present, so an orchestrated worker stalled on an approval for reading the list of chats it was about to message.
  • Adding a tool: allowed by default → both VALID_TOOLS and DEFAULT_ALLOWED_TOOLS; not allowed by default (like Bash) → VALID_TOOLS only.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.