testbench-debug

testbench-debug is a skill for Claude Code from SensorsIot/Embedded-AI-Harness. It costs 106 tokens per session (5,424 once invoked), scanned C, original, MIT.

A setup for debugging ESP32 chips remotely with GDB, a program that lets developers pause and inspect running code. It connects the debugger through JTAG, a hardware debugging interface, using USB JTAG or an ESP-Prog adapter.

In plain words
What is it for?
Use it to set up breakpoints, inspect ESP32 programs, connect GDB, configure OpenOCD, and troubleshoot USB JTAG or ESP-Prog connections.
Why use it?
It removes the need to connect a debugger directly to the computer running GDB. It also helps diagnose connection problems and selects suitable OpenOCD settings, where OpenOCD is the program that communicates with the hardware probe.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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/sensorsiot/embedded-ai-harness/testbench-debug
Any agent
npx skills add SensorsIot/Embedded-AI-Harness --skill testbench-debug
Clone the repo
git clone --depth 1 https://github.com/SensorsIot/Embedded-AI-Harness

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 testbench-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/sensorsiot/embedded-ai-harness/testbench-debug.svg)](https://agentmods.dev/skills/sensorsiot/embedded-ai-harness/testbench-debug)
Your own site
<a href="https://agentmods.dev/skills/sensorsiot/embedded-ai-harness/testbench-debug"><img src="https://agentmods.dev/badge/skills/sensorsiot/embedded-ai-harness/testbench-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,424 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 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.1 $0.00106 $0.05424
Opus 5 $0.00053 $0.02712
Sonnet 5 $0.00021 $0.01085
Haiku 4.5 $0.00011 $0.00542

Measured 6d ago against content hash 1b912f2f5cbf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

testbench-debug scanned grade C with 3 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 6d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -X POST $TESTBENCH_URL/api/debug/stop -d '{}'

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo cp openocd-esp32/bin/openocd /usr/local/bin/openocd-esp32

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl $TESTBENCH_URL/api/devices
.claude/skills/testbench-debug/SKILL.md · 528 lines

How it starts

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

Testbench GDB Debugging

Remote GDB debugging of ESP32 devices through the testbench Pi. OpenOCD runs on the Pi, GDB connects from the container over TCP.

Architecture:

[Container]              [Pi (testbench)]           [ESP32]
  GDB ──── TCP :3333 ────── OpenOCD ──── USB JTAG ──────── CPU
                             (or)
                           OpenOCD ──── ESP-Prog ── JTAG pins

Three Approaches

Approach Chips Extra Hardware Serial During Debug
USB JTAG (FR-024) C3, S3 (native USB only) None Yes
Dual-USB (FR-025) S3 (two USB connectors) None Yes + app USB
ESP-Prog (FR-026) All ESP32 variants ESP-Prog (~$15) + cable Yes

Auto-Debug (Zero Config)

OpenOCD starts automatically when a device is plugged in or at boot. No API call needed.

How it works:

  1. Device hotplugged → serial proxy starts → auto-detect tries OpenOCD configs
  2. Chip identified via JTAG TAP ID → OpenOCD starts on the assigned GDB port
  3. If USB JTAG fails (e.g. classic ESP32), falls back to ESP-Prog probe if available
  4. GDB port reported in /api/devices response

Check debug status:

curl $TESTBENCH_URL/api/devices
# Look for: "debugging": true, "debug_chip": "esp32s3", "debug_gdb_port": 3335

Manual override (optional -- only needed to force-stop or force-start):

# Force stop (won't auto-restart until next hotplug)
curl -X POST $TESTBENCH_URL/api/debug/stop -d '{}'

# Force start with specific chip
curl -X POST $TESTBENCH_URL/api/debug/start \
  -d '{"chip": "esp32c3"}'

JTAG Reset (Preferred When Available)

When a debug session is active, the testbench automatically uses JTAG reset instead of DTR/RTS serial reset. This is transparent — the same /api/serial/reset API is used.

Why JTAG reset is better:

  • No USB re-enumeration (device node stays stable)
  • No flapping risk
  • No 2-second boot delay
  • Works even when serial port is unresponsive
  • Can halt the CPU to stop boot loops

Read the full file on GitHub · 528 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. 6d ago First seen · 528 lines · 106 tokens per session scan C 1b912f2f5cbf

Subscribe to this mod's changes

testbench-debug is a skill published in the GitHub repository SensorsIot/Embedded-AI-Harness (172 stars, last pushed 25d ago), licensed MIT. It adds 106 tokens to every session and 5,424 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 3 findings (sends data to an external url, asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

esp32-log-triage

Parse and classify ESP32 serial log output to identify FastLED-related errors, RMT/I2S/SPI driver faults, timing violations, RTOS issues, and crash signatures. Use when debugging unexpected device behavior, boot failures, or LED output problems on ESP32.

FastLED/FastLED · 61 tokens

embedded-debug

Firmware crash analysis, stack trace decoder, and register dump interpreter for ESP32/ARM/AVR platforms. Use when debugging device crashes, panics, guru meditation errors, hard faults, or analyzing core dumps.

FastLED/FastLED · 46 tokens

memory-audit

Audit embedded code for stack overflow risks, heap fragmentation, static allocation patterns, and memory leaks. Use when investigating OOM crashes, optimizing memory usage, or reviewing memory-critical code on constrained devices.

FastLED/FastLED · 43 tokens

timing-analysis

Analyze real-time constraints, ISR latency, DMA transfer times, and LED protocol timing for embedded systems. Use when debugging timing-sensitive code, optimizing frame rates, or verifying protocol compliance.

FastLED/FastLED · 40 tokens

nucleo-anima-debug

Debug and develop NucleoOS firmware/ANIMA logic on the PC without flashing — the host harness compiles the real C and runs it locally. Use when working on ANIMA (the offline NL assistant), retrieval cascade, NLU, knowledge graph, or any firmware logic, and when deciding how to verify a change. Lists the gate suites to…

indecenti/NucleoOs · 84 tokens

firmware-debugger

(oh-my-embedded) Firmware debugging via GDB and serial monitor. Breakpoints, memory inspection, stack traces, JTAG/SWD. Requires debug probe.

captainluzik/oh-my-embedded · 38 tokens