diagnose

diagnose is a cursor rule for coding agents from Jkudjo/oh-my-cursor. It costs 14 tokens per session (1,042 once invoked), scanned A, original, MIT.

A step-by-step method for finding the underlying cause of a bug, error, slow behavior or other unexpected result. It separates observed facts from guesses and unknowns, then compares possible causes using evidence.

In plain words
What is it for?
Collecting symptoms, building a list of possible causes, assigning confidence, choosing tests, and deciding when the evidence supports a root-cause diagnosis.
Why use it?
It reduces the risk of applying a fix to the wrong problem and provides a structured way to investigate limited time and information.

Cursor rule

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 rules/jkudjo/oh-my-cursor/diagnose
Clone the repo
git clone --depth 1 https://github.com/Jkudjo/oh-my-cursor

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/rules/jkudjo/oh-my-cursor/diagnose.svg)](https://agentmods.dev/rules/jkudjo/oh-my-cursor/diagnose)
Your own site
<a href="https://agentmods.dev/rules/jkudjo/oh-my-cursor/diagnose"><img src="https://agentmods.dev/badge/rules/jkudjo/oh-my-cursor/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,042 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.00014 $0.01042
Opus 5 $0.00007 $0.00521
Sonnet 5 $0.00003 $0.00208
Haiku 4.5 $0.00001 $0.00104

Measured 4d ago against content hash 3b4634ba6b23, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

rules/diagnose.mdc · 113 lines

How it starts

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

@diagnose

Trigger: Any bug, error, performance issue, or unexpected behavior where the cause is unknown.

The iron law

Root cause before fix. Never propose a solution until you have identified the cause with evidence.

Protocol

Phase 0 — Gather facts (read-only, max 3 min)

Before forming any hypothesis, collect:

  • Exact symptom (error message, metric, user report — verbatim)
  • When it started (specific time, after deploy, after config change)
  • Scope (all users / one region / one endpoint / one query)
  • What changed recently (deploy, config, data volume, traffic pattern)

Label everything: [FACT] (observed), [INFERRED] (reasoned), [UNKNOWN] (not yet knowable).

Phase 1 — Generate hypothesis tree (before investigating any)

Generate ≥5 hypotheses across all failure domains. Do not begin investigating until the full tree is built.

For each hypothesis, produce this structured entry:

H{N}: [specific cause]
  Confidence:   0.XX  (0.0 = ruled out, 1.0 = confirmed)
  Cost to test: {minutes} / {read-only|config-check|query|trace|restart}
  Signal value: high / medium / low
  Evidence for: [what observations support this]
  Evidence against: [what observations contradict this]
  To confirm:   [exact command, log pattern, or metric that would confirm]
  To rule out:  [exact command, log pattern, or metric that would eliminate]

Failure domains to cover:

  • App: crash, exception, logic error, config mismatch, deploy regression
  • Data: DB connectivity, slow query, lock contention, N+1, migration state, schema mismatch
  • Network: DNS, timeout, connection pool exhaustion, firewall, load balancer, CDN edge
  • Infra: pod restart, OOMKilled, node pressure, readiness probe, selector mismatch
  • Dependencies: third-party API, queue backlog, auth service, feature flag state, cache
  • Client/Observability: stale cache, client-side bug, wrong user segment, metrics blind spot

Phase 2 — Rank and budget

Sort hypotheses by: (confidence × signal value) ÷ cost to test

Read the full file on GitHub · 113 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. 4d ago First seen · 113 lines · 14 tokens per session scan A 3b4634ba6b23

Subscribe to this mod's changes

diagnose is a cursor rule published in the GitHub repository Jkudjo/oh-my-cursor (1 stars, last pushed 5mo ago), licensed MIT. It adds 14 tokens to every session and 1,042 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-08-31.

Related

Other cursor rules, from other repositories