logs

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

A specialist guide for a pod's logs in a Kubernetes-based application, including streaming, fetching, JSON display, and log histograms. Kubernetes is a system for running and managing containers.

In plain words
What is it for?
Use it when implementing or debugging log views, live log tailing, JSON expansion, syntax highlighting, histograms, or LogSession behavior.
Why use it?
It directs log-related work to the relevant code and prevents unrelated agents from changing the wrong parts of the application.

Agent for Claude Code

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

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 agents/ramilito/kubectl.nvim/logs
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 logs

README.md
[![agentmods](https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/logs.svg)](https://agentmods.dev/agents/ramilito/kubectl.nvim/logs)
Your own site
<a href="https://agentmods.dev/agents/ramilito/kubectl.nvim/logs"><img src="https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/logs.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,958 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.02958
Opus 5 $0.00014 $0.01479
Sonnet 5 $0.00006 $0.00592
Haiku 4.5 $0.00003 $0.00296

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

Security

Grade A, and why

logs 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/logs.md · 183 lines

How it starts

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

Pod Logs Feature Guidance

ALWAYS use this subagent for ANY task involving:

  • Log streaming, tailing, or fetching
  • JSON expand/collapse in log output
  • Log view keybindings or syntax highlighting
  • Histogram visualization
  • LogSession UserData or related mlua bindings

For general mlua FFI patterns (async functions, JSON serialization, error handling), use the rust subagent.

File Map

Layer File Purpose
Rust kubectl-client/src/cmd/log_session.rs Streaming session, histogram, log fetching, toggle_json()
Rust kubectl-client/src/cmd/mod.rs:124-128 Registers log_stream_async and log_session exports
Rust kubectl-client/src/lib.rs:474-488 Exposes toggle_json to Lua
Rust kubectl-client/src/structs.rs LogConfig/PodRef structs + custom FromLua impl
Lua lua/kubectl/client/init.lua client.log_session() / client.toggle_json() wrappers
Lua lua/kubectl/client/types.lua kubectl.LogSession / kubectl.ToggleJsonResult annotations
Lua lua/kubectl/resources/pods/init.lua Entry points: Logs(), TailLogs(), LogsWithPods(), LogsForFilter(), get_pods_for_logs()
Lua lua/kubectl/views/logs/session.lua Session manager: options, timer polling, lifecycle
Lua lua/kubectl/resources/pod_logs/mappings.lua Keybindings only — no sibling init.lua/definition.lua
Vim syntax/k8s_pod_logs.vim Syntax highlighting

pod_logs is not a BaseResource.extend module. Its view is assembled ad hoc inside pods/init.lua's LogsWithPods() (a framed buffer built via resource_factory's view_framed), and its mappings are loaded generically from the k8s_pod_logs filetype (strip k8s_ prefix → require kubectl.resources.pod_logs.mappings).

Data Flow

Two distinct code paths share one pod-list resolver but differ in transport:

Lua                                Transport                           Rust (dylib)
-------------------------------------------------------------------------------------------
Logs() / LogsWithPods()      --> commands.run_async               --> fetch_logs_async
  one-shot, full buffer            (libuv worker thread,                (async fn) resolves
  replace via buffers.set_content  args JSON-encoded)                   targets, merges streams,
                                                                         renders histogram

TailLogs() / session:start() --> client.log_session                --> log_session
  follow, incremental append       (direct sync FFI call, blocks         (sync fn) LogConfig via
                              --> views/logs/session.lua timer          custom FromLua, spawns one
                                  (vim.uv.new_timer, 200ms) polls        Tokio task per container
                                  session:read_chunk(), appends lines    into a shared LogSession

toggle_json() -----------------------------------------------------> cmd::log_session::toggle_json

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

Subscribe to this mod's changes

logs 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,958 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.

Related

Other agents, from other repositories

Meshery Code Contributor

Expert-level software engineering agent specialized in contributing to Meshery's cloud native infrastructure and application management platform.

meshery/meshery · 25 tokens

kube

Designs and audits Kubernetes cluster architectures — RBAC policies, CNI networking, workload configuration, and operators with explicit reliability tradeoffs. Use when designing a cluster, auditing RBAC, or rightsizing workloads. Trigger with "design a Kubernetes cluster", "audit our RBAC".

jeremylongshore/tons-of-skills-marketplace · 59 tokens

docker-expert

Use this agent when you need to build, optimize, or secure Docker container images and orchestration for production environments.

piomin/claude-ai-spring-boot · 27 tokens

devops-engineer

Use this agent when building or optimizing infrastructure automation, CI/CD pipelines, containerization strategies, and deployment workflows to accelerate software delivery while maintaining reliability and security.

piomin/claude-ai-spring-boot · 36 tokens

kubernetes-specialist

Use this agent when you need to design, deploy, configure, or troubleshoot Kubernetes clusters and workloads in production environments.

piomin/claude-ai-spring-boot · 28 tokens

deploy-to-staging

Use this agent PROACTIVELY when deploying applications to staging or QA environments. This includes running test suites before deployment, building production bundles, creating Docker images, pushing to container registries, deploying to Kubernetes staging namespaces, and running smoke tests. Invoke when someone says…

lando-labs/cami · 83 tokens