k8stools: Instructions file for Claude Code

CLAUDE.md

k8stools CLAUDE.md is an instructions file for Claude Code from BenedatLLC/k8stools. It costs 9,697 tokens per session, scanned C, 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is BenedatLLC/k8stools's own configuration. It tells Claude Code how to work on k8stools 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 k8stools configures →

Reuse

Borrowing it

Nothing to install: this file belongs to BenedatLLC/k8stools. 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/BenedatLLC/k8stools/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/BenedatLLC/k8stools

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/benedatllc/k8stools/claude-md/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8stools CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/benedatllc/k8stools/claude-md"><img src="https://agentmods.dev/badge/instructions/benedatllc/k8stools/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,697 This file is loaded in full into every session.
When invoked 9,697 The same file — it is already loaded in full.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.09697 $0.09697
Opus 5.5 $0.03879 $0.03879
Sonnet 5.5 $0.01939 $0.01939
Haiku 4.5 $0.00970 $0.00970

Measured 5d ago against content hash 3f2f00be7f59, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

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

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- Resolution: `--kubeconfig` / argument, then `KUBECONFIG`, then `~/.kube/config`;
CLAUDE.md · 611 lines

How it starts

The opening of the file, as written. The whole thing — 611 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
  composites.py  - Logic of the composite tools (get_namespace_health, get_workload_report)
  mock_state.py  - MockState: loads a capture file and serves it to the tool queries
  capture.py     - `k8s-capture-state` CLI: snapshots a live cluster to a capture file
  itbench.py     - `--from-itbench`: serves one pull of an ITBench-Lite snapshot to capture_state
  mock_tools.py  - Mock versions of all tools; thin delegates to MockState
  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
  fixtures/
    otel-demo.json - Built-in capture served by `--mock` (hand-maintained, modeled on Minikube + OTel Demo)
tests/
  fixtures/itbench-33-excerpt/ - Trimmed ITBench-Lite Scenario-33 (two pulls); made by fixtures/make_itbench_excerpt.py
  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_replicaset_tool.py    - Unit tests for get_replicaset_summaries (1.2.0), incl. mock-data consistency
  test_redaction.py          - Unit tests for the secret-redaction pass
  test_mock_state.py         - Unit tests for MockState (filters, replicaset ordering, logs, replay clock)
  test_capture.py            - Capture serialization round-trip and capture-time redaction
  test_k8s_tools_realk8s.py  - Integration tests (real cluster, auto-skipped if unreachable)
  test_live_writes.py        - Integration tests that create the failure they check, in their own namespace (opt-in: K8STOOLS_LIVE_WRITE=1)
  test_mock_tools.py         - Tests for mock_tools module (incl. parity with k8s_tools.TOOLS)
  test_events.py             - Event aggregation (count/first_seen), incl. the events.k8s.io fallback
  test_cluster_binding.py    - Cluster selection: configure(), the shared binding, get_cluster_info, server flags
  test_node_conditions.py    - NodeSummary.conditions_since (condition transition times), incl. capture replay
  test_workloads.py          - get_daemonset_summaries and PodSummary.owner, incl. capture replay
  test_builtin_fixture.py    - The built-in fixture describes a cluster that could exist (owners, images, ages, log windows, histories)
  test_workload_history.py   - get_workload_history: template diffs, revisions, config refs, no env values or Secret reads, replay
  test_toolsets.py           - Toolsets: named subsets, include/exclude, server flags
  test_notes.py              - Description budgets, notes on results and logs, notes in replay
  test_composites.py         - get_namespace_health / get_workload_report: semantics, grouping, bounds
  test_init_containers.py    - Init containers and native sidecars: the pod model, composites, capture, older captures
  test_stuck_rollouts.py     - Unscheduled pods and failing Deployment conditions make a workload unhealthy (#27)
  test_itbench.py            - ITBench import: pulls, not-recorded kinds, events at the pull, log attribution, Scenario-33 regression
  test_hooks.py              - pinned_clock and use_api_client: one clock, every reader through the supplied client, restored (#30)
  test_not_recorded.py       - What a capture didn't record replays as not recorded: missing kinds, unrecorded logs, composites (#30)
  test_placement.py          - Composites' placement: nodeSelector/required affinity/tolerations against the nodes (#29)
  test_hpa.py                - get_hpa_summaries: metrics, conditions, at-max note, replay, composites
  test_endpoints.py          - get_endpoint_summaries and ServiceSummary endpoint counts
  test_metrics.py            - get_container_metrics / get_node_metrics: units, notes, the three replay cases
  test_ingress.py            - get_ingress_summaries: backend resolution, readiness, TLS by name
  test_spec_resources.py     - Requests/limits from the pod spec when the status has none (pre-1.33, ITBench), live and replay (#32)
  test_networkpolicy.py      - get_networkpolicy_summaries: stated effects by the API's rules, selected pods, composites, replay (#31)
  test_forbidden.py          - A 403 is K8sForbidden; capture records an unreadable kind and carries on; replay and composites say so (#33)
  test_log_search.py         - get_log_pattern_summary, grep before tail, where a log starts: live, capture and replay (#34); the capture's byte cap (#36)
  test_report_logs.py        - The workload report reads every pod's log; a cut line keeps its match; lines_from/log_starts (#35)
  test_custom_resources.py   - CRDs and custom-resource conditions; per-type permissions in capture
  test_log_decoding.py       - Log decoding at the API boundary (bytes vs str), `previous` plumbing, log redaction
  test_mcp_client.py         - MCP client tests
  test_mcp_errors.py         - Anticipated failures reach MCP clients with their reason; crashes stay generic; one-line API errors
  test_version.py            - Asserts pyproject and package __version__ agree

Read the full file on GitHub · 611 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 Changed · +28 lines · +562 tokens per session 3f2f00be7f59
  2. 6d ago Changed · +18 lines · +367 tokens per session 59f107068150
  3. 8d ago Changed · +47 lines · +925 tokens per session 94fb7f827790
  4. 12d ago Changed · +21 lines · +381 tokens per session cc6c82c7d10f
  5. 16d ago Changed · +9 lines · +178 tokens per session f36294f11acb
  6. 19d ago Changed · +43 lines · +845 tokens per session 2e16a6e5c964
  7. 28d ago Changed · +71 lines · +1,198 tokens per session 6b03c7c983f3
  8. 1mo ago Changed · +47 lines · +750 tokens per session 4cd8e0b5f2a3
  9. 1mo ago Changed · +1 lines · +33 tokens per session a931d37ae138
  10. 1mo ago First seen · 326 lines · 4,458 tokens per session scan C 907925f69d94

Subscribe to this mod's changes

k8stools CLAUDE.md is an instructions file published in the GitHub repository BenedatLLC/k8stools (3 stars, last pushed 6d ago), licensed Apache-2.0. It adds 9,697 tokens to every session, about $0.0388 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

k8stools CLAUDE.md compared with instructions from other repositories

k8stools CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
k8stools CLAUDE.mdBenedatLLC/k8stoolsInstructions file36d agoApache-2.0C9,697Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode