kubectl.nvim: Agent for Claude Code

.claude/agents/lsp.md

lsp is an agent for Claude Code from Ramilito/kubectl.nvim. It costs 28 tokens per session (2,557 once invoked), scanned A, original, Apache-2.0.

A specialist for Language Server Protocol features, the standard interface that gives editors code completion, hover information, and error diagnostics. It focuses on an in-process server for Kubernetes resource buffers in Neovim.

In plain words
What is it for?
Use it when configuring the server, adding completion sources or hover formatting, or changing diagnostics for Kubernetes resources.
Why use it?
Editor features depend on several completion, documentation, and diagnostic paths, and changes in one can break the others. This specialist helps locate the relevant implementation for those tasks.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions subagents.

This is Ramilito/kubectl.nvim's own configuration. It tells Claude Code how to work on kubectl.nvim itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kubectl.nvim configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Ramilito/kubectl.nvim. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Ramilito/kubectl.nvim/main/.claude/agents/lsp.md
Clone the repo
git clone --depth 1 https://github.com/Ramilito/kubectl.nvim

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lsp

README.md
[![agentmods](https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/lsp.svg)](https://agentmods.dev/agents/ramilito/kubectl.nvim/lsp)
Your own site
<a href="https://agentmods.dev/agents/ramilito/kubectl.nvim/lsp"><img src="https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/lsp.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,557 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00028 $0.02557
Opus 5 $0.00014 $0.01278
Sonnet 5 $0.00006 $0.00511
Haiku 4.5 $0.00003 $0.00256

Measured yesterday against content hash baa0390e12eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

lsp 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/agents/lsp.md · 339 lines

How it starts

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

LSP Features Guidance

ALWAYS use this subagent for ANY task involving:

  • LSP server configuration or capabilities
  • Completion sources for different filetypes
  • Hover provider (resource info display)
  • Diagnostics (errors/warnings for resources)
  • Adding new completion sources or hover formatters

For general Lua/Neovim patterns, use the lua subagent. For Rust async patterns and mlua FFI, use the rust subagent.

Architecture Overview

The plugin runs an in-process LSP server (no external process). This enables:

  • Native completion via vim.lsp.completion or external plugins (blink.cmp, nvim-cmp)
  • Hover information via vim.lsp.buf.hover() (typically K key)
  • Diagnostics for resource status issues
+-------------------------------------------------------------+
|                         Neovim                               |
|  +-----------------+      +----------------------------+    |
|  | Plugin Buffers  |<---->|  kubectl LSP Server        |    |
|  | (k8s_* types)   |      |  (in-process, lsp/init.lua)|    |
|  +-----------------+      +----------------------------+    |
|           |                          |                       |
|           v                          v                       |
|  +-----------------+      +----------------------------+    |
|  | Diagnostics     |      |  Handlers:                 |    |
|  | (virtual_lines) |      |  - completion -> sources/* |    |
|  +-----------------+      |  - hover -> Rust FFI       |    |
|                           +----------------------------+    |
+-------------------------------------------------------------+

File Map

Layer File Purpose
Lua lua/kubectl/lsp/init.lua LSP server, capability negotiation, client management
Lua lua/kubectl/lsp/hover/init.lua Hover handler, diagnostic integration
Lua lua/kubectl/lsp/diagnostics/init.lua Set/toggle diagnostics, quickfix export
Lua lua/kubectl/lsp/sources/aliases.lua Completion for :Kubectl (resource names, short names)
Lua lua/kubectl/lsp/sources/namespaces.lua Completion for :Kubens
Lua lua/kubectl/lsp/sources/contexts.lua Completion for :Kubectx
Lua lua/kubectl/lsp/sources/filter.lua Completion for filter prompt (history)
Rust kubectl-client/src/hover/mod.rs Async hover data fetch
Rust kubectl-client/src/hover/formatters.rs Resource-specific markdown formatters

Read the full file on GitHub · 339 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 · 339 lines · 28 tokens per session scan A baa0390e12eb

Subscribe to this mod's changes

lsp is an agent published in the GitHub repository Ramilito/kubectl.nvim (537 stars, last pushed 22d ago), licensed Apache-2.0. It adds 28 tokens to every session and 2,557 once invoked, about $0.0001 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-09-04.