py-debug

A set of methods for finding and diagnosing problems in Python programs. It recommends stepping through code or measuring execution and memory use with tools suited to the specific problem.

In plain words
What is it for?
For debugging Python code, tracing execution, profiling program or line performance, investigating memory growth, and making difficult debug output easier to read.
Why use it?
It helps identify whether a program is crashing, slow, or using too much memory before changing the code. It also recommends capturing reproducible incorrect behavior in a regression test when appropriate.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/berekvolgyipeter/dotclaude/py-debug
Any agent
npx skills add berekvolgyipeter/dotclaude --skill py-debug
Clone the repo
git clone --depth 1 https://github.com/berekvolgyipeter/dotclaude

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,037 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.01037
Opus 5 $0.00027 $0.00518
Sonnet 5 $0.00011 $0.00207
Haiku 4.5 $0.00005 $0.00104

Measured 2d ago against content hash 561328b96cef, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

py-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/setup.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/py-debug/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Debugging

Not sure what's wrong? Start with ipdb — step through the code and observe. Once you can characterize the problem (slow, leaking memory, crashing), switch to the matching profiler.

Problem Tool
Need to step through execution interactively ipdb
Which function is slow? (whole-program overview) cProfile (stdlib)
Identifying slow lines in a function line-profiler
Profile a running process without code changes py-spy
Investigating memory growth or leaks memory-profiler
Hard to read debug output (nested dicts, long lists, tracebacks) rich

Behavioral Rules

  • Lock the bug with a failing test once reproduced — before patching incorrect behavior, capture the faulty behavior as a regression test (through the public interface where one exists), so the fix is verified and the bug can't silently regress; skip this for pure performance or memory investigations, where a test through the public interface is rarely the right artifact
  • Suggest only one tool per problem — don't list all options and ask the user to choose
  • Explain the fit in one sentence before showing usage — e.g. "Since you want line-by-line timing, line-profiler is the right tool here."
  • Prefer ipdb as the default for general debugging; only reach for profilers when the problem is clearly performance- or memory-related
  • For performance, start broad then zoom in — use cProfile to find the slow function, then line-profiler to find the slow line
  • Use py-spy when you can't modify the code — running process, production, or quick triage
  • Place set_trace() just before the suspect line, not at the top of the function
  • Never add profiling decorators to production code paths — always remind the user to remove them before deploying

Tool Reference

ipdb

Interactive debugger with IPython features (tab completion, syntax highlighting).

import ipdb

ipdb.set_trace()  # Pause execution here

Read the full file on GitHub · 128 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 128 lines · 54 tokens per session scan A 561328b96cef

Subscribe to this mod's changes

py-debug is a skill published in the GitHub repository berekvolgyipeter/dotclaude (2 stars, last pushed 20d ago), licensed MIT. It adds 54 tokens to every session and 1,037 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

amc-run-rtsp-calibration

Calibrate a new dataset from live RTSP camera streams via the AutoMagicCalib REST API. Use when the user provides RTSP URLs or asks to calibrate live cameras; VIOS records clips, AMC ingests them, then runs calibration.

NVIDIA/skills · 59 tokens

cuopt-numerical-optimization-formulation

LP, MILP, QP — concepts, problem-text parsing, and formulation patterns (parameters, constraints, decisions, objective). Concepts only; no API.

NVIDIA/skills · 42 tokens

cupynumeric-migration-readiness

Pre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment…

NVIDIA/skills · 173 tokens

deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the…

NVIDIA/skills · 219 tokens

cuopt-multi-objective-exploration

Trace, complete, and interpret the Pareto frontier across competing objectives using repeated single-objective cuOpt solves (weighted-sum and ε-constraint).

NVIDIA/skills · 40 tokens

deepstream-profile-pipeline

Profile a DeepStream pipeline with Nsight Systems and derive its configs from the measurement. Use when the user asks for an efficient, performant, or profiled pipeline — or to benchmark, tune, or measure FPS.

NVIDIA/skills · 49 tokens