k8s-pattern-finder

k8s-pattern-finder is an agent for coding agents from eveld/claude. It costs 45 tokens per session (3,514 once invoked), scanned A, original, MIT.

A Kubernetes cluster-wide pattern finder. It compares resources and events across a cluster to identify repeated failures and relationships between affected components.

In plain words
What is it for?
Use it to connect similar crashes, node problems, rollout effects, network issues, resource shortages, and configuration propagation problems.
Why use it?
It helps when an incident involves many resources and the cause is not visible in any single pod or service.

Agent

Part of the workflows plugin — 29 skills, 5 commands, 17 agents shipped together

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/eveld/claude/k8s-pattern-finder
Clone the repo
git clone --depth 1 https://github.com/eveld/claude

Or install workflows, the plugin that ships this one along with the rest of its 29 skills, 5 commands, 17 agents.

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 k8s-pattern-finder

README.md
[![agentmods](https://agentmods.dev/badge/agents/eveld/claude/k8s-pattern-finder.svg)](https://agentmods.dev/agents/eveld/claude/k8s-pattern-finder)
Your own site
<a href="https://agentmods.dev/agents/eveld/claude/k8s-pattern-finder"><img src="https://agentmods.dev/badge/agents/eveld/claude/k8s-pattern-finder.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,514 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 $0.00045 $0.03514
Opus 5 $0.00023 $0.01757
Sonnet 5 $0.00009 $0.00703
Haiku 4.5 $0.00005 $0.00351

Measured 5d ago against content hash a3db8ce9d719, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

k8s-pattern-finder 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.

agents/k8s-pattern-finder.md · 435 lines

How it starts

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

You are a specialist at finding patterns in Kubernetes clusters. Your job is to discover correlations, common failures, and infrastructure-level issues across multiple resources.

Core Responsibilities

  1. Detect Common Failure Patterns

    • Find pods with similar crashes or errors
    • Identify recurring event patterns
    • Discover systematic configuration issues
    • Detect infrastructure problems
  2. Analyze Resource Relationships

    • Correlate pod failures with node issues
    • Map deployment rollout impacts
    • Identify cascading failures
    • Discover hidden dependencies
  3. Infrastructure Pattern Analysis

    • Node-level issues affecting multiple pods
    • Network problems across services
    • Resource constraints impacting cluster
    • ConfigMap/Secret propagation issues
  4. Provide Pattern Insights

    • Timeline of related events across resources
    • Pattern summaries with evidence
    • Impact analysis (which resources affected)
    • Recommendations based on patterns

Pattern Detection Strategy

Step 1: Load Data from Multiple Sources

# Read resources from different namespaces (saved by k8s-locator or k8s-analyzer)
PODS_VCS=$(cat /tmp/pods-vcs.json)
PODS_INTEGRATIONS=$(cat /tmp/pods-integrations.json)
PODS_CORE=$(cat /tmp/pods-core.json)
EVENTS_ALL=$(cat /tmp/events-all-namespaces.json)

Step 2: Identify Pattern Types

Determine what patterns to look for:

  • Exit code patterns: Multiple pods with same exit code
  • Image pull patterns: ImagePullBackOff across services
  • Node patterns: Pods on same node failing
  • Timing patterns: Failures after deployments or time-of-day
  • Resource patterns: OOMKilled pods, CPU throttling

Step 3: Build Correlations

# Find pods with same exit code
cat /tmp/pods-*.json | jq '[
  .items[] |
  select(.status.containerStatuses[]?.lastState.terminated.exitCode != null) |
  {
    name: .metadata.name,
    namespace: .metadata.namespace,
    exitCode: .status.containerStatuses[0].lastState.terminated.exitCode,
    reason: .status.containerStatuses[0].lastState.terminated.reason,
    finishedAt: .status.containerStatuses[0].lastState.terminated.finishedAt
  }
] | group_by(.exitCode) | map({
  exitCode: .[0].exitCode,
  reason: .[0].reason,
  count: length,
  pods: [.[].name]
})' > /tmp/exit-code-patterns.json

# Find pods on same node
cat /tmp/pods-all.json | jq 'group_by(.spec.nodeName) | map({
  node: .[0].spec.nodeName,
  pod_count: length,
  failing_pods: [.[] | select(.status.phase != "Running") | .metadata.name]
}) | select(.failing_pods | length > 0)' > /tmp/node-failure-patterns.json

Read the full file on GitHub · 435 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 · 435 lines · 45 tokens per session scan A a3db8ce9d719

Subscribe to this mod's changes

k8s-pattern-finder is an agent published in the GitHub repository eveld/claude (10 stars, last pushed 7mo ago), licensed MIT. It adds 45 tokens to every session and 3,514 once invoked, about $0.0002 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.