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

.claude/commands/restore-factory.md

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

A command for restoring the factory firmware on a Waveshare ESP32-S3 camera board. The factory firmware is the vendor's built-in launcher with Settings, Camera, Music Player, Recorder, and XiaoZhi AI.

In plain words
What is it for?
Use /restore-factory to flash the no-LCD factory image, or specify 1_83, 2, 2_8, or 3_5 for a matching LCD version.
Why use it?
Flashing example firmware overwrites that launcher, so this command provides a documented way to put it back.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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/restore-factory.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 restore-factory

README.md
[![agentmods](https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/restore-factory/github.svg)](https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/restore-factory)
Your own site
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/restore-factory"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/restore-factory/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 restore-factory

Your own site · 80×15
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/restore-factory"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/restore-factory.svg" alt="Reviewed on agentmods" width="80" 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 516 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.00000 $0.00516
Opus 5 $0.00000 $0.00258
Sonnet 5 $0.00000 $0.00103
Haiku 4.5 $0.00000 $0.00052

Measured 12d ago against content hash 69e48261db31, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

restore-factory 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 12d 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/restore-factory.md · 42 lines

What it actually says

Restore Waveshare factory firmware

The board ships running Waveshare's multi-app launcher (Settings / Camera / Music Player / Recorder / XiaoZhi AI). Flashing any example overwrites it. This restores it.

Usage: /restore-factory (default = no-LCD build) or /restore-factory <size> where <size> ∈ {1_83, 2, 2_8, 3_5}.

Pre-built Factory Binaries (in the vendor repo clone)

ref/demo/ESP32-S3-CAM-OVxxxx/Firmware/
├── ESP32-S3-CAM-XXXX-Factory.bin              ← no LCD / USB-only use
├── ESP32-S3-CAM-XXXX-Factory-LCD_1_83.bin     ← 1.83" LCD variant
├── ESP32-S3-CAM-XXXX-Factory-LCD_2.bin        ← 2"   LCD variant
├── ESP32-S3-CAM-XXXX-Factory-LCD_2_8.bin      ← 2.8" LCD variant
└── ESP32-S3-CAM-XXXX-Factory-LCD_3_5.bin      ← 3.5" LCD variant

These are merged images — single file containing bootloader + partition table + app.

Flash Command

. ~/esp/esp-idf/export.sh 2>/dev/null
PORT=$(ls /dev/cu.usbmodem* | head -1)
BIN=ref/demo/ESP32-S3-CAM-OVxxxx/Firmware/ESP32-S3-CAM-XXXX-Factory.bin   # or LCD variant

python -m esptool --chip esp32s3 --port "$PORT" -b 460800 \
    --before default_reset --after hard_reset \
    write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m \
    0x0 "$BIN"

Offset 0x0 because these are merged images. Do NOT specify bootloader/partition offsets.

If Flash Fails to Connect

Force download mode: unplug USB → hold BOOT → plug USB → release BOOT → retry.

After Restore

The board reboots into the XiaoZhi launcher (USB host appears as mass-storage / serial console). Use the Camera app on the LCD (if fitted) or the USB UVC view to confirm GC2145 is alive.

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. 12d ago First seen · 42 lines · 0 tokens per session scan A 69e48261db31

Subscribe to this mod's changes

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