/wokwi:find-memory-leaksfrom wokwi
Find memory leaks in ESP-IDF firmware in CI. The Wokwi simulator watches the free heap while a scenario compresses hours of use into seconds and fails the run when the heap drops below a limit; no logging code in the firmware. Use for suspected leaks, soak, stress or endurance tests, or a device that runs out of memory after hours or days.
Ships in wokwi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The simulator reads ESP-IDF's own heap counters out of the simulated chip, so the
firmware under test is the one you ship. Needs wokwi-cli 0.29 or newer, ESP-IDF 4.4 or
newer, and the ELF in wokwi.toml (firmware = 'build/flasher_args.json',
elf = 'build/my-app.elf').
Generate the workload. A request is whatever the product does repeatedly: a button press, a serial command, a sensor change. Scenarios have no loops, so script it:
import sys
n = int(sys.argv[1]) if len(sys.argv) > 1 else 200
print("name: Soak\nversion: 1\nsteps:\n - wait-serial: 'app: ready'")
for i in range(1, n + 1):
print(" - set-control: { part-id: btn1, name: pressed, value: 1 }")
if i == n: # arm the proof right after the last press, before any delay
print(" - wait-serial: 'handled %d requests'" % n)
print(" - delay: 10ms\n - set-control: { part-id: btn1, name: pressed, value: 0 }")
print(" - delay: 40ms")
Run once without a limit and read the free heap after start-up settles:
wokwi-cli . --scenario leak.test.yaml --timeout 60000 --heap-interval 500 --heap-csv heap.csv
# [heap esp] 0.500s free=388008 ... Heap: 20 samples, free 388008 -> 388008, 0 bytes/s lost
Pick the limit below the settled value, leaving room for normal churn: a heap that
settles at 380,000 with --heap-min-free 350000 fails once about 30 KB is gone.
Run with the limit (add --heap-min-free 350000 to that line). Exit 1 below it, 0
when the scenario completes above it, 42 on timeout. heap.csv keeps every sample
(part,time_s,free,min_free); the run fails on free only, lowest catches bursts.
[heap esp] 8.000s free=348944 min=347916
Error: free heap 348944 dropped below 350000 bytes at 8.000s
Heap: 16 samples, free 388008 -> 348944, lowest 347916, 5209 bytes/s lost
Prove it bites. The leaky build must fail and the fixed build pass; raise the request count until both hold. A soak test that never failed is not known to work.
GitHub Actions: use wokwi/wokwi-ci-action@v1 inputs heap_interval, heap_min_free,
heap_csv and timeout: 60000 (default 10 s); upload heap.csv with if: always().
project(...) in CMakeLists.txt.[heap lines is no result.delay: 60m hits the session cap; fire requests back to
back. The simulated --timeout must cover boot plus every step (200 x 50 ms is 10 s)
or the run exits 42.wait-serial comes right after the
step that triggers it, with no delay between them (see step 1). No such line in the
firmware? Log a count every 50 requests.--fail-text 'Guru Meditation Error'.Docs: https://docs.wokwi.com/wokwi-ci/heap-monitoring. Demo (leaky handler, generator, workflow, heap plot): https://github.com/wokwi/esp32-heap-leak-demo.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
4 skills in this plugin
/debug-esp32-firmwareDebug ESP32 firmware on the Wokwi simulator, no board or JTAG needed. Decode a panic backtrace, reproduce the bug with scripted inputs, capture I2C/SPI/UART traffic to a VCD file, attach GDB from the CLI or VS Code. Use for crashes, panics, watchdog resets, hangs, intermittent faults and wrong bus traffic./test-lvgl-uiTest an LVGL (or any other) embedded GUI in CI on the Wokwi simulator. Scripted taps and button presses drive the screen; the simulated display is compared pixel by pixel against reference PNGs, without a board. Use to test or regression-check a display UI, screen, menu or widget on ESP32 or other MCUs, or when someone mentions LVGL, TFT_eSPI, ILI9341, ST7789, GC9A01, SSD1306, a custom chip display, a touchscreen, `take-screenshot` or `compare-with`./verify-esp-idf-buildRun and verify ESP-IDF firmware on the Wokwi simulator from idf.py (`idf.py wokwi`, the idf-wokwi extension), no board attached. Use to smoke-test an ESP-IDF 6.x build, check that it prints a serial message, or run it without a devkit, including right after an agent built it.npx claudepluginhub wokwi/skills --plugin wokwi