debug-embedded

debug-embedded is a command for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 27 tokens per session (892 once invoked), scanned A, original, MIT.

A command for connecting to and inspecting embedded hardware, analysing processor faults, and configuring trace output. It supports common debug probes and trace methods such as ITM, SWO, and ETM.

In plain words
What is it for?
Use it to attach with OpenOCD, J-Link, or pyOCD, halt a target, inspect registers and the stack, decode fault registers, and configure timing or execution traces.
Why use it?
It turns low-level crash and device-state information into more understandable fault details and debugging commands. This helps when firmware hangs, crashes, or behaves incorrectly on a target board.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the debug-trace plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to attach with OpenOCD, J-Link, or pyOCD, halt a target, inspect registers and the stack, decode fault registers, and configure timing or execution traces.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreembed-claude-code/debug-embedded
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/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install debug-trace, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

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-embedded

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/debug-embedded"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/debug-embedded.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 892 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.00027 $0.00892
Opus 5.5 $0.00011 $0.00357
Sonnet 5.5 $0.00005 $0.00178
Haiku 4.5 $0.00003 $0.00089

Measured 15d ago against content hash cea63f27e2a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug-embedded 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 15d 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.

plugins/debug-trace/commands/debug-embedded.md · 109 lines

How it starts

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

/debug-embedded

Embedded debug command: fault analysis, GDB sessions, trace setup, stack inspection.

Trigger

/debug-embedded <action> [options]

Actions

attach

Generate OpenOCD or J-Link connection commands.

/debug-embedded attach --probe stlink --target stm32f4x
/debug-embedded attach --probe jlink --device STM32F407VG --speed 4000
/debug-embedded attach --probe pyocd --target stm32f407

halt

Stop the target and inspect state.

/debug-embedded halt --dump-registers
/debug-embedded halt --dump-stack --depth 32

fault-analyze

Decode fault registers from a running or halted target.

/debug-embedded fault-analyze --cfsr 0x00020000
/debug-embedded fault-analyze --cfsr 0x00008200 --bfar 0x00000004
/debug-embedded fault-analyze --hfsr 0x40000000

Outputs: fault type in plain English, common causes, suggested fix, addr2line command.

trace

Configure ITM/SWO or ETM trace.

/debug-embedded trace --itm-printf --cpu-freq 168000000 --swo-freq 2000000
/debug-embedded trace --dwt-cycles --instrument my_function
/debug-embedded trace --watchpoint --addr 0x20001234 --type write

Process

  1. Identify probe type and connection.
  2. For faults: read CFSR, HFSR, MMFAR, BFAR from 0xE000ED28–0xE000ED38.
  3. Extract stacked PC from exception frame (MSP or PSP depending on EXC_RETURN bit 2).
  4. Run addr2line with stacked PC to get source location.
  5. Check LR for caller context.

Output Examples

CFSR decode: 0x00020000

CFSR = 0x00020000
  UFSR[17] = INVSTATE = 1
  Meaning: CPU tried to execute an instruction in ARM state (Thumb bit = 0 in xPSR).
  Common cause: function pointer missing Thumb bit (should be addr | 1).
  Fix: ensure function pointers are loaded from elf/symbol table, not cast from integer.

GDB session startup

arm-none-eabi-gdb -ex "target remote :3333" \
                  -ex "monitor reset halt"   \
                  -ex "load"                 \
                  -ex "break HardFault_HandlerC" \
                  -ex "continue"             \
                  firmware.elf

Read the full file on GitHub · 109 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. 15d ago First seen · 109 lines · 27 tokens per session scan A cea63f27e2a8

Subscribe to this mod's changes

debug-embedded is a command published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 6d ago), licensed MIT. It adds 27 tokens to every session and 892 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-10-01.