k8stools CLAUDE.md

k8stools CLAUDE.md is an instructions file for coding agents from BenedatLLC/k8stools. It costs 1,305 tokens per session, scanned A, original, Apache-2.0.

Project instructions and tools for monitoring Kubernetes, a system for running and managing containerised applications. They include direct Python functions and an MCP server, a standard way for AI agents to use tools.

In plain words
What is it for?
Use them to inspect Kubernetes resources, logs, events, jobs, storage, and other cluster components, with mocked and real-cluster tests.
Why use it?
They provide a consistent project layout, test setup, cluster configuration, and output redaction so sensitive values are not exposed.

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/benedatllc/k8stools/claude-md
Clone the repo
git clone --depth 1 https://github.com/BenedatLLC/k8stools

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 k8stools CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/benedatllc/k8stools/claude-md.svg)](https://agentmods.dev/instructions/benedatllc/k8stools/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/benedatllc/k8stools/claude-md"><img src="https://agentmods.dev/badge/instructions/benedatllc/k8stools/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,305 This file is loaded in full into every session.
When invoked 1,305 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.1 $0.01305 $0.01305
Opus 5 $0.00652 $0.00652
Sonnet 5 $0.00261 $0.00261
Haiku 4.5 $0.00130 $0.00130

Measured 5d ago against content hash 58904f58cb11, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

k8stools 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 5d ago.

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 · 134 lines

How it starts

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

k8stools

Kubernetes monitoring tools for AI agents, exposed as direct Python functions or via an MCP server.

Project layout

src/k8stools/
  k8s_tools.py   - Core tools: Kubernetes API wrappers with Pydantic return types
  mock_tools.py  - Static mock versions of all tools (captured from real Minikube + OTel Demo)
  redaction.py   - Secret-redaction pass applied at the MCP server output boundary
  mcp_server.py  - MCP server (stdio or streamable-http transport)
  mcp_client.py  - MCP client used for manual testing
tests/
  test_k8s_tools.py          - Unit tests for the original tools (mocked K8s API)
  test_new_tools.py          - Unit tests for the 1.1.0 tools (ConfigMaps, CronJobs/Jobs, PVCs, StatefulSets, events, log enhancements)
  test_redaction.py          - Unit tests for the secret-redaction pass
  test_k8s_tools_realk8s.py  - Integration tests (real cluster, auto-skipped if unreachable)
  test_mock_tools.py         - Tests for mock_tools module (incl. parity with k8s_tools.TOOLS)
  test_mcp_client.py         - MCP client tests
  test_version.py            - Asserts pyproject and package __version__ agree

Environment setup

cp envrc.template .envrc
# Set KUBECONFIG in .envrc to point to your kubeconfig file
direnv allow   # or source .envrc manually
uv sync

The .envrc sets KUBECONFIG and adds .venv/bin to PATH. The MCP server's mcp.json config also reads from .envrc via envFile.

Running tests

# Unit tests only (no cluster needed)
uv run pytest tests/test_k8s_tools.py tests/test_mock_tools.py -v

# Integration tests against a real cluster (skipped automatically if unreachable)
KUBECONFIG=~/.kube/your-config.yaml uv run pytest tests/test_k8s_tools_realk8s.py -v

# All tests
uv run pytest -v

Tool design patterns

Tools in k8s_tools.py follow three patterns:

  1. kubectl-like — Pydantic models mimicking kubectl output (e.g. get_pod_summarieskubectl get pods -o wide)
  2. API-typed — Pydantic models that match K8s client types with lesser-used fields omitted (e.g. get_pod_container_statuses)
  3. Raw dictto_dict() on the K8s client object; return type is dict[str, Any] with fields documented in the docstring (e.g. get_pod_spec)

Read the full file on GitHub · 134 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. 5d ago First seen · 134 lines · 1,305 tokens per session scan A 58904f58cb11

Subscribe to this mod's changes

k8stools CLAUDE.md is an instructions file published in the GitHub repository BenedatLLC/k8stools (3 stars, last pushed 5d ago), licensed Apache-2.0. It adds 1,305 tokens to every session, about $0.0065 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.