kubectl.nvim: Agent for Claude Code

.claude/agents/lua.md

lua is an agent for Claude Code from Ramilito/kubectl.nvim. It costs 36 tokens per session (1,815 once invoked), scanned A, original, Apache-2.0.

A specialist coding agent for Lua and Neovim plug-in work. It covers the Neovim API, Kubernetes resource views, keybindings, configuration, state, and the layout of the plug-in's Lua modules.

In plain words
What is it for?
Use it when reading, editing, documenting, or researching Lua code, Kubernetes views, mappings, configuration, or Neovim integration.
Why use it?
It directs relevant tasks to guidance that knows the repository's Lua structure and Neovim conventions instead of treating them as generic code changes.

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/lua.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 lua

README.md
[![agentmods](https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/lua.svg)](https://agentmods.dev/agents/ramilito/kubectl.nvim/lua)
Your own site
<a href="https://agentmods.dev/agents/ramilito/kubectl.nvim/lua"><img src="https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/lua.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,815 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00036 $0.01815
Opus 5 $0.00018 $0.00907
Sonnet 5 $0.00007 $0.00363
Haiku 4.5 $0.00004 $0.00181

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

Security

Grade A, and why

lua 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.

- `utils/url.lua` - URL building for kubectl/curl commands
.claude/agents/lua.md · 276 lines

How it starts

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

Lua/Neovim Plugin Guidance

ALWAYS use this subagent for ANY task involving:

  • Reading, editing, or understanding Lua code
  • lua/kubectl/ directory
  • Resource views, keybindings, or mappings
  • State management or configuration
  • Neovim API integration
  • Researching Lua code for documentation

For Rust FFI patterns and async calls, also consult the rust subagent.


Guidance for working with the Lua/Neovim plugin codebase (lua/kubectl/).

Plugin Structure

Entry Point

init.lua - Plugin setup, commands (:Kubectl, :Kubens, :Kubectx), autocommands, and keymap registration.

Core Modules

  • config.lua - Default configuration with user overrides via setup()
  • state.lua - Global runtime state, session persistence, filter/sort state
  • resource_factory.lua - Builder pattern for constructing resource views
  • mappings.lua - Global keybinding definitions using <Plug> format

Resource Pattern

Each Kubernetes resource in lua/kubectl/resources/<resource>/ follows:

<resource>/
├── init.lua        # View(), Draw(), Desc() functions
├── definition.lua  # Resource metadata (GVK, headers, hints)
└── mappings.lua    # Resource-specific keybindings

Definition structure:

M.definition = {
  resource = "pods",
  display_name = "PODS",
  ft = "k8s_pods",           -- filetype for buffer
  gvk = { g = "", v = "v1", k = "Pod" },
  hints = { ... },           -- help text shown in header
  headers = { ... },         -- column definitions
}

Standard functions:

function M.View(cancellationToken)   -- Create and show view
function M.Draw(cancellationToken)   -- Refresh existing view
function M.Desc(name, ns, reload)    -- Show resource description

Resource Factory (Builder Pattern)

The factory in resource_factory.lua provides a fluent API:

local factory = require("kubectl.resource_factory")
factory.new("pods")
  .setCmd(args, "kubectl")
  .fetch()
  .decodeJson()
  .process(processFunc)
  .sort()
  .prettyPrint(win_nr)
  .addHints(hints, true, true)
  .addDivider(true)
  .displayContent(win_nr, cancellationToken)

Read the full file on GitHub · 276 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 · 276 lines · 36 tokens per session scan A 1310c6a845ff

Subscribe to this mod's changes

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