---
name: cleanvoice-batch
description: Clean a folder or list of local recordings with Cleanvoice in one approved batch. Use when the user asks to clean, enhance or edit several episodes or files at once with Cleanvoice.
---

# Cleanvoice batch cleanup

Use with the `cleanvoice` skill and the connected Cleanvoice MCP server. This
needs a client that can run shell commands and read the files.

1. **List the inputs.** Find the matching audio and video files (for example
   `*.wav *.mp3 *.m4a *.mp4`), with their byte sizes. Show the list and confirm
   which files are included. Skip files over 5 GB and say why.
2. **Agree on settings once.** Use `get_settings`, or a saved configuration from
   `list_configurations`. Confirm one `config` (or `template_id`) for the whole
   batch.
3. **Optionally preview one file for free.** Upload the first eligible audio
   file with `create_upload` + `curl`, run `preview_edit`, and let the user
   listen. Adjust the settings if needed. Do not preview every file: the free
   limit is 5 per day. If previews are disabled, exhausted or not available for
   the file, say so and skip to step 4.
4. **Upload and quote.** Upload each remaining file with `create_upload` and
   `curl`. Run `preflight_edit` for files up to 64 MiB (at most 4 inputs per
   call, 6 calls per minute). For larger files, preflight cannot inspect them:
   read the duration locally (for example `ffprobe`) and estimate one credit
   per started minute, labelled as an estimate. Add up the credits, compare the
   total with `get_credit_balance`, and show both. `create_edit` still checks
   credits when each job is submitted.
5. **Get one explicit approval** for the total cost. Without it, stop.
6. **Record keys, then submit.** Before any `create_edit`, write a manifest
   next to the files (for example `cleanvoice-batch.json`) with each file's
   path, `file_url`, the exact `create_edit` arguments (`config`, and
   `template_id` / `upload_type` if used) and a unique `idempotency_key`. Do
   not include signed URLs. Then call `create_edit` per file with its saved
   key, and write each returned `job_id` into the manifest. If a file is
   rejected (for example `insufficient_credits`), mark it `rejected` with the
   error code, stop the batch and report which files were accepted.
7. **Resume, never restart.** If the session breaks, read the manifest. For
   each file without a `job_id` that is not `rejected`, retry `create_edit` with the
   same saved arguments and key. The server then returns the existing job
   instead of charging again. Never generate a new key for such a file. A
   `rejected` file is never charged and its key keeps replaying the rejection:
   after the user fixes the cause (for example buys credits) and approves
   again, give it a new key, save it, and submit.
8. **Collect results.** Poll each job with `get_edit` at its `poll_after_seconds`.
   Download finished outputs into a separate folder (for example `cleaned/`) and
   never overwrite the originals. Summarize per file what was removed, using
   `summary.cuts_by_category` and `seconds_removed`.
