bookend-trim
Picked segments tend to begin or end mid-sentence because pick-segments and
verify-coherence choose by topic, not prosody. This skill nudges each span's
[t0, t1] to the nearest clean sentence boundary so the resulting short feels
like a complete thought.
Invoke
.claude/skills/bookend-trim/bookend-trim.sh <segments.json> <transcript.json> <out.json> [extend=6.0] [dmin=20]
segments: output ofverify-coherence(orpick-segments)transcript: full-source transcript (whisper output withsegments[])out: same shape as input, witht0/t1adjusted and abookend_noteextend: max seconds Claude may push outward in either direction (default 6.0)dmin: min surviving duration; an adjustment that collapses below this is rejected
How
This project's transcribe skill runs whisper.cpp with --max-len 1 --split-on-word, which strips punctuation. So a pure
ends-with-./?/! snap finds nothing and inter-word gaps are also
collapsed. Instead we delegate to Claude:
- For each span, build a context window: every whisper transcript line
(
segments[], each ~5s of speech) within±extendof[t0, t1]. - Ask Claude (single batched
claude -pcall across all spans) to pick a newt0that starts at a sentence start and a newt1that lands on a sentence end. New values must be transcript-line boundaries within the window. - Cache on input mtimes; out-of-window or too-short adjustments are
rejected and the original
[t0, t1]is kept.
Per-span bookend_note records Δt0 / Δt1 and Claude's reason. Pairs
well with tighten-pace downstream, which removes dead air inside the
re-bookended clip.