debugging-code
Interactively debug source code — set breakpoints, step through execution line by line, inspect live variable state, evaluate expressions against the running…
Skill by AlmogBaku
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/almogbaku-debugging-code
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 3
api.github.com· found in codecodeload.github.com· found in install commandgithub.com· found in code
Files it touches
~/.claude/skills/debugging-code
Tools it pre-approves 2
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(dap*)
What's inside
- Skill name
debugging-code- Description
- Interactively debug source code — set breakpoints, step through execution line by line, inspect live variable state, evaluate expressions against the running program, and navigate the call stack to trace root causes. Use when a program crashes, raises unexpected exceptions, produces wrong output, when you need to understand how execution reached a certain state, or when print-statement debugging isn't revealing enough.
- License
- MIT
- Allowed tools
- Bash(dap, *)
- Instructions
- 263 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Pre-approves some shell commands
Files (4)
- SKILL.md
- advanced-techniques.md · references/
- installing-debuggers.md · references/
- install-dap.sh · scripts/
SKILL.md (first lines)
# Interactive Debugger
Use when a program crashes, produces wrong output, or you need to understand exactly
how execution reached a particular state — and running it again with more print statements
won't give you the answer fast enough.
You can pause a running program at any point, read live variable values and the call stack
at that exact moment, step forward line by line or jump to the next breakpoint, and
evaluate arbitrary expressions against the live process — all without restarting.
## Setup
This skill uses `dap`, a CLI tool that background daemon to interact with the debugger via the DAP Protocol, maintain
the debugger state, so you can simply interact with it with multiple calls.
If `dap` isn't installed (check: `command -v dap`), install it NOW.
Ask/notify the user before proceeding to install it.
From Homebrew (macOS)
```bash
brew install AlmogBaku/tap/dap
```
Installer script:
```bash
bash scripts/install-dap.sh
```
Install from sources:
```bash
go install github.com/AlmogBaku/debug-skill/cmd/dap@latest
```
This tool is open-sourced and available on [GitHub](https://github.com/AlmogBaku/debug-skill), maintained and follows
best practices.
Supports natively Python, Go, Node.js/TypeScript, Rust, C/C++, and any other language that supports DAP.
If a debugger backend is missing or fails to start, see `references/installing-debuggers.md`
For all commands and flags: `dap --help` or `dap <cmd> --help`.
## Starting a Session
`dap debug <file>` launches the program under the debugger. Backend is auto-detected from the file extension.
Choose your starting strategy based on what you know:
- **Have a hypothesis** — set a breakpoint where you expect the bug: `dap debug script.py --break script.py:42`
- **Conditional breakpoint** — only stop when a condition is met: `dap debug script.py --break "script.py:42:x > 5"` (
always quote specs with conditions)
- **Multi-file app** — breakpoints across modules: `--break src/api/routes.py:55 --break src/models/user.py:30`
- **No hypothesis, small program** — walk from entry: `dap debug script.py --stop-on-entry` (avoid for large projects —
startup code is noisy; bisect with breakpoints instead)
- **Exception, location unknown** — `dap debug script.py --break-on-exception raised` (Python) / `all` (Go/JS)
- **Remote process** — `dap debug --attach host:port --backend <name>`
- **Process already running (stuck server, live issue)** — attach without restarting:
`dap debug --pid <PID> --backend <name>`
> **macOS + Go gotcha:** `dlv --pid` requires SIP disabled (`csrutil disable`).
> Prefer starting the program under the debugger instead or attaching to a remote debugger!
**Session isolation:** `--session <name>` keeps concurrent agents from interfering.
Tip: You might want to use your session id(${CLAUDE_SESSION_ID}) if available.
Run `dap debug --help` for all flags, backends, and examples.
## The Debugging Mindset
Reach for a debugger when reading source alone can't validate the root cause.
A debugger lets you *observe* what *does* happen: actual values, actual path, actual state.
When that diverges from what *should* happen, you've found your bug.
**Two strikes, rethink.** If two hypotheses fail at the same location, your mental model is wrong.
Re-read the code, form a *completely different* theory with different breakpoints.
**Escalate gradually.** Start with `dap eval` to test a quick hypothesis. Use conditional breakpoints
to filter noise. Fall back to full breakpoints + stepping only when you need interactive control.
**Mimic the user journey.** If you're debugging a user flow, set breakpoints along the path you expect the code to take.
If you expected `compute()` to be called, but it never is, then the bug is in the caller — not `compute()`, but whatever
was supposed to call it.
**Set breakpoints instead of prints.** When you feel the urge to print something, set a breakpoint instead.
## Know Your State
Every `dap` execution command returns full context automatically: current location, source, locals, call stack, and
output. At each stop, ask:
- Do the local variables have the values I expected?
- Is the call stack showing the code path I expected?
- Does the output so far reveal anything unexpected?
**Trace causation up the stack.** If a value is wrong at frame 0, check `dap eval "<expr>" --frame 1` to see what the
caller passed. Keep going up (`--frame 2`, `--frame 3`) until you find the frame where the value first became wrong —
that's the origin of the bug, not the symptom.
Example output at a stop:
```
Stopped at compute() · script.py:41
39: def compute(items):
40: result = None
> 41: return result
Locals: items=[] result=None
Stack: main [script.py:10] → compute [script.py:41]
Output: (none)
```
If the program exits before hitting your breakpoint:
```
Program terminated · Exit code: 1
```
→ Move breakpoints earlier, or restart with `--stop-on-entry`.From AlmogBaku/debug-skill, MIT.
Signals
- Stars
- 335
- Forks
- 27
- Open issues
- 1
- Last commit (this folder)
- Apr 17, 2026 (6 months ago)
- Last release
- Apr 17, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/AlmogBaku/debug-skill
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Cite this page
debugging-code skill. Agent Mart. https://agentmart.dev/skills/almogbaku-debugging-code (last updated 2026-10-24)