Art of Debugging

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-d

1,742 stars 107 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add stas00/the-art-of-debugging --skill art-of-debugging
Manual install
git clone --depth 1 https://github.com/stas00/the-art-of-debugging.git /tmp/the-art-of-debugging
mkdir -p ~/.claude/skills
cp -r /tmp/the-art-of-debugging/. ~/.claude/skills/art-of-debugging

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the 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).
Read the full skill on GitHub

Details

Skill name
art-of-debugging
License
CC-BY-SA-4.0
Repo updated
13 October 2026

FAQ

What does the Art of Debugging skill do?

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-d

How do I install the Art of Debugging skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add stas00/the-art-of-debugging --skill art-of-debugging. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Art of Debugging popular?

It lives in stas00/the-art-of-debugging, which has 1,742 GitHub stars and 107 forks.

Related skills

Loki Mode

1.1k

asklokesh/loki-mode

Runs an autonomous software factory that knows what it is supposed to deliver and proves it did, with a signed receipt. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.

Software DevelopmentIn 1 list204

Code Review

1.1k

getsentry/skills

Perform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Covers security, performance, testing, and design review.

Software DevelopmentIn 1 list62

Hello Js Reverse Skill

1.4k

WhiteNightShadow/hello_js_reverse_skill

通用 Web API 数据采集、Node.js/Python 协议调用与前端签名分析。 使用 Camoufox MCP 捕获请求、调试 Hook、分析混淆/JSVMP/WASM, 交付可验证的采集程序,支持分页、断点续采和接口改版回归。 用于自有或已授权接口;微信小程序 wxapkg 解包使用对应小程序技能。

Software Development260

Refactor Module

910

hashicorp/agent-skills

Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.

Software DevelopmentIn 2 lists134

Tech Doc Style Chinese

1.6k

Fenng/Tech-Doc-Style-Chinese

在撰写、改写、校对或审阅中文技术文档、产品文案、界面文案、Markdown 文档、API 说明、操作手册、故障排查或运维文档时使用。采用克制、准确、可扫读的中文技术写作风格;保留原文事实、限制和机器可读内容;按任务读取术语排版、API 状态文案、项目覆盖或受控中文技术写作参考。

Software Development85

Provider Resources

910

hashicorp/agent-skills

Implement Terraform Provider resources and data sources using the Plugin Framework: CRUD operations, schema design, plan modifiers and validators, not-found handling, waiters for eventually consistent APIs, import support, resource design principles, and required acceptance test coverage. Use when adding or changing a resource or data source, deciding whether an API concept should be a resource, wiring a resource to the provider's configured client, handling drift or resource-not-found, or reviewing a resource implementation before submission.

Software DevelopmentIn 2 lists134

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.