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

.claude/commands/extract-session.md

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

A command that closes out an overnight device recording session by copying recordings and logs into a session folder and running an audit pipeline. It can be run again safely while device logs continue to grow.

In plain words
What is it for?
Use it to stop the session monitor, mirror WAV recordings and JSON or text logs, generate audit CSV files and spectrogram images, and write a completion marker. It connects to a device over the local network, using a supplied host or its default address.
Why use it?
It removes the need to copy recordings, fetch changing logs, run several audit steps, and track completion manually. Existing recordings are skipped, while growing device logs are refreshed.

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/extract-session.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 extract-session

README.md
[![agentmods](https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/extract-session.svg)](https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/extract-session)
Your own site
<a href="https://agentmods.dev/commands/chayuto/ws-esp32-s3-cam/extract-session"><img src="https://agentmods.dev/badge/commands/chayuto/ws-esp32-s3-cam/extract-session.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 610 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.00610
Opus 5 $0.00000 $0.00305
Sonnet 5 $0.00000 $0.00122
Haiku 4.5 $0.00000 $0.00061

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

Security

Grade A, and why

extract-session 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 8d 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/extract-session.md · 59 lines

How it starts

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

Close out a capture session

One-shot mirror of the deployed device + audit run for an overnight capture. Idempotent — safe to rerun partway through the night, or to refresh a session where the WAVs are already downloaded but device logs keep growing.

Usage: /extract-session <session_dir> [host]

  • <session_dir> — e.g. logs/night-20260419 (will be created if missing).
  • [host] — defaults to http://192.168.1.100.

What it does

Executes projects/cry-detect-01/tools/extract_session.sh, which:

  1. Kills the running bash monitor if one was started from the same session dir. (Looks up <session_dir>/monitor.sh in pgrep.)
  2. Mirrors /sdcard/events/<session_dir>/wavs/*.wav + <session_dir>/triggers.jsonl. Existing files are skipped.
  3. Mirrors /sdcard/ root logs (infer-*.jsonl, cry-*.log, infer-boot.jsonl, CRY-0000.LOG) → <session_dir>/device-logs/. These are re-downloaded every run because the device keeps appending while online.
  4. Runs the audit pipeline via tools/audit_pipeline.sh — produces manifest.csv / segments.csv / yamnet_files.csv / yamnet_segments.csv / specgrams/*.png.
  5. Writes a README.md stub if none exists yet. Fill it in before archival (see the taxonomy rules in docs/research/file-management-strategy-20260419.md).

Conventions

  • Session directory name: logs/night-YYYYMMDD, dated by the start of the night (the evening the deployment began).
  • Device is assumed reachable at http://192.168.1.100; override if running on a different LAN.
  • Never edits files already present. Won't rm WAVs.
  • If the device is offline at the time the command runs, the mirror step short-circuits gracefully and the audit runs on whatever is already on disk.

When to invoke

  • End of every overnight capture, first thing in the morning.
  • After any accidental monitor death (data since last download will still come through because infer-*.jsonl is day-bucketed and append-only on the device).

Read the full file on GitHub · 59 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. 8d ago First seen · 59 lines · 0 tokens per session scan A e0ef3f096e56

Subscribe to this mod's changes

extract-session 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 610 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.