py-debug

py-debug is a skill for Claude Code, Codex from berekvolgyipeter/dotclaude. It costs 54 tokens per session (1,037 once invoked), scanned A, original, MIT.

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

Written for no agent in particular: nothing here depends on one.

Good fit For debugging Python code, tracing execution, profiling program or line performance, investigating memory growth, and making difficult debug output easier to read.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/berekvolgyipeter/dotclaude/py-debug
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.

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.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for py-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/py-debug/github.svg)](https://agentmods.dev/skills/berekvolgyipeter/dotclaude/py-debug)
Your own site
<a href="https://agentmods.dev/skills/berekvolgyipeter/dotclaude/py-debug"><img src="https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/py-debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for py-debug

Your own site · 80×15
<a href="https://agentmods.dev/skills/berekvolgyipeter/dotclaude/py-debug"><img src="https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/py-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.01037
Opus 5.5 $0.00022 $0.00415
Sonnet 5.5 $0.00011 $0.00207
Haiku 4.5 $0.00005 $0.00104

Measured 1mo ago against content hash 561328b96cef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 2d ago), licensed MIT. It adds 54 tokens to every session and 1,037 once invoked, about $0.0002 per session on Opus 5.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

cuopt-developer

Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.

NVIDIA/skills · 47 tokens

python-memory-safe-scripts

Memory-safe Python script patterns for long-running processes under systemd MemoryMax constraints. Covers allocator purge (mimalloc/glibc malloctrim), HTTP response lifecycle, DataFrame cleanup, thread-local connection reuse, and periodic GC cadence. Battle-tested through 5 OOM optimization cycles on production GPU…

terrylica/cc-skills · 197 tokens

fastapi-templates

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

wshobson/agents · 37 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

python-code-quality

Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.

microsoft/agent-framework · 40 tokens

accelerated-computing-cudf

Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV/Parquet I/O, nullable semantics, and multi-GPU DataFrame workloads.

NVIDIA/skills · 56 tokens