structured-debugging

structured-debugging is a skill for Claude Code, Codex from QwenLM/qwen-code. It costs 85 tokens per session (1,721 once invoked), scanned A, original, Apache-2.0.

A step-by-step method for investigating difficult bugs, flaky tests, or unexpected behavior. It starts with a specific explanation of what might be wrong and checks that explanation against evidence.

In plain words
What is it for?
Use it to trace complex failures, record competing explanations, run focused checks, and narrow an issue to its root cause.
Why use it?
It reduces random fix attempts and helps separate the real cause of a problem from symptoms or guesses.

Skill for Claude CodeCodex ✓ vendor

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

Good fit Use it to trace complex failures, record competing explanations, run focused checks, and narrow an issue to its root cause.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qwenlm/qwen-code/structured-debugging
About the project

Qwen Code is an open-source AI coding agent that runs in a terminal and helps developers work with code through language models. It supports multiple model providers and can also be used through IDEs, desktop software, SDKs, and messaging bots.

QwenLM/qwen-code · 28,528 stars · on GitHub · qwenlm.github.io

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 QwenLM/qwen-code --skill structured-debugging
Clone the repo
git clone --depth 1 https://github.com/QwenLM/qwen-code

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/qwenlm/qwen-code/structured-debugging"><img src="https://agentmods.dev/badge/skills/qwenlm/qwen-code/structured-debugging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,721 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. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00085 $0.01721
Opus 5.5 $0.00034 $0.00688
Sonnet 5.5 $0.00017 $0.00344
Haiku 4.5 $0.00009 $0.00172

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

Security

Grade A, and why

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

.qwen/skills/structured-debugging/SKILL.md · 194 lines

How it starts

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

Structured Debugging

When debugging hard issues, the natural instinct is to form a theory and immediately apply a fix. This fails more often than it works. The fix addresses the wrong cause, adds complexity, creates false confidence, and obscures the real issue. Worse, after several failed attempts you lose track of what's been tried and start guessing randomly.

This methodology replaces guessing with a disciplined cycle that converges on the root cause. Each iteration narrows the search space. It's slower per attempt but dramatically faster overall because you stop wasting runs on wrong theories.

The Cycle

1. Hypothesize

Before touching code, write down what you think is happening and why. Be specific about the expected state at each step in the execution path.

Bad: "Something is wrong with the wait loop." Good: "The leader hangs because hasActiveTeammates() returns true after all agents have reported completed, likely because terminal status isn't being set on the agent object after the backend process exits."

For bugs you expect to take more than one round, create a side note file for the investigation in whichever location the project uses for such notes.

Write your hypothesis there. This file persists across conversation turns and even across sessions — it's your investigation journal.

2. Design Instrumentation

Add targeted debug logs or assertions at the exact decision points that would confirm or reject your hypothesis. Think about what data you need to see.

Don't scatter console.log everywhere. Identify the 2-3 places where your hypothesis makes a testable prediction, and instrument those.

Prefer logging values (return codes, payload contents, stream types, message bodies, env state) over presence checks ("was this function called?", "was this branch taken?"). Code-path traces tell you what ran; data traces tell you what it ran on. Most non-trivial bugs are correct code processing wrong data.

Ask yourself: "If my hypothesis is correct, what will I see at point X? If it's wrong, what will I see instead?"

Read the full file on GitHub · 194 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 · 194 lines · 85 tokens per session scan A def8114708dc

Subscribe to this mod's changes

structured-debugging is a skill published in the GitHub repository QwenLM/qwen-code (28,528 stars, last pushed today), licensed Apache-2.0. It adds 85 tokens to every session and 1,721 once invoked, about $0.0003 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-30.