python-debugpy
What it does
This skill teaches the agent how to find bugs in Python programs with Python's built-in debugger and a remote debugger. It is for developers stuck on problems that print statements do not reveal.
When to use it
- ✓When a Python program gives wrong results and the cause is hidden.
- ✓When a Python test fails in a way you cannot explain.
- ✓When a Python service runs on another machine or starts in a confusing order and a debugger must be attached.
Skill link
https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/python-debugpy/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My Python script gives the wrong total. Help me step through it and see which value goes wrong.”
5 new skills a week. 1 minute to read.
How it works
The agent picks the simplest debugger for the job and pauses the program at the right line so it can check variables. For a running program it attaches a remote debugger on a local port.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Python Debugging
Use when Python code needs interactive debugging: hidden locals, confusing state mutation, failing tests, subprocesses, long-running services, or remote attach.
Choose the smallest debugger that reaches the bad frame:
breakpoint(): local code where source edits are acceptable.python3 -m pdb: launch from the beginning without editing source.python3 -m pdb -c continue: stop at an unhandled exception.debugpy: remote/headless processes, DAP clients, an existing PID, or startup races.
Commands
python3 -m pdb path/to/script.py arg1
python3 -m pdb -c continue path/to/script.py
python3 -c "import debugpy" || python3 -m pip install debugpy
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client path/to/script.py
python3 -m debugpy --listen 127.0.0.1:5678 --wait-for-client -m package.module
python3 -m debugpy --listen 127.0.0.1:5678 --pid <pid>
Source-edit attach:
import debugpy
debugpy.listen(("127.0.0.1", 5678))
debugpy.wait_for_client()
debugpy.breakpoint()
Post-mortem inspection:
import pdb
import sys
try:
run()
except Exception:
pdb.post_mortem(sys.exc_info()[2])
raise
pdb commands
- Flow:
n,s,r,c,q. - Stack and source:
w,u,d,a,l,ll. - Values:
p expr,pp expr,display expr. - Breakpoints:
b file.py:42,b func,b file.py:42, condition,cl <num>. - Evaluate or mutate:
!statement; full REPL:interact.
Rules
- Reproduce with the smallest command or test first.
- Disable parallel test workers for pdb; worker pools usually break interactive stdin.
- Keep
debugpyin the active environment. Do not add it as a project dependency unless the project needs it. - Bind debug servers to
127.0.0.1; expose them only on an isolated network or through a secure tunnel. - Treat PID attach as process injection. Avoid security-sensitive or production targets unless explicitly approved.
- On Linux, check ptrace and container privileges before changing a target when PID attach fails.
- Before committing, run
rg -n 'breakpoint\\(|pdb\\.set_trace|debugpy\\.' --type pyand remove accidental breakpoints. - Rerun the normal project test gate without the debugger.
FAQ
Do I need to change my code?
Not always. The skill can start the program in the debugger without editing it, though local work may use a breakpoint line in the source.
Can it debug a program that is already running?
Yes. The debugger can attach to an existing process by its ID.
What is post-mortem debugging?
It opens the debugger at the moment a program crashes, so you can inspect the state at that point.
Details
Original description by the author
Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote or headless attach.
repo: EKKOLearnAI/ekko-studio
Popularity
- GitHub stars
- 12k
- Ranking position
- #11575
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
1password
12kHelps your agent use the 1Password CLI to get secrets for commands and config files without showing them in chat, logs or saved files.
apple-notes
12kHelps your agent create, search, read, edit, move or delete Apple Notes on a Mac, using the memo command line tool.
apple-reminders
12kHelps your agent list, create, edit, complete or delete Apple Reminders and reminder lists on a Mac, using the remindctl tool.
document-to-action-items
12kHelps your agent turn a document, meeting transcript or set of notes into a clear table of tasks, owners, deadlines and decisions.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.