python-debugpy

Debug Python code using pdb breakpoints, post-mortem inspection, and debugpy remote attach.

5|2|Updated May 26, 2026
One-click install
npx skills add https://github.com/perasyudha/Nyxora --skill python-debugpy-perasyudha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-debugpy
Source: https://github.com/perasyudha/Nyxora/tree/main/packages/core/playbooks/software-development/python-debugpy
Command: npx skills add https://github.com/perasyudha/Nyxora --skill python-debugpy-perasyudha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires debugpy, remote-pdb.

What problem does it solve? Diagnosing Python bugs in tests, scripts, and long-running processes is difficult when tracebacks alone don't reveal why values are wrong, especially for subprocesses, daemons, and already-running services that can't be restarted. ## Core Features & Use Cases - Interactive pdb debugging: Set breakpoints with breakpoint(), step through code, inspect locals, and drop into a full Python REPL at any frame. - Remote debugging with debugpy and remote-pdb: Attach to running processes like gateways, daemons, and PTY child workers via DAP or a plain netcat pdb session. - Post-mortem analysis: Inspect locals at the exact crash frame after an unhandled exception. - Use Case: A pytest test fails only in the full suite. Run it with --pdb -p no:xdist, land at the failure, print the mutated collection, and walk the stack to find which earlier test polluted shared state. ## Quick Start Add a breakpoint() call at the suspect line in my Python file and walk me through inspecting the variables when the debugger stops there.

Frequently Asked Questions about python-debugpy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Python code with pdb breakpoints?

Add breakpoint() at the line you want to inspect and run the script normally to land in an interactive pdb prompt. From there use n to step, p to print expressions, w for the stack, and interact for a full Python REPL in the current scope.

How to attach a debugger to a running Python process?

Use debugpy with python -m debugpy --listen 127.0.0.1:5678 --pid <pid> to inject into a running process, then connect a DAP client. Alternatively, insert remote_pdb.set_trace() in the code and connect with nc 127.0.0.1 4444 for a plain pdb prompt.

debugpy vs remote-pdb for remote debugging?

debugpy speaks the Debug Adapter Protocol and integrates with VS Code, Cursor, and Zed, making it thread-aware and IDE-friendly. remote-pdb exposes a plain pdb prompt over a TCP socket, which is simpler for terminal-only or agent-driven debugging.

Why does pdb not work when running pytest with xdist?

pdb does not function under pytest-xdist because tests run in worker processes without an interactive terminal, so the prompt never appears and the test hangs. Disable parallelism with -p no:xdist or -n 0 when using --pdb or --trace.

Why is my breakpoint() call not hitting?

Check whether PYTHONBREAKPOINT=0 is set, which disables all breakpoint() calls. Other common causes are running under pytest-xdist, or a debugpy session where execution finished before the client attached because wait_for_client() was omitted.

Can pdb debug multithreaded or asyncio Python code?

pdb only debugs the current thread, so multithreaded programs need debugpy's thread-aware DAP or per-thread settrace. In coroutines, pdb works but awaiting inside the prompt requires Python 3.13+ or workarounds like asyncio.ensure_future on older versions.