debugging

debugging is a skill for Claude Code, Codex from Lion-1209/coderio. It costs 24 tokens per session (2,597 once invoked), scanned A, original, MIT.

A methodical way to find the underlying cause of software bugs by observing what happens, forming hypotheses, and testing them. It separates finding the cause from applying and checking the fix.

In plain words
What is it for?
Use it to investigate errors, crashes, unexpected behavior, unclear bug reports, and bugs that happen only under certain conditions.
Why use it?
It prevents random edits that hide symptoms while leaving the real problem in place. It also helps when a bug is hard to reproduce or the code appears correct.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to investigate errors, crashes, unexpected behavior, unclear bug reports, and bugs that happen only under certain conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lion-1209/coderio/debugging
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.

Any agent
npx skills add Lion-1209/coderio --skill debugging
Clone the repo
git clone --depth 1 https://github.com/Lion-1209/coderio

Made for: Claude Code, Codex.

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 debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/lion-1209/coderio/debugging/github.svg)](https://agentmods.dev/skills/lion-1209/coderio/debugging)
Your own site
<a href="https://agentmods.dev/skills/lion-1209/coderio/debugging"><img src="https://agentmods.dev/badge/skills/lion-1209/coderio/debugging/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 debugging

Your own site · 80×15
<a href="https://agentmods.dev/skills/lion-1209/coderio/debugging"><img src="https://agentmods.dev/badge/skills/lion-1209/coderio/debugging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,597 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.02597
Opus 5.5 $0.00010 $0.01039
Sonnet 5.5 $0.00005 $0.00519
Haiku 4.5 $0.00002 $0.00260

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

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • debugging — 100% identical, 0 lines differ
src/coderio/skills/lion-skills/skills/debugging/SKILL.md · 117 lines

How it starts

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

Debugging

概述

用科学方法定位 bug 的根因,而不是凭直觉乱改碰运气。核心:调试是观察 → 假设 → 设计实验验证 → 缩小范围 → 定位根因的循环,每一步都有依据。改到"不报错"不算修好——那可能只是把症状盖住了,根因还在。

何时使用

  • 遇到报错/崩溃/行为异常,要定位原因
  • bug 不稳定复现,不知触发条件
  • 调试卡住、改了好几处都不行
  • 看了代码"没发现问题",但程序确实有问题

不该用:行为符合预期的"不是 bug"(先确认是不是 bug,别把功能当 bug 调);环境/部署问题(先排查是不是代码外原因)。

与相邻 skill 的边界:debugging 管定位根因(调查:复现、假设、二分、读堆栈),verify-and-fix 管修复与验证(改对:修病因不症状、防回归)。两者接力——debugging 找出"问题是什么、在哪",verify-and-fix 接手"怎么改对、怎么确认修好"。debugging 的终点(定位的根因)就是 verify-and-fix 的起点。

当 bug 报告太模糊时("页面打不开""功能不工作"却没给报错/复现步骤),先回到 clarifying-questions 的思路——要可观察的现象(报错信息、触发操作、环境、是所有情况还是特定情况)再分析。没有现象的调试就是盲猜。

核心内容

第一原则:先看报错,别跳过它直接猜

报错信息(异常类型、消息、堆栈、行号)往往直接包含根因线索,是调试最便宜的情报。最常见、最浪费的错法是不看报错就凭直觉改——明明堆栈第 3 行写着 Cannot read 'id' of undefined at line 42,却跳过它去猜"是不是网络问题""是不是缓存"。

读报错的顺序:

  1. 异常类型 + 消息:发生了什么(TypeError?NullPointer?超时?)
  2. 第一个你自己代码的堆栈帧:在哪发生的(行号 + 函数)——注意是"你的代码",不是框架/库内部的帧
  3. 触发上下文:什么操作/数据触发的

读堆栈的技巧:堆栈常被框架/异步包装得很难读,几个技巧帮你找到真正的根因帧:

  • 跳过框架帧:堆栈顶部往往是一堆框架内部代码(React 调度、Express 中间件、ORM 反射),真正的根因在第一个属于你项目源码的帧——往下翻找到你认识的文件名/行号。
  • 异步代码的堆栈可能不连续:async/await、Promise、回调、事件循环的堆栈经常断开(一个错误在 setTimeout 里抛,堆栈却看不到触发它的代码)。现代运行时有 --async-stack-traces 或类似的异步堆栈支持,开启它;否则要在触发处手动打日志补全调用链。
  • 错误被转发后原始堆栈会丢:如果错误被 catch 又重新抛(尤其改了消息或包了新异常),原始堆栈可能藏在 error.cause 或 originalError 里——别只看最外层,挖嵌套的 cause 链。

养成习惯:遇到 bug,第一件事是完整读一遍报错,而不是打开编辑器开始改。读不懂报错时,先查懂它(搜异常类型、读文档),别跳过。

先复现,再调试

不能稳定复现的 bug 几乎无法调试——你改了不知道有没有效,因为"不报错"可能是修好了,也可能是这次没触发。调试前先建立可复现:

  • 找到触发 bug 的最小条件:什么输入、什么操作顺序、什么状态组合下必现?
  • 最小化:剥离无关因素,直到只剩"做 X 就必崩"。最小复现让你能反复试验、验证修复。

不稳定复现的 bug(偶发)尤其要先攻克复现——它通常意味着有隐含条件没找到(并发时序、特定数据、资源竞争、时间相关)。找这个条件本身就是定位根因的关键。

反例:bug 偶发,你直接多加几个 try/catch 把可能出错的地方包起来"这样就不崩了"——错误被吞了看不见,但触发条件和根因一行没动,换个场景又炸,而且现在连报错都没了,更难查。

科学方法:假设 → 实验 → 验证

定位根因靠假设驱动,不是碰运气:

  1. 观察:报错是什么、何时发生、复现条件。
  2. 假设:"我猜根因是 X"——基于观察和代码理解提出具体、可证伪的假设(不是"大概是哪里有问题")。
  3. 设计实验:如果是 X 导致的,那应该观察到 Y(可验证的预测)。
  4. 验证:跑实验,看 Y 是否成立。成立 → 假设支持,继续深入;不成立 → 排除这个假设,换下一个。
  5. 缩小范围:每次实验排除一部分可能性,把根因锁定在更小的范围。

Read the full file on GitHub · 117 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 117 lines · 24 tokens per session scan A 90bbc8ef8746

Subscribe to this mod's changes

debugging is a skill published in the GitHub repository Lion-1209/coderio (9 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 2,597 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-31.

Related

Other skills, from other repositories

codegraph

Analyze indexed codebases via graph database (neug) and vector index (zvec). Covers call graphs, dependencies, dead code, hotspots, module coupling, architecture reports, semantic search, impact analysis, bug root cause from GitHub issues, class diagrams (UML), and PR review (risk scoring, conflict detection…

QwenLM/qwen-code · 0 tokens

stuck

Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU/memory usage, hung subprocesses, and debug logs. Use /stuck or /stuck to focus on a specific process.

QwenLM/qwen-code · 57 tokens

structured-debugging

Hypothesis-driven debugging methodology for hard bugs. Use this skill whenever you're investigating non-trivial bugs, unexpected behavior, flaky tests, or tracing issues through complex systems. Activate proactively when debugging requires more than a quick glance — especially when the first attempt at a fix didn't…

QwenLM/qwen-code · 85 tokens

memory-leak-debug

Diagnose memory leaks in the Qwen Code CLI using heap snapshots and the chrome-devtools CLI. Use when investigating high memory usage, unbounded growth, or suspected object retention issues.

QwenLM/qwen-code · 42 tokens

bugfix

Fix a bug from a GitHub issue, following the reproduce-first workflow. Use when the user asks to fix a bug, investigate a GitHub issue, or debug a user-reported problem. Takes a GitHub issue URL or number as input.

QwenLM/qwen-code · 53 tokens

test-failure-explorer

Import and query an existing Vitest 3.2 JSON report to explore test failures, file-level errors and original diagnostic evidence.

QwenLM/qwen-code · 32 tokens