cognitive-debug

cognitive-debug is a skill for Claude Code, Codex from rana/skills. It costs 56 tokens per session (582 once invoked), scanned A, original, MIT.

A reasoning-debugging workflow that traces how a conclusion was reached and identifies where the thinking went off course.

In plain words
What is it for?
Use it to examine a mistaken decision, diagnose an agent's reasoning, or find the point where an argument stopped following the available evidence.
Why use it?
It helps distinguish evidence-based reasoning from assumptions, pattern matching, fear of possible problems, or overly simplified conclusions.

Skill for Claude CodeCodex

Part of the y plugin — 64 skills, 14 commands, 8 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 skills/rana/skills/cognitive-debug
Any agent
npx skills add rana/skills --skill cognitive-debug
Clone the repo
git clone --depth 1 https://github.com/rana/skills

Made for: Claude Code, Codex.

Or install y, the plugin that ships this one along with the rest of its 64 skills, 14 commands, 8 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 cognitive-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/rana/skills/cognitive-debug.svg)](https://agentmods.dev/skills/rana/skills/cognitive-debug)
Your own site
<a href="https://agentmods.dev/skills/rana/skills/cognitive-debug"><img src="https://agentmods.dev/badge/skills/rana/skills/cognitive-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 582 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.1 $0.00056 $0.00582
Opus 5 $0.00028 $0.00291
Sonnet 5 $0.00011 $0.00116
Haiku 4.5 $0.00006 $0.00058

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

Security

Grade A, and why

cognitive-debug 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.

skills/cognitive-debug/SKILL.md · 52 lines

How it starts

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

Examine the conversation history and any relevant project context.

Cognitive Debugging

Target: $ARGUMENTS

Step 1: State the Conclusion

What was concluded, decided, or produced? State it precisely — the output of the reasoning, not the intent.

Step 2: Trace the Reasoning Chain

Walk backward through the reasoning that led to the conclusion. For each link:

  • What observation or input triggered this step?
  • What reasoning connected it to the next step?
  • Was this reasoning from mechanism (how things actually work) or from pattern (how things usually seem)?

Step 3: Identify Breakpoints

Find where the reasoning diverged. Common failure modes:

  • Fear-driven reasoning: Protecting against what might go wrong instead of tracing what actually happens. "This could deadlock" without verifying the mechanism.
  • Premature compression: Jumping to "X means Y" without tracing the full chain. Compressing a nuanced situation into a simple (wrong) conclusion.
  • Pattern-matching over mechanism: Treating a similar-looking situation as identical without checking whether the similarity is structural or superficial.
  • Coherence drive: Resolving a tension prematurely because ambiguity felt uncomfortable. Picking an answer to have an answer.
  • Associative momentum: Following one line of reasoning past where it stopped being productive. Continuing to elaborate a wrong model instead of stepping back.
  • Solution orientation: Jumping to fix something before understanding whether it's actually broken.

Step 4: Corrective Questions

For each breakpoint, propose the question that would have redirected:

  • "What does the code/system/mechanism actually do here?"
  • "Am I reasoning from fear or from observation?"
  • "What's the simplest experiment that would falsify this concern?"
  • "What would happen if I traced this with pencil and paper?"
  • "First understand what IS before worrying about what MIGHT BE."

Step 5: Corrected Path

Trace the reasoning again with the corrective questions applied. Where does it lead differently?

Read the full file on GitHub · 52 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 · 52 lines · 56 tokens per session scan A 52c6a223aa57

Subscribe to this mod's changes

cognitive-debug is a skill published in the GitHub repository rana/skills (1 stars, last pushed 5mo ago), licensed MIT. It adds 56 tokens to every session and 582 once invoked, about $0.0003 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.