chat-with-audio CLAUDE.md

chat-with-audio CLAUDE.md is an instructions file for coding agents from learningtour/chat-with-audio. It costs 1,635 tokens per session, scanned A, original, MIT.

Development instructions for Chat with Audio, a tool that improves audio through a local service and a C++ digital signal-processing core. They describe its commands, structure, tests, and common problems.

In plain words
What is it for?
Maintaining the Chat with Audio codebase, running its tests and checks, using its command-line tools, and checking its MCP connection.
Why use it?
They give an agent the project context needed to make changes without overlooking its separate Python service, C++ audio code, or local viewer.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/learningtour/chat-with-audio/claude-md
Clone the repo
git clone --depth 1 https://github.com/learningtour/chat-with-audio

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 chat-with-audio CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/learningtour/chat-with-audio/claude-md.svg)](https://agentmods.dev/instructions/learningtour/chat-with-audio/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/learningtour/chat-with-audio/claude-md"><img src="https://agentmods.dev/badge/instructions/learningtour/chat-with-audio/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,635 This file is loaded in full into every session.
When invoked 1,635 The same file — it is already loaded in full.
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 $0.01635 $0.01635
Opus 5 $0.00817 $0.00817
Sonnet 5 $0.00327 $0.00327
Haiku 4.5 $0.00163 $0.00163

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

Security

Grade A, and why

chat-with-audio CLAUDE.md 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 4d 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.md · 98 lines

How it starts

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

Chat with Audio — development notes

Chat-driven audio enhancement tool: MCP server (FastMCP, stdio) + C++ DSP core (pybind11) + local A/B viewer. See README.md and docs/ for user documentation (tool reference, workflows, compliance, smart regions, recipes, architecture).

Name everywhere: Chat with Audio (package chat_with_audio, MCP server chat-with-audio, GitHub chat-with-audio, local project folder "Chat with Audio").

Commands

uv sync --all-extras                              # build (incl. C++) + all deps
uv sync --reinstall-package chat-with-audio # after changes in cpp/
uv run pytest                                     # test suite
uv run ruff check .                               # lint (also runs in CI)
uv run python scripts/mcp_smoke.py                # MCP stdio smoke test
uv run ait analyze <file>                         # dev CLI without MCP
uv run ait improve <file> [--profile speech|music] [--denoise-method ai]
uv run ait viewer                                 # viewer on :8471

Architecture map

  • cpp/ — header-only DSP (biquad.hpp, dynamics.hpp) + bindings.cpp → module chat_with_audio._dsp. Arrays are float32 (channels, n); functions return new arrays; dynamics use a linked detector across channels.
  • src/chat_with_audio/dsp/__init__.py — dispatch: native _dsp when built, otherwise fallback.py (scipy; identical signatures, block-based dynamics). spectral_nr.py = Tier A denoise; ai_nr.py = Tier B (DeepFilterNet).
  • analysis.py → metrics dict + score_and_issues(); improve.py → profile detection + rules → (steps, rationale); chain.pySTEP_REGISTRY + execution (incl. leveler and segment-driven smart_denoise).
  • regions.py → smart problem regions: windowed detectors (hum/noise/clip/boom) find where on the timeline something is wrong; per-region mini-chains are applied with raised-cosine crossfades, everything outside stays untouched (smart_edit tool). Noise reference floor is clamped to -80 dB; boom regions inside a hum region are dropped (the notch already covers them).
  • recipes.py → saved chains as shareable JSON (save_recipe/apply_recipe/ list_recipes); built-ins live in src/chat_with_audio/recipes/, user recipes in ~/AudioImprove/recipes/ (env AIT_RECIPES_DIR; tests isolate this automatically). chain.validate_steps() guards every load/save.
  • segments.py → speech/music/silence segmentation (level-Otsu primary; modulation rhythm as fallback). refine.py → iterative measure-and-adjust loop (refine_audio tool): AI denoising once up front, then adjust leveler/loudness until the speech peak and balance are right; silence segments are pushed back down afterwards (_duck_silence) because the leveler would otherwise lift them.
  • compliance.py → delivery-spec registry (EBU R128, ATSC A/85, Netflix 2.0 én 5.1 dialogue-gated, streaming, ACX) + pass/fail checker incl. formaat- en kanaaleisen; master_for schrijft compliance.json (viewer-paneel) en exporteert mono → dual-mono bij een 2.0-eis. dialogue_loudness = blok- gebaseerde spraak-gated meting (DI-achtig, niét het Dolby-algoritme); op 5.1 detectie op het centerkanaal.
  • Surround: SURROUND_LAYOUTS in analysis.py — 5.1 (SMPTE) krijgt gewogen BS.1770 (LFE eruit via loudness_view), per-kanaal-QC en ITU-downmix-piek; ADM BWF (Atmos-metadata) wordt herkend via axml/chna-chunks in io.probe.
  • dsp/dialogue.py → breath_control / deplosive / duck_music (chain steps); gain envelopes are smoothed with edge padding — plain convolution would drag file edges toward zero.
  • markers.py → region map → Audition marker CSV + Audacity labels + JSON (export_markers).
  • dsp/roomtone.py → room-tone fill: digitale gaten vullen met geshuffelde overlap-add van de eigen ambience (fill_room_tone); qcsheet.py → markdown-QC-rapport (qc_report, batch: qc_folder).
  • dsp/spectral_repair.py → spectral painting (spectral_repair): magnitudes interpoleren uit de context, fase phase-vocoder-coherent voortzetten (bin-centerfrequenties laten mainlobe-bins driften — gemeten dphi gebruiken).
  • duck_music heeft twee modi: beds (segmentniveau, licht) en stems (Demucs-sidechain voor muziek ónder spraak, [stems]-extra).
  • sync.py → 32-sporenrecorder (sync_tracks): envelope-GCC-PHAT + full-rate verfijning, confidence per spoor, klokdrift-meting/-correctie; uitgelijnde wavs + .sesx; A/B-sessie = ongesynct vs gesynct mixdown. Valkuil: strak periodiek materiaal (metronoom) is inherent dubbelzinnig voor correlatie — testsignalen moeten aperiodiek gaten (en recorder-seeds ver van event-seeds, anders ontstaat een echte schijncorrelatie).
  • server.py — 30 MCP tools; sessions.py — session folders under ~/AudioImprove/sessions/ (env AIT_SESSIONS_DIR; tests isolate this automatically). Every session writes timeline.json (segments + treated regions) for the viewer's timeline lane; ids get a -2 suffix on collision.
  • viewer/server.py — stdlib http.server on 127.0.0.1:8471 (env AIT_VIEWER_PORT); viewer/static/app.js — A/B player: both buffers always play together, switching = gain crossfade.

Read the full file on GitHub · 98 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. 4d ago First seen · 98 lines · 1,635 tokens per session scan A 4b351a18029a

Subscribe to this mod's changes

chat-with-audio CLAUDE.md is an instructions file published in the GitHub repository learningtour/chat-with-audio (1 stars, last pushed 1mo ago), licensed MIT. It adds 1,635 tokens to every session, about $0.0082 per session on Opus 5. 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.