debug

debug is a command for Claude Code from captainluzik/oh-my-embedded. It costs 13 tokens per session (869 once invoked), scanned A, original, MIT.

A command for starting a GDB debugging session for embedded firmware, software that runs on devices such as microcontrollers. GDB is a debugger, while OpenOCD and probe-rs connect it to hardware.

In plain words
What is it for?
Use it to debug embedded projects, set breakpoints by address or symbol, choose a probe, and launch OpenOCD, J-Link, or probe-rs.
Why use it?
It finds the available hardware-debugging tool and firmware file, then starts the appropriate debugging setup instead of requiring those steps manually.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to debug embedded projects, set breakpoints by address or symbol, choose a probe, and launch OpenOCD, J-Link, or probe-rs.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/captainluzik/oh-my-embedded/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.

Clone the repo
git clone --depth 1 https://github.com/captainluzik/oh-my-embedded

Made for: Claude Code.

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 debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/captainluzik/oh-my-embedded/debug/github.svg)](https://agentmods.dev/commands/captainluzik/oh-my-embedded/debug)
Your own site
<a href="https://agentmods.dev/commands/captainluzik/oh-my-embedded/debug"><img src="https://agentmods.dev/badge/commands/captainluzik/oh-my-embedded/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 debug

Your own site · 80×15
<a href="https://agentmods.dev/commands/captainluzik/oh-my-embedded/debug"><img src="https://agentmods.dev/badge/commands/captainluzik/oh-my-embedded/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 869 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.00013 $0.00869
Opus 5.5 $0.00005 $0.00348
Sonnet 5.5 $0.00003 $0.00174
Haiku 4.5 $0.00001 $0.00087

Measured 1mo ago against content hash 79f801cff7b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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.

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.

commands/debug.md · 121 lines

How it starts

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

Set up and launch a GDB debug session for the current embedded project.

Arguments

$ARGUMENTS may contain:

  • A target address or symbol to break on (e.g. app_main, 0x40080000).
  • A probe type override: openocd, jlink, or probe-rs.
  • A config file path for OpenOCD (e.g. openocd.cfg).

Step 1: Detect the debug probe

Check which tools are available:

which openocd
which JLinkGDBServer
which probe-rs

Also check for config files in the project root:

  • openocd.cfg or any *.cfg file referencing a target.
  • .cargo/config.toml with runner = "probe-rs" (Rust/probe-rs projects).

If $ARGUMENTS specifies a probe type, use that. Otherwise pick the first available tool.

Step 2: Find the firmware binary

Look for the ELF file:

  • ESP-IDF: build/<project_name>.elf
  • PlatformIO: .pio/build/<env>/<project_name>.elf
  • CMake generic: build/*.elf
  • Cargo/probe-rs: target/<target-triple>/debug/<binary>

If multiple ELF files exist, list them and ask the user to confirm which one to use.

Step 3: Start the GDB server

OpenOCD

openocd -f openocd.cfg

If no openocd.cfg exists, try common board configs:

# ESP32
openocd -f board/esp32-wrover-kit-3.3v.cfg

# STM32 with ST-Link
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg

# Generic CMSIS-DAP
openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg

Run OpenOCD in the background. Default GDB port is 3333.

J-Link

JLinkGDBServer -device <chip> -if SWD -speed 4000 -port 2331

Replace <chip> with the detected or user-specified target.

probe-rs

probe-rs gdb --chip <chip> <elf-file>

Step 4: Connect GDB

Use arm-none-eabi-gdb, xtensa-esp32-elf-gdb, or gdb-multiarch depending on the target architecture.

arm-none-eabi-gdb <elf-file> \
  -ex "target extended-remote :3333" \
  -ex "monitor reset halt" \
  -ex "load" \
  -ex "monitor reset init"

If $ARGUMENTS contains a target address or symbol, append:

  -ex "break $ARGUMENTS"
  -ex "continue"

Read the full file on GitHub · 121 lines

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 · 121 lines · 13 tokens per session scan A 79f801cff7b5

Subscribe to this mod's changes

debug is a command published in the GitHub repository captainluzik/oh-my-embedded (31 stars, last pushed 7mo ago), licensed MIT. It adds 13 tokens to every session and 869 once invoked, about $0.0001 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-30.