REA
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
The Art of Debugging Open Book
Wenn du das gebaut hast, füge diesen Code in dein README ein. Das Badge verlinkt auf diese Seite.
[](https://mcp.popnx.com/en/skills/stas00-the-art-of-debugging)MCP-Server, die die KI für dieselbe Arbeit mit Diensten verbinden
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.
MCP server for terminal commands, file operations, and process management
Gleiche Art Arbeit, sortiert wie die Skill-Liste
| Dieser the-art-of-debugging | rea | andrej-karpathy-skills | graphify | MoneyPrinterTurbo | |
|---|---|---|---|---|---|
| Anbieter | stas00 | morluto | multica-ai | Graphify-Labs | harry0703 |
| Skills | 1 | 1 | 1 | 1 | 1 |
| GitHub-Sterne | 1.749 | 468.733 | 234.332 | 150.287 | 144.566 |
| Letzte Codeänderung | 14. Okt. 2026 | 19. Nov. 2026 | 20. Apr. 2026 | 18. Nov. 2026 | 18. Nov. 2026 |
| Lizenz | CC-BY-SA-4.0 | MIT | – | Apache-2.0 | MIT |
1 Skills (Anweisungssammlungen) von stas00, die eine KI liest und befolgt · kein MCP-Server
MCP = die Hände
Verbindet die KI mit einem externen Dienst oder Daten, etwa Notion lesen oder eine Rechnung erstellen. Ein Programm oder Server muss laufen.
Skill = das Handbuch
Eine Textdatei, die der KI zeigt, wie eine Aufgabe geht. Sie verbindet sich mit nichts.
Manches überschneidet sich: Einige Skills starten Skripte mit Werkzeugen, einige MCP-Server liefern nur Wissen. Geh von der Aufgabe aus.
Vom Anbieter nicht angegeben · SKILL.md-Skills laufen in Apps mit Agent-Skills-Unterstützung wie Claude Code, Codex und Cursor
GitHub account stas00 (person), 11 years old
★ 1.749 stars · code last changed 14. Okt. 2026
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
Scripts that go online: build/check-new-links.sh
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
Zuerst: Welche KI nutzt du?
Wähle deine App, dann zeigt diese Seite nur die Installation für diese App
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
+Create skillUpload a skillpick art-of-debugging.zip
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 12. Nov. 2026 · Source: support.claude.com, support.claude.com, code.claude.com
Kopiere diesen Satz und füge ihn in einen Claude Code-Chat ein
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 neu starten, dann /the-art-of-debugging tippen oder eine passende Aufgabe stellen; Claude nutzt den Skill
Checked against official docs 12. Nov. 2026 · Source: code.claude.com
Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.
Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“
Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer 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-debuggingSelbst installierte Skills funktionieren in der ChatGPT-Desktop-App, in Codex CLI und in der Codex-Erweiterung für die IDE · ChatGPT im Web und auf dem Handy kann selbst installierte Skills nicht nutzen, nur Skills, die mit einem Plugin aus dem Verzeichnis kommen
Die ChatGPT-Desktop-App enthält Codex, und Codex liest Skills aus dem Ordner ~/.agents/skills
Öffne Codex in der ChatGPT-Desktop-App und füge diesen Satz in den Chat ein
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
Lege den Ordner art-of-debugging unter ~/.agents/skills/art-of-debugging ab
~ ist dein Home-Ordner ($HOME)
Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.
Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“
Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer 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-debuggingChecked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com
Selbst installierte Skills funktionieren hier nicht, nur Skills, die mit einem Plugin aus dem Verzeichnis kommen
Um diesen Skill mit ChatGPT zu nutzen, verwende die ChatGPT-Desktop-App wie oben beschrieben
Checked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com
Kopiere diesen Satz und füge ihn in einen Codex-Chat ein · Funktioniert in Codex in der ChatGPT-Desktop-App, in Codex CLI und in der IDE-Erweiterung
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 erkennt neu installierte Skills selbst; wenn einer nicht erscheint, starte Codex neu · So nutzt du ihn: In ChatGPT @ tippen und den Skill wählen · in Codex CLI oder der IDE-Erweiterung /skills ausführen oder $ und den Skill-Namen tippen
Checked against official docs 15. Nov. 2026 · Source: learn.chatgpt.com
Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.
Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“
Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer 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-debuggingKopiere diesen Satz und füge ihn in einen Cursor-Chat ein
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
Im Agent-Chat von Cursor / tippen und the-art-of-debugging wählen
Checked against official docs 12. Nov. 2026 · Source: cursor.com
Ein Skill sind Anweisungen, denen die KI folgt. Lies die Dateien vor der Installation und installiere nur von vertrauenswürdigen Anbietern.
Mac: Command+Leertaste und Terminal tippen · Windows: Der Befehl unten funktioniert nicht in PowerShell; nutze oben „KI installiert es“
Lädt das Repo in einen temporären Ordner und kopiert nur Ordner mit einer 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-debuggingFür andere Apps, die Skills lesen. Der Satz enthält die Pfade für Claude Code, Codex und Cursor, damit die KI den für deine App wählt · Copy this sentence into the app’s chat
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 12. Nov. 2026 · Source: code.claude.com, learn.chatgpt.com, cursor.com
Andere Apps mit Agent Skills (etwa Gemini CLI oder GitHub Copilot) nutzen andere Ordner. Sieh in deren Anleitung nach und kopiere den Ordner mit der SKILL.md dorthin.
Skill-Ordner am 11. Nov. 2026 mit den offiziellen Anleitungen von Claude Code, Codex und Cursor geprüft
✓ Befehle geprüft am 18. Nov. 2026
Der folgende Text stammt aus dem Repo des Anbieters, nicht von PopNx MCP
Die ersten 8.000 Zeichen · Ganze Datei auf GitHub öffnen
---
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 forkFragen, Tipps teilen oder melden, dass etwas nicht geht. Sortiert nach „hilfreich“.
Noch keine Beiträge. Stell die erste Frage oder teile einen Tipp.
Beiträge hier stammen von Nutzern, nicht vom PopNx-Team.