Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Debug Python: pdb REPL + debugpy remote (DAP).
.claude/skills/hezaohezao-python-debugpy/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -42% | 0% |
| case-20 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 192% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 39% | 0% |
Three tools, picked by situation:
| Tool | When | |---|---| | breakpoint() + pdb | Local, interactive, simplest. Add breakpoint() in source, run, get REPL. | | python -m pdb | Launch script under pdb with no source edits. | | debugpy | Remote / headless / attach to running process. DAP, scriptable. |
Start with breakpoint(). It's the cheapest thing that works.
Don't use for: things print() / logging.debug solve in under a minute, or things pytest -vv --tb=long --showlocals already reveals.
Inside any pdb prompt ((Pdb)):
| Command | Action | |---|---| | h / h cmd | help | | n | next line (step over) | | s | step into | | r | return from current function | | c | continue | | unt N | continue until line N | | j N | jump to line N (same function only) | | b N | set breakpoint at line N | | b file:N | set breakpoint in another file | | b func | set breakpoint at function | | cl N | clear breakpoint N | | l | list 11 lines around current | | ll | list whole function | | w / where | show call stack | | u / d | move up/down stack frame | | p expr | print expression | | pp expr | pretty-print expression | | a | print args of current function | | args | same as a | | display expr | watch expression (re-eval each step) | | interact | drop into interactive Python REPL |
breakpoint()pythondef process(data): result = transform(data) breakpoint() # Execution pauses here, pdb REPL opens return result
Run normally:
bashpython script.py # Pauses at breakpoint(), (Pdb) prompt appears
python -m pdb (no source edits)bashpython -m pdb script.py # Starts paused at first line
Drop into pdb at the exact exception site:
pythonimport pdb, traceback try: main() except Exception: traceback.print_exc() pdb.post_mortem()
Or:
bashpython -m pdb -c continue script.py # Runs until exception, then drops to pdb at the crash
For long-running processes or headless debugging:
bash# Install pip install debugpy # Option 1: Launch with debugpy python -m debugpy --listen 5678 --wait-for-client script.py # Option 2: Inject into running code import debugpy debugpy.listen(5678) print("Waiting for debugger on port 5678...") debugpy.wait_for_client()
Attach from another terminal (DAP client):
bash# Using debugpy's CLI to set breakpoints + continue python -m debugpy --connect localhost:5678 --set-breakpoint script.py:42
Or use any DAP-compatible editor (VS Code, Neovim) to attach to port 5678.
python# In pdb (Pdb) display my_list # Each step, pdb re-evaluates and shows the value if changed
python# In source breakpoint() if condition else None # Or in pdb (Pdb) b 42, x > 100 # Break at line 42 only when x > 100
pythonimport debugpy # In the subprocess code: debugpy.listen(5679) debugpy.wait_for_client() # Parent can attach to port 5679
breakpoint() onlyfor local debugging.
Use debugpy for multi-process debugging.
w (where) to see the full async call stack.
pdb is more reliable than breakpoint() in some Windows terminals.
--listen 5679.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 4,841 | 3,251 | -33% | 1 | 1 | 0% | 593 | 1,729 | +192% | 0 | 0 | — |
case-02 | pass→pass | 8,059 | 3,952 | -51% | 1 | 1 | 0% | 1,257 | 1,745 | +39% | 0 | 0 | — |
case-03 | pass→pass | 13,907 | 12,243 | -12% | 1 | 1 | 0% | 2,402 | 3,280 | +37% | 0 | 0 | — |
case-04 | pass→pass | 11,518 | 8,414 | -27% | 1 | 1 | 0% | 1,947 | 2,627 | +35% | 0 | 0 | — |
case-05 | pass→pass | 8,993 | 4,410 | -51% | 1 | 1 | 0% | 1,530 | 1,953 | +28% | 0 | 0 | — |
case-06 | pass→pass | 5,705 | 4,465 | -22% | 1 | 1 | 0% | 869 | 1,901 | +119% | 0 | 0 | — |
case-07 | pass→pass | 4,575 | 4,057 | -11% | 1 | 1 | 0% | 732 | 1,691 | +131% | 0 | 0 | — |
case-08 | pass→pass | 4,453 | 4,195 | -6% | 1 | 1 | 0% | 619 | 1,839 | +197% | 0 | 0 | — |
case-09 | fail→pass | 8,021 | 5,759 | -28% | 1 | 1 | 0% | 1,327 | 2,056 | +55% | 0 | 0 | — |
case-10 | pass→pass | 32,714 | 11,333 | -65% | 1 | 1 | 0% | 2,190 | 2,214 | +1% | 0 | 0 | — |
case-11 | fail→pass | 19,707 | 6,016 | -69% | 1 | 1 | 0% | 2,973 | 1,739 | -42% | 0 | 0 | — |
case-12 | pass→pass | 8,809 | 7,530 | -15% | 1 | 1 | 0% | 1,255 | 2,190 | +75% | 0 | 0 | — |
case-13 | pass→pass | 3,983 | 5,522 | +39% | 1 | 1 | 0% | 400 | 1,651 | +313% | 0 | 0 | — |
case-14 | pass→pass | 3,348 | 2,607 | -22% | 1 | 1 | 0% | 427 | 1,552 | +263% | 0 | 0 | — |
case-15 | pass→pass | 4,831 | 3,411 | -29% | 1 | 1 | 0% | 622 | 1,679 | +170% | 0 | 0 | — |
case-16 | pass→pass | 3,198 | 3,743 | +17% | 1 | 1 | 0% | 405 | 1,714 | +323% | 0 | 0 | — |
case-17 | pass→pass | 12,054 | 4,740 | -61% | 1 | 1 | 0% | 715 | 1,836 | +157% | 0 | 0 | — |
case-18 | pass→pass | 5,452 | 3,507 | -36% | 1 | 1 | 0% | 756 | 1,784 | +136% | 0 | 0 | — |
case-19 | pass→pass | 4,897 | 4,161 | -15% | 1 | 1 | 0% | 707 | 1,640 | +132% | 0 | 0 | — |
case-20 | fail→pass | 15,556 | 3,623 | -77% | 1 | 1 | 0% | 2,472 | 1,747 | -29% | 0 | 0 | — |
case-21 | pass→pass | 5,398 | 2,897 | -46% | 1 | 1 | 0% | 720 | 1,497 | +108% | 0 | 0 | — |
case-22 | pass→pass | 6,768 | 2,659 | -61% | 1 | 1 | 0% | 893 | 1,510 | +69% | 0 | 0 | — |
case-23 | pass→pass | 4,802 | 5,992 | +25% | 1 | 1 | 0% | 841 | 2,102 | +150% | 0 | 0 | — |
case-24 | pass→pass | 7,345 | 4,182 | -43% | 1 | 1 | 0% | 1,013 | 1,819 | +80% | 0 | 0 | — |
case-25 | pass→pass | 7,556 | 5,100 | -33% | 1 | 1 | 0% | 1,214 | 2,002 | +65% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.