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

.claude/commands/safe-dev.md

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

A development checklist for adding a new subsystem to an ESP32-S3 project, such as a task, hardware driver, or Kconfig setting. Kconfig is the system used to choose firmware build options.

In plain words
What is it for?
Use it when adding firmware features, drivers, or configuration symbols and when checking stack sizes, memory effects, and callback placement before flashing.
Why use it?
It reduces hard-to-diagnose crashes by making you add one change, flash it, test it, and save the working result before continuing.

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/safe-dev.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 safe-dev

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/safe-dev"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/safe-dev.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 1,376 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.01376
Opus 5.5 $0.00000 $0.00550
Sonnet 5.5 $0.00000 $0.00275
Haiku 4.5 $0.00000 $0.00138

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

Security

Grade A, and why

safe-dev 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 2mo 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/safe-dev.md · 78 lines

How it starts

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

Safe feature-dev loop for ESP32-S3 cry-detect-01

Use this flow when adding a new subsystem (new task, new driver, new Kconfig symbol). Every crash we've had in this project came from skipping one of these checks. Usage: /safe-dev <what-you're-adding>.

Principle: change one thing, verify, then change the next

The ESP32-S3 + native USB-JTAG makes iteration slow because:

  • Every serial-monitor open briefly toggles DTR/RTS → chip resets
  • A bootloop takes ≥5 s per cycle; multi-feature breakage is hard to bisect
  • Assert/panic backtraces require addr2line — only useful if you saved the .elf from the exact build that crashed

So: add one subsystem, flash, verify, commit, then add the next.

Pre-flash checklist

Before every flash, tick these:

  1. New Kconfig enabled? Check if it changes stack sizes / requires companion symbols.

    • CONFIG_FREERTOS_USE_TRACE_FACILITY=y → adds per-TCB bookkeeping; bump small task stacks
    • CONFIG_FATFS_LFN_HEAP=y → fopen of long names consumes extra heap; SD open can slow
    • Any new driver component (e.g. driver/temperature_sensor.h) → often pulls in event-loop handlers; do NOT install inside another driver's callback
  2. New task? Start it with 6 KB stack minimum unless you have a reason to go smaller. Add to WDT if it runs > 1 Hz. Pin to core 0 (Wi-Fi/lwIP on 0; model inference on 1).

  3. New callback on event loop? Anything in esp_event_loop_run_task context must be non-blocking. Do not:

    • call fopen/fwrite/SD I/O
    • take long-held mutexes (sd_logger, metrics, etc.)
    • call into sd_logger_ntp_sync_marker which opens+closes files

    Instead: signal a worker task via a queue/semaphore.

  4. New mutex? Write down the lock order on paper. This project has mutexes in sd_logger, web_ui, event_recorder, metrics_logger, noise_floor. A handler that takes two of them in the wrong order will deadlock.

  5. New heap allocation > 1 KB? Use heap_caps_malloc(n, MALLOC_CAP_SPIRAM) not stack, not internal RAM. Our internal DRAM is ~250 KB and every task competes.

  6. Feature flag in Kconfig? Add an CONFIG_CRY_<X>_ENABLED symbol defaulting OFF until verified. That way rollback is sed one line, not revert five files.

Read the full file on GitHub · 78 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. 2mo ago First seen · 78 lines · 0 tokens per session scan A de791bc5d097

Subscribe to this mod's changes

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

Related

safe-dev compared with commands from other repositories

safe-dev next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
safe-devchayuto/ws-ESP32-S3-CAMCommand61mo agoMITA0Claude Code
power-budgetcaptainluzik/oh-my-embeddedCommand388mo agoMITA8Claude Code
review-firmwarecaptainluzik/oh-my-embeddedCommand388mo agoMITA19Claude Code
bomcaptainluzik/oh-my-embeddedCommand388mo agoMITA10Claude Code
debugcaptainluzik/oh-my-embeddedCommand388mo agoMITA13Claude Code
flashcaptainluzik/oh-my-embeddedCommand388mo agoMITA15Claude Code
ruview-appruvnet/RuViewCommand103kyesterdayMITA30Claude Code