python-debugpy

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill python-debugpy-vivekgoquest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-debugpy
Source: https://github.com/vivekgoquest/hermes-agent-stable/tree/main/skills/software-development/python-debugpy
Command: npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill python-debugpy-vivekgoquest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires debugpy, remote-pdb.

What problem does it solve? Tracebacks and print statements often fail to reveal why a value is wrong, especially in long-running processes, subprocesses, or tests that only fail under specific conditions. This Skill provides structured recipes for interactive Python debugging with pdb and remote debugging with debugpy, so you can inspect live state, step through execution, and perform post-mortem analysis at the exact crash site. ## Core Features & Use Cases - Local pdb debugging: Drop into an interactive REPL with breakpoint(), launch scripts under python -m pdb, and use the full pdb command set (step, breakpoints, stack navigation, expression evaluation). - Remote and attach-based debugging: Use debugpy to listen on a port, wait for a client, or inject into an already-running process by PID, with remote-pdb as a terminal-friendly alternative over netcat. - Post-mortem and test debugging: Catch exceptions with pdb.post_mortem, run pytest with --pdb or --trace, and debug subprocesses like gateway daemons and worker processes. - Use Case: A long-running gateway process misbehaves and cannot be restarted cleanly. Add a debugpy listener or remote-pdb trace point, connect from another terminal, and inspect the suspended frame and pending asyncio tasks live. ## Quick Start Add a breakpoint() call at the suspect line in my Python file and show me how to inspect the local variables when execution pauses.

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 REPL. Inside the prompt, use n to step over, s to step into, p to print expressions, and w to view the call stack.

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 terminal debugging?▼

remote-pdb gives a standard pdb prompt over a netcat connection and is the cleaner choice for terminal-only workflows. Use debugpy when you need IDE integration via DAP, thread-aware debugging, or attach support in VS Code, Cursor, or Zed.

Why does pdb not work when running pytest in parallel?▼

Parallel or output-capturing runners like pytest-xdist and captured subprocess wrappers swallow the pdb prompt, causing the test to hang silently. Run pytest directly on a single file with --pdb for interactive debugging.

Why does debugpy attach to PID fail on Linux?▼

Hardened kernels block ptrace-based injection when /proc/sys/kernel/yama/ptrace_scope is set to 1. Set it to 0 with root privileges, or launch the process under debugpy from the start instead of attaching later.

When should I not use pdb for debugging?▼

Skip pdb when print() or logging.debug solves the problem in under a minute, or when pytest -vv --tb=long --showlocals already reveals the issue. pdb also does not follow forks, so each multiprocessing child needs its own trace point.