ws-ESP32-S3-CAM: Command for Claude Code

.claude/commands/flash.md

flash is a command for Claude Code from chayuto/ws-ESP32-S3-CAM. It costs 0 tokens per session (507 once invoked), scanned A, original, MIT.

A command for writing firmware to a connected ESP32-S3-CAM board, a small camera-equipped microcontroller board.

In plain words
What is it for?
Flashing an ESP-IDF project to the board over its native USB connection and confirming that the firmware was written successfully.
Why use it?
It handles the board connection and download process while avoiding a combined flashing-and-monitoring command that can fail in an automated shell.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

This is chayuto/ws-ESP32-S3-CAM's own configuration. It tells Claude Code how to work on ws-ESP32-S3-CAM itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ws-ESP32-S3-CAM configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chayuto/ws-ESP32-S3-CAM. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/chayuto/ws-ESP32-S3-CAM/main/.claude/commands/flash.md
Clone the repo
git clone --depth 1 https://github.com/chayuto/ws-ESP32-S3-CAM

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 flash

README.md
[![agentmods](https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/flash.svg)](https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/flash)
Your own site
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/flash"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/flash.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00000 $0.00507
Opus 5 $0.00000 $0.00253
Sonnet 5 $0.00000 $0.00101
Haiku 4.5 $0.00000 $0.00051

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

Security

Grade A, and why

flash 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 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.

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.

.claude/commands/flash.md · 45 lines

What it actually says

Flash firmware to the connected ESP32-S3-CAM board

Usage: /flash <project_path> (same path used with /build)

Steps

  1. Activate IDF: . ~/esp/esp-idf/export.sh 2>/dev/null

  2. Detect port. ESP32-S3 exposes native USB-Serial/JTAG — no CP2102, just usbmodem*:

    PORT=$(ls /dev/cu.usbmodem* 2>/dev/null | head -1)
    # Expect /dev/cu.usbmodem3101 on this host.
    
  3. Flash (no separate bootloader button needed — DTR/RTS auto-enter download mode):

    idf.py -C <project_path> -B /tmp/ws-esp32s3-build/$(basename <project_path>) \
           -p "$PORT" flash 2>&1 | tail -12
    
  4. A ~5 MB vendor example flashes in ~10 s. Expect final lines:

    Hash of data verified.
    Leaving...
    Hard resetting via RTS pin...
    Done
    

Warnings

  • Do NOT run idf.py flash monitor combined in a non-TTY shell (piped, subshell, Claude Code agent). Monitor exits immediately → flash aborts mid-write → "No bootable app" panic. Always flash first, then monitor separately — see /monitor.
  • If the port is busy, esptool fails with "Could not open serial port". A previous serial reader is still attached — kill it.
  • If the chip is in a bad state and auto-download fails, force bootloader mode: unplug USB → hold BOOT → plug USB → release BOOT. Then retry flash.

Board Is Currently Running Factory Firmware?

Flashing overwrites Waveshare's factory image (multi-app launcher with Settings/Camera/Music/XiaoZhi AI). The factory .bin lives at ref/demo/ESP32-S3-CAM-OVxxxx/Firmware/ESP32-S3-CAM-XXXX-Factory.bin (plus per-LCD-size variants). To restore it, use /restore-factory.

Report

  • Success: port used, bytes written, final "Hard resetting" line.
  • Failure: the esptool error line, with a suggested next action.
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 · 45 lines · 0 tokens per session scan A 4f2783b9291c

Subscribe to this mod's changes

flash is a command published in the GitHub repository chayuto/ws-ESP32-S3-CAM (5 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 507 tokens. 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-31.