プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

the-art-of-debugging Skill

リポジトリ ↗

作者:stas00★ 1,7491 個の skill

インストール

What it does

The Art of Debugging Open Book

  • Connects Instruction files the AI reads
  • Account or key No key found in README or SKILL.md
  • Category コーディング
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/skill/stas00-the-art-of-debugging.svg)](https://mcp.popnx.com/en/skills/stas00-the-art-of-debugging)

一緒に使える

同じ作業で AI をサービスにつなぐ MCP

REA

Reverse engineer anything from your terminal or agent with one CLI and MCP server.

作者:morluto広く使われている↓ 38.9万/週★ 46.9万8 日前更新

MCP · サービスにつなぐパソコンで動く

Fallow

Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.

作者:fallow-rs広く使われている↓ 244.1万/週★ 5385昨日更新

MCP · サービスにつなぐパソコンで動く

似た Skill

同じ種類の作業。Skill 一覧と同じ並び

似たものと比べる
これ
the-art-of-debugging
reaandrej-karpathy-skillsgraphifyMoneyPrinterTurbo
作者stas00morlutomultica-aiGraphify-Labsharry0703
Skill 数11111
GitHub スター1,749468,733234,332150,287144,566
最終コード更新2026年10月14日2026年11月19日2026年4月20日2026年11月18日2026年11月18日
ライセンスCC-BY-SA-4.0MIT–Apache-2.0MIT

stas00 による 1 個の Skill(指示セット)。AI が読んでそのとおりに作業します · MCP server ではありません

Skill と MCP の違い

MCP = 手

AI を外部のサービスやデータにつなぎます(例:Notion を読む、請求書を作る)。プログラムやサーバーが動いている必要があります。

Skill = 手順書

作業のやり方を AI に教えるテキストファイル。どのサービスにもつながりません。

重なる部分もあります。ツールを呼ぶスクリプト付きの Skill や、知識だけを渡す MCP もあります。やりたい作業から選んでください。

使えるアプリ

提供元の記載なし · SKILL.md 形式の Skill は Claude Code、Codex、Cursor など Agent Skills 対応アプリで使えます

インストール

Is it safe?

  • Who made it

    GitHub account stas00 (person), 11 years old

  • Use and upkeep

    ★ 1,749 stars · code last changed 2026年10月14日

  • Any scripts?

    35 scripts that can run on a computer: build/check-new-links.sh, build/check-programs, pytorch/code/collective_mismatch.py, pytorch/code/collective_mismatch_analyze.py and 31 more

  • Uses the internet?

    Scripts that go online: build/check-new-links.sh

  • Changes machine-wide settings?

    No hooks or writes to machine settings found

Checked automatically from the repo files at commit 7e479bf (read only, nothing was run). Not a safety guarantee: read it and decide for yourself

まず:どの AI を使っていますか

使っているアプリを選ぶと、そのアプリでのインストール方法だけが表示されます

Option 1Upload to claude.ai (web and app)

  1. Download from GitHub

    This skill uses the CC-BY-SA-4.0 license, which is not on the list we redistribute, so we do not hand out a ZIP from our site. Download it from GitHub and arrange the folder yourself, or use "Let the AI install it" above, which is easier

    Download from GitHub (whole repo) ↗

    Unzip it, then zip only the the-art-of-debugging folder again. The ZIP must have a art-of-debugging folder with SKILL.md at the top level, no loose files

  2. Open Skills on claude.ai and upload

    +Create skillUpload a skillpick art-of-debugging.zip

    Open claude.ai/customize/skills ↗

  3. No Upload button? Turn on file creation first

    SettingsCapabilitiesCode execution and file creation

    Turn on Code execution and file creation first (newer menus: Create and edit files) · personal plans: Settings → Capabilities · Team/Enterprise: an admin turns it on under Organization settings → Plugins & skills · every plan, including Free

Upload once; it works in claude.ai and Claude Desktop, and in recent Claude Code signed in with a Claude account (not with an API key)

Cowork and cloud sessions use the skills turned on in your claude.ai account, not ~/.claude/skills on your computer (Claude Desktop scheduled tasks run locally and still load it)

Checked against official docs 2026年11月12日 · Source: support.claude.com, support.claude.com, code.claude.com

Option 1Claude Code にインストールしてもらう

この文をコピーして Claude Code のチャットに貼り付けます

Where to install
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) for all my projects, at ~/.claude/skills/art-of-debugging. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) into the project this chat is open in (at .claude/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Claude Code を開き直し、/the-art-of-debugging と入力するか関連する作業を頼むと Claude が自動で使います

Checked against official docs 2026年11月12日 · Source: code.claude.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.claude/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/stas00/the-art-of-debugging.git /tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf && mkdir -p ~/.claude/skills && cp -R '/tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf/.' ~/.claude/skills/the-art-of-debugging
  3. Claude Code を開き直し、/the-art-of-debugging と入力するか関連する作業を頼むと Claude が自動で使います

自分でインストールした Skill は ChatGPT デスクトップアプリ、Codex CLI、IDE の Codex 拡張機能で使えます · Web 版とモバイル版の ChatGPT では自分でインストールした Skill は使えず、ディレクトリのプラグインに含まれる Skill だけが使えます

ChatGPT デスクトップアプリ

ChatGPT デスクトップアプリには Codex が組み込まれていて、Codex は ~/.agents/skills フォルダから Skill を読み込みます

Option 1ChatGPT にインストールしてもらう

ChatGPT デスクトップアプリで Codex を開き、この文をチャットに貼り付けます

Where to install
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) for all my projects, at ~/.agents/skills/art-of-debugging. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) into the project this chat is open in (at .agents/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Option 2自分でフォルダを置く

art-of-debugging フォルダを ~/.agents/skills/art-of-debugging に置きます

~ はホームフォルダ($HOME)です

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/stas00/the-art-of-debugging.git /tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf/.' ~/.agents/skills/the-art-of-debugging

インストールしたあと

  • ChatGPT デスクトップアプリ:サイドバーの Skills を開いて Skill があるか確認します
  • 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します
  • Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Web 版とモバイル版の ChatGPT

自分でインストールした Skill は使えません。ディレクトリのプラグインに含まれる Skill だけが使えます

この Skill を ChatGPT で使うには、上の方法で ChatGPT デスクトップアプリを使ってください

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

Option 1Codex にインストールしてもらう

この文をコピーして Codex のチャットに貼り付けます · ChatGPT デスクトップアプリ内の Codex、Codex CLI、IDE 拡張機能で使えます

Where to install
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) for all my projects, at ~/.agents/skills/art-of-debugging. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) into the project this chat is open in (at .agents/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください · 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します

Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.agents/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/stas00/the-art-of-debugging.git /tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf && mkdir -p ~/.agents/skills && cp -R '/tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf/.' ~/.agents/skills/the-art-of-debugging
  3. Codex を開き直して関連する作業を頼むと、Codex が skill を一覧に出します

Option 1Cursor にインストールしてもらう

この文をコピーして Cursor のチャットに貼り付けます

Where to install
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) for all my projects, at ~/.cursor/skills/art-of-debugging. First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) into the project this chat is open in (at .cursor/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Cursor の Agent チャットで / を入力し the-art-of-debugging を選ぶ

Checked against official docs 2026年11月12日 · Source: cursor.com

For Terminal users

Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください

  2. skill フォルダを ~/.cursor/skills にコピー

    repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします

    git clone --depth 1 https://github.com/stas00/the-art-of-debugging.git /tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf && mkdir -p ~/.cursor/skills && cp -R '/tmp/popnx-skill-stas00-the-art-of-debugging-7e479bf/.' ~/.cursor/skills/the-art-of-debugging
  3. Cursor の Agent チャットで / を入力し the-art-of-debugging を選ぶ

Option 1Let the AI install it

Skill を読めるほかのアプリ向けです。この文には Claude Code、Codex、Cursor のパスが入っていて、AI が使っているアプリに合わせて選びます · Copy this sentence into the app’s chat

Where to install
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) for all my projects, at ~/.claude/skills/art-of-debugging (in Codex use ~/.agents/skills/art-of-debugging, in Cursor ~/.cursor/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the full path you will install to and wait for me to agree.
Please install the skill art-of-debugging from https://github.com/stas00/the-art-of-debugging (commit 7e479bf) into the project this chat is open in (at .claude/skills/art-of-debugging; in Codex use .agents/skills/art-of-debugging, in Cursor .cursor/skills/art-of-debugging). First show me every file and tell me whether it has scripts or changes machine settings, then tell me the project name and the full path you will install to and wait for me to agree.

For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing

The AI tells you what it will do first and asks your permission at every step

Checked against official docs 2026年11月12日 · Source: code.claude.com, learn.chatgpt.com, cursor.com

For Terminal users

Gemini CLI や GitHub Copilot など Agent Skills 対応の他のアプリはフォルダが違います。そのアプリのガイドを見て、SKILL.md のあるフォルダをコピーしてください。

GitHub で見る ↗

2026年11月11日 に Claude Code、Codex、Cursor の公式ガイドで skill フォルダを確認

✓ コマンド確認済み 2026年11月18日

元の SKILL.md を見る

以下は提供元の repo の文章で、PopNx MCP の指示ではありません

最初の 8,000 文字を表示 · GitHub で全文を開く

---
name: art-of-debugging
description: >-
  Systematic methodology and concrete tool recipes for debugging Unix, Python,
  and PyTorch programs - crashes, hangs, segfaults, wrong output, CUDA OOM, NaN/Inf,
  slowness, and multi-node/multi-GPU issues. Use when a program crashes, hangs,
  deadlocks, segfaults, runs out of memory (OOM), produces NaN/Inf or wrong
  numbers, runs too slowly, or when the user mentions gdb, strace, py-spy,
  core files, CUDA_LAUNCH_BLOCKING, ldd/nm/LD_PRELOAD, cProfile, or distributed
  training hangs. Distilled from "The Art of Debugging", the latest version of which can be found at https://github.com/stas00/the-art-of-debugging

  The latest SKILL.md version can be found at https://github.com/stas00/the-art-of-debugging/blob/master/SKILL.md
---

# The Art of Debugging

> Distilled from **The Art of Debugging Open Book** by Stas Bekman - source: https://github.com/stas00/the-art-of-debugging (CC BY-SA 4.0). This skill is a condensed index; each section links back to the full chapter for depth.

Actionable methodology + copy-paste recipes for debugging Unix / Python / PyTorch programs. Apply the general loop first; then jump to the domain cheatsheet for the failure at hand. For scaling this up to large-model training/inference on real clusters (compute/storage/network, SLURM, throughput/memory, instabilities, fault tolerance, inference), pair this with [Machine Learning Engineering](https://github.com/stas00/ml-engineering/blob/master/skills/ml-engineering/SKILL.md).

## The debugging loop

The single most important idea: **most of the effort is in *locating* the cause; once you truly understand it, the fix is usually easy.** Optimize everything for reaching understanding faster.

1. **Reproduce reliably.** Get one command that triggers the bug every time. If it's flaky, pin the nondeterminism (seeds, ordering, timing, network, uninitialized memory) first - you can't debug what you can't repeat.
2. **Shrink the payload.** Make the repro *fast*: fewer layers, tiny model/data, one process, one CPU/GPU, one node. A 2-second repro beats a 2-minute one - you'll run it hundreds of times. See [methodology](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md).
3. **Localize.** Confirm you're editing the code that actually runs (the `die` trick), then bisect the search space: which commit, which file/function, which line, which input, which rank.
4. **Get a usable signal.** Turn a cryptic failure into a precise one: a real traceback (sync mode), a stack dump (py-spy/gdb), a syscall trace (strace), a printed value at the boundary, or a min/max/NaN check on a tensor.
5. **Change one thing, re-run, verify.** Fix on the fast repro, confirm, then re-widen to the full payload. Revert anything that didn't help.

### Make the loop fast and reliable

- **Atomic debug cycles.** Make each iteration a single self-contained, repeatable command (setup + run in one shot) so you never hand-redo multi-step state. See [atomic debug cycles](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#atomic-debug-cycles).
- **Automate diagnostics, minimize typing.** Alias the repro and your most-used commands; one keystroke to re-run. See [alias frequently used commands](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#alias-frequently-used-commands) and [automate diagnostics](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#automate-diagnostics-minimize-or-avoid-typing).
- **One-liner programs.** `perl`/`awk`/`python -c` to slice logs, extract fields, transform data on the fly instead of writing throwaway scripts. See [the power of one-liner programs](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#the-power-of-one-liner-programs).
- **Juggle configs cleanly** when running many debug experiments so results don't get confused. See [juggling multiple sets of configs](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#juggling-multiple-sets-of-configs-for-different-debug-experiments).

### Localization techniques

- **Am I editing the right file/class?** Insert a guaranteed break where you *think* execution goes; if the program doesn't die, you're in the wrong file/class/env:
  ```python
  def suspect():
      die   # NameError -> proves this code runs; the traceback also names the caller
  ```
  `traceback.print_stack()` shows callers without stopping (useful when the same function is reached via many paths). See [am I editing the right file and the right class?](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#am-i-editing-the-right-file-and-the-right-class).
- **Bisect a regression.** `git bisect start / bad / good <rev>` walks commits automatically to the one that broke things - script the test for `git bisect run`. See [finding a breaking commit by bisecting](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#finding-a-breaking-commit-by-bisecting-revisions).
- **Small/synthetic payload first.** Use tiny or synthetic inputs; switch to real data only when the bug is data-dependent. See [real vs random vs synthetic data](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#real-data-vs-random-data-vs-synthetic-data).
- **Race conditions.** Reordering/timing bugs hide under async; forcing synchronous execution can expose (or mask) them - note which. See [avoiding race conditions](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#avoiding-race-conditions) and [async vs sync mode](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#async-vs-sync-mode).

### Reproducing resource & environment issues

- **Cap resources on purpose** to test failure paths: emulate a nearly-full disk, limited CPU RAM, or limited GPU memory. See [running out of resources](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#running-out-of-resources-disk-space-cpu-memory-gpu-memory).
- **Watch resources live.** `watch -n1 nvidia-smi` / `free -h` / `df -h` in a second visible terminal to correlate a hang/OOM with what the machine is doing. See [watching and reproducing resource issues](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#watching-and-reproducing-resource-issues).
- **Inject `sleep`** to freeze a program at the interesting moment so you can attach a debugger or snapshot state. See [uses for sleep](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#uses-for-sleep).
- **HPC/SLURM:** keep the allocation and re-run with `srun` instead of re-`sbatch`-ing to cut per-iteration overhead. See [SLURM salloc and srun fast debug combo](https://github.com/stas00/the-art-of-debugging/blob/master/methodology/README.md#slurm-salloc-and-srun-fast-debug-combo).

## Unix / shell

Full chapter: [Unix Tools for Debugging](https://github.com/stas00/the-art-of-debugging/blob/master/unix/README.md).

- **Make shell scripts fail loudly and traceably:**
  ```bash
  set -e          # abort on first error
  set -o pipefail # a failing command anywhere in a pipe fails the whole pipe
  set -u          # abort on undefined variables (catches typos)
  set -x          # trace: print each command with expanded values as it runs
  set +x          # turn tracing back off around a noisy region
  ```
  Combine as `set -euo pipefail`. See [controlling script execution](https://github.com/stas00/the-art-of-debugging/blob/master/unix/README.md#controlling-script-execution).
- **`strace` - trace system calls** to see what a program actually does (files, network, why it's stuck):
  ```bash
  strace python -c "print('hi')"                 # trace from the start
  strace --pid PID                               # attach to a running/stuck process
  strace -o log.txt -f torchrun ...  # -f follows fork

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

GitHub の情報

GitHub スター
1,749
提供元
stas00
ライセンス
CC-BY-SA-4.0
最終コード更新
2026年10月14日
repo 内の SKILL.md(翻訳版とテンプレートを含む)
1
トピック
c, debugging, gdb, linux, methodology, python, pytorch, segfault, unix