Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

python-debugpy — Claude Code skill: what it does, how to install

Guides interactive Python debugging with pdb and debugpy remote attach. Useful for tracking down broken tests, state mutations, and headless processes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openclaw/openclaw --skill python-debugpy -a claude-code
Open on GitHub

What python-debugpy does

The skill selects debugger strategies to reach the bad frame. For local code it suggests breakpoint(), while python3 -m pdb -c continue catches unhandled exceptions without modifying source files. It reproduces bugs with the smallest test command. Parallel test workers must be disabled because interactive stdin breaks in worker pools.

For headless services or running PIDs, it attaches via debugpy bound to 127.0.0.1:5678. The environment requires python3. On Linux, failed PID attachment is a clear reason to check container privileges and ptrace rather than swapping targets.

What it helps with

  • catch unhandled exceptions with python3 -m pdb -c continue
  • attach to a running Python process by PID using debugpy
  • inspect local variables and call stacks in failing tests
  • clean up leftover breakpoints before commit using rg

Example prompts for the agent

  • Debug the failing script.py using pdb without editing the source code.
  • Launch module worker with debugpy and wait for client on port 5678.
  • Search for leftover breakpoint() and debugpy calls before committing.

How to install python-debugpy

1Skills CLI (Vercel)

npx skills add openclaw/openclaw --skill python-debugpy -a claude-code

2Manually: put the files in place

~/.claude/skills/python-debugpy/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/python-debugpy/

From the same set48

The whole set →
summarize openclaw Runs a CLI tool to summarize or transcribe web articles, YouTube videos, podcasts, and local PDF documents directly within your AI assistant. Claude Code CX Codex Cursor +1 26,900installs weather openclaw This skill fetches current conditions and forecasts for a city, region, airport code, or coordinates. Use it to check rain and temperature or plan a trip. Claude Code CX Codex Cursor +1 9,300installs gog openclaw Guides an agent using the gog CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs. Use it when Google Workspace tasks need to run from a terminal. Claude Code CX Codex Cursor +1 8,500installs tmux openclaw Lets an agent work with live tmux sessions: read pane output, send keys and text, wait for a prompt line to show up. Claude Code CX Codex Cursor +1 8,400installs openai-whisper openclaw This skill lets your agent call the Whisper CLI to transcribe audio on your own machine. No API key needed. Claude Code CX Codex Cursor +1 7,100installs nano-pdf openclaw Edit PDF pages with plain text instructions through the nano-pdf CLI. Useful when you need to fix a typo or swap a heading without leaving your terminal. Claude Code CX Codex Cursor +1 7,100installs skill-creator openclaw A skill for writing, repairing and reviewing other skills. It splits behaviour into branches, sets the frontmatter and sorts resources into folders. Useful once your skill folder gets crowded. Claude Code CX Codex Cursor +1 6,700installs coding-agent openclaw This skill sends large coding tasks to Codex, Claude Code, or OpenCode as background workers. Use it for refactors, PR reviews, and issue-to-PR work. Claude Code CX Codex Cursor +1 6,500installs

Similar

systematic-debugging Hermes Agent (adapted from obra/superpowers) A four-phase skill that moves from a reproducible symptom to its root cause. Use it for test failures, build errors, integration issues, and unexpected behavior. Claude Code CX Codex Cursor +1 470installs printing-press-score mvanhorn Scores a generated CLI against the Steinberger bar and compares two CLIs. Use it when checking output from cli-printing-press. Claude Code CX Codex Cursor +1 6,400installs printing-press-output-review mvanhorn An internal reviewer skill for printed CLIs. It catches plausibility bugs in command output that rule-based checks and live verification miss. Claude Code CX Codex Cursor +1 6,400installs ce-riffrec-feedback-analysis EveryInc Turns recorded product feedback into structured bugs and requirements. Takes video, screenshots or notes from Riffrec and outputs a ready-to-use report for downstream agents. Claude Code CX Codex Cursor +1 2,800installs requesting-code-review Hermes Agent (adapted from obra/superpowers + MorAlekss) Pre-commit code verification pipeline that scans for security flaws, checks test regressions against a baseline, and runs an auto-fixing reviewer subagent. Claude Code CX Codex Cursor +1 467installs ios-simulator callstack Launch, inspect, and debug native, React Native, Expo, and Flutter apps on iOS Simulator from your agent. The agent can tap, type, scroll, validate code changes, and collect error logs. Claude Code CX Codex Cursor +1 5,100installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs

Questions about python-debugpy

How to install python-debugpy in Claude Code?

Run npx skills add openclaw/openclaw --skill python-debugpy -a claude-code in your terminal.

What does python-debugpy do?

It guides interactive Python debugging workflows, selecting between breakpoint(), standard pdb, post-mortem traces, and debugpy sessions.

What prerequisites are required?

The skill requires python3. For headless debugging or PID attachment, debugpy must be installed inside the active Python environment.

Source text

SKILL.md · MIT
---
name: python-debugpy
description: Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
metadata: { "openclaw": { "requires": { "bins": ["python3"] } } }
---

# Python Debugpy

Use when Python code needs interactive debugging: hidden locals, confusing state mutation, failing tests, subprocesses, long-running services, or remote/headless attach.

Pick the smallest debugger that reaches the bad frame.

## Choose

- `breakpoint()`: local code, source edits ok, fastest path.
- `python3 -m pdb`: no source edit, launch from the beginning.
- `python3 -m pdb -c continue`: stop at an unhandled exception.
- `debugpy`: remote/headless process, DAP client, already-running PID, or service startup race.

## Commands

```bash
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>
```

For source-edit attach:

```py
import debugpy

debugpy.listen(("127.0.0.1", 5678))
debugpy.wait_for_client()
debugpy.breakpoint()
```

For post-mortem:

```py
import pdb, sys

try:
    run()
except Exception:
    pdb.post_mortem(sys.exc_info()[2])
    raise
```

## pdb

- Flow: `n`, `s`, `r`, `c`, `q`.
- Stack/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>`.
- Mutate/evaluate: `!statement`; full REPL: `interact`.

## Rules

- Reproduce with the smallest command/test first.
- Disable parallel test workers for pdb; interactive stdin usually breaks inside worker pools.
- Keep `debugpy` in the active env; do not add it as a project dependency unless the project already wants it.
- Bind debug servers to `127.0.0.1`; do not expose `0.0.0.0` unless isolated or tunnelled.
- Use unique ports for parallel sessions.
- `debugpy --pid` injects into a running process; confirm the target pid before attaching.
- If PID attach fails on Linux, check ptrace/container privileges before changing the target.
- Cleanup before commit: `rg -n 'breakpoint\\(|pdb\\.set_trace|debugpy\\.' --type py`.
- Rerun the normal project test/gate without the debugger.
- `PYTHONBREAKPOINT=0` disables `breakpoint()`.
- If a process is stuck after debugger detach, confirm it is not still paused at a breakpoint.

© openclaw · MIT · openclaw/openclaw

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor