diagnose

diagnose is a command for Claude Code from wangke19/gemini-ai-helpers. It costs 11 tokens per session (3,284 once invoked), scanned A, original, Apache-2.0.

A troubleshooting command for OpenShift’s Operator Lifecycle Manager (OLM), the system that installs and manages cluster operators. It checks common operator and cluster problems and can try approved fixes.

In plain words
What is it for?
Use it to investigate failed operator installations, stuck namespaces, orphaned custom resource definitions, conflicting OperatorGroups, unhealthy catalog sources, and incomplete uninstallations.
Why use it?
It brings scattered installation, namespace, catalog, and cleanup problems into one diagnostic report, reducing manual investigation. Optional automatic fixes can address detected issues.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Good fit Use it to investigate failed operator installations, stuck namespaces, orphaned custom resource definitions, conflicting OperatorGroups, unhealthy catalog sources, and incomplete uninstallations.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wangke19/gemini-ai-helpers/diagnose
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.

Clone the repo
git clone --depth 1 https://github.com/wangke19/gemini-ai-helpers

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 diagnose

README.md
[![agentmods](https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/diagnose/github.svg)](https://agentmods.dev/commands/wangke19/gemini-ai-helpers/diagnose)
Your own site
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/diagnose"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/diagnose/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 diagnose

Your own site · 80×15
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/diagnose"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 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,284 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.00011 $0.03284
Opus 5 $0.00005 $0.01642
Sonnet 5 $0.00002 $0.00657
Haiku 4.5 $0.00001 $0.00328

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

Security

Grade A, and why

diagnose 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.

extensions/olm/commands/diagnose.md · 411 lines

How it starts

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

Name

olm:diagnose

Synopsis

/olm:diagnose [operator-name] [namespace] [--fix] [--cluster]

Description

The olm:diagnose command diagnoses common OLM and operator issues, including orphaned CRDs, stuck namespaces, failed installations, and catalog source problems. It can optionally attempt to fix detected issues automatically.

This command helps you:

  • Detect and clean up orphaned CRDs from deleted operators
  • Fix namespaces stuck in Terminating state
  • Identify and resolve failed operator installations
  • Detect conflicting OperatorGroups
  • Check catalog source health
  • Identify resources preventing clean uninstallation
  • Generate comprehensive troubleshooting reports

Implementation

The command performs the following steps:

  1. Parse Arguments:

    • $1: Operator name (optional) - Specific operator to diagnose
    • $2: Namespace (optional) - Specific namespace to check
    • $3+: Flags (optional):
      • --fix: Automatically attempt to fix detected issues (requires confirmation)
      • --cluster: Run cluster-wide diagnostics (catalog sources, global CRDs, etc.)
  2. Prerequisites Check:

    • Verify oc CLI is installed: which oc
    • Verify cluster access: oc whoami
    • Check if user has cluster-admin or sufficient privileges
    • Warn if running without --fix flag (dry-run mode)
  3. Determine Scope:

    • Operator-specific: If operator name provided, focus on that operator
    • Namespace-specific: If namespace provided, check all operators in that namespace
    • Cluster-wide: If --cluster flag or no arguments, check entire cluster
  4. Scan for Orphaned CRDs:

    • Get all CRDs in the cluster:
      oc get crd -o json
      
    • For each CRD, check if there's a corresponding operator:
      • Look for CSVs that own this CRD
      • Look for active Subscriptions related to this CRD
    • Identify orphaned CRDs (no owning operator found):
      # Find CRDs without active operators
      # This is a simplified check - actual implementation should verify operator ownership
      oc get crd -o json | jq -r '.items[] | 
        select(.metadata.annotations["operators.coreos.com/owner"] // "" | length == 0) | 
        .metadata.name'
      
    • Check if CRs exist for orphaned CRDs:
      oc get <crd-kind> --all-namespaces --ignore-not-found
      
    • Report findings:
      ⚠️  Orphaned CRDs Detected
      
      The following CRDs have no active operator:
      - certificates.cert-manager.io (3 CR instances in 2 namespaces)
      - issuers.cert-manager.io (5 CR instances in 3 namespaces)
      
      These CRDs may be leftovers from uninstalled operators.
      
      [If --fix flag:]
      Do you want to delete these CRDs and their CRs? (yes/no)
      WARNING: This will delete all custom resources of these types!
      

Read the full file on GitHub · 411 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 · 411 lines · 11 tokens per session scan A f7c43ce8f0a8

Subscribe to this mod's changes

diagnose is a command published in the GitHub repository wangke19/gemini-ai-helpers (2 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 11 tokens to every session and 3,284 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-03.