toolhive: Agent for Claude Code

.claude/agents/kubernetes-expert.md

kubernetes-expert is an agent for Claude Code from stacklok/toolhive. It costs 24 tokens per session (808 once invoked), scanned A, original, Apache-2.0.

A Kubernetes specialist for ToolHive. Kubernetes is software for running and coordinating containers, while operators and custom resources automate the management of applications inside it.

In plain words
What is it for?
Use it when working on ToolHive's Kubernetes operator, custom resource definitions, controllers, reconciliation logic, permissions, or related tests.
Why use it?
It provides focused guidance for Kubernetes-specific changes without mixing them up with general container code or authentication work.

Agent for Claude Code

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

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

About the project

ToolHive is a platform for running and managing Model Context Protocol servers, which give AI clients access to tools and data. Developers, platform teams, and enterprises use it to isolate MCP servers, control access, and monitor their operation. The catalogue entries provide agent workflows and configuration for operating ToolHive and its MCP servers.

stacklok/toolhive · 2,307 stars · on GitHub · stacklok.com

Reuse

Borrowing it

Nothing to install: this file belongs to stacklok/toolhive. 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/stacklok/toolhive/main/.claude/agents/kubernetes-expert.md
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

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 kubernetes-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/stacklok/toolhive/kubernetes-expert/github.svg)](https://agentmods.dev/agents/stacklok/toolhive/kubernetes-expert)
Your own site
<a href="https://agentmods.dev/agents/stacklok/toolhive/kubernetes-expert"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/kubernetes-expert/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 kubernetes-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/stacklok/toolhive/kubernetes-expert"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/kubernetes-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 808 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00024 $0.00808
Opus 5.5 $0.00010 $0.00323
Sonnet 5.5 $0.00005 $0.00162
Haiku 4.5 $0.00002 $0.00081

Measured 1mo ago against content hash 7d108fe4e406, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kubernetes-expert 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 1mo 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/agents/kubernetes-expert.md · 83 lines

How it starts

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

Kubernetes Expert Agent

You are a specialized expert in Kubernetes operator patterns, CRDs, and controllers for the ToolHive project.

When to Invoke

Invoke when:

  • Working on the ToolHive Kubernetes operator
  • Designing or modifying CRDs (MCPServer, MCPRegistry, etc.)
  • Implementing controller reconciliation logic
  • Making CRD attributes vs PodTemplateSpec decisions

Defer to: toolhive-expert (non-K8s container code), oauth-expert (auth details), code-reviewer (general review).

Your Expertise

  • Kubernetes operators, controllers, reconciliation loops, watch mechanisms
  • CRDs: API design, schema validation, status conditions, subresources
  • controller-runtime: Kubebuilder patterns, manager setup, client usage
  • RBAC, pod security, resource management, leader election
  • Testing: envtest, Chainsaw e2e tests

Key Patterns

Reconciliation Structure

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
    // 1. Fetch resource (handle IsNotFound → return nil)
    // 2. Handle deletion (check finalizers)
    // 3. Validate spec (don't requeue invalid specs)
    // 4. Create/update dependent resources
    // 5. Update status (separate call: r.Status().Update())
    // 6. Return result
}

Common Pitfalls

  • Status is a subresource: Use r.Status().Update(), not r.Update()
  • Finalizers: Check DeletionTimestamp.IsZero() before processing; remove only after cleanup
  • Tight requeue loops: Use RequeueAfter: 30*time.Second, not Requeue: true for polling
  • Owner references: Use controllerutil.SetControllerReference() — can't cross namespaces
  • RBAC markers: Add +kubebuilder:rbac for all resource accesses; use plural form
  • Breaking API changes: Use new API version (v1alpha2) for incompatible changes

Development Commands

See .claude/rules/operator.md for the full list of operator task commands.

Resources

Read the full file on GitHub · 83 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. 1mo ago First seen · 83 lines · 24 tokens per session scan A 7d108fe4e406

Subscribe to this mod's changes

kubernetes-expert is an agent published in the GitHub repository stacklok/toolhive (2,307 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 808 once invoked, about $0.0001 per session on Opus 5.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-30.

Related

Other agents, from other repositories

cloud-security

Delegates to this agent when the user asks about cloud security testing, AWS/Azure/GCP penetration testing, cloud misconfiguration analysis, IAM privilege escalation, container security, Kubernetes attacks, serverless security, or cloud-native attack paths.

0xSteph/pentest-ai-agents · 50 tokens

terragrunt-expert

Expert Terragrunt specialist mastering infrastructure orchestration, DRY configurations, and multi-environment deployments. Masters stacks, units, dependency management, and scalable IaC patterns with focus on code reuse, maintainability, and enterprise-grade infrastructure automation.

alexmmatos/arthur-mcp · 54 tokens

iot-engineer

Use when designing and deploying IoT solutions requiring expertise in device management, edge computing, cloud integration, and handling challenges like massive device scale, complex connectivity scenarios, or real-time data pipelines.

alexmmatos/arthur-mcp · 42 tokens

microservices-architect

Use when designing distributed system architecture, decomposing monolithic applications into independent microservices, or establishing communication patterns between services at scale.

alexmmatos/arthur-mcp · 31 tokens

mlops-engineer

Use this agent when you need to design and implement ML infrastructure, set up CI/CD for machine learning models, establish model versioning systems, or optimize ML platforms for reliability and automation. Invoke this agent to build production-grade experiment tracking, implement automated training pipelines…

alexmmatos/arthur-mcp · 71 tokens

render-expert

Expert in Render.com — deploying web services, workers, cron jobs, managed databases, environment variables, render.yaml (Infrastructure as Code), and production best practices. Use to configure, optimize, or debug deployments on Render.

alexmmatos/arthur-mcp · 48 tokens