`add-ja-subs`: The Claude Code Skill That Turns a Video Into a Japanese Subtitle Factory

A local-first pipeline for transcription, translation, and burn-in subtitles, with the agent doing the editorial work where it matters most.

8 min read • View on GitHub • More from kzhrknt

A workbench-style post-production scene where a video file moves through a local machine for transcription and encoding while a hand edits subtitle sheets beside it. The composition explains that heavy media work stays local, while Claude handles the editorial judgment layer.
The project’s real trick is not translation. It is deciding which parts of subtitling need a model and which parts do not.
Key Takeaways

Subtitle Generation, Reimagined as an Agent Workflow

Most subtitle tools optimize for one task: get text from audio, then translate it. add-ja-subs does something more interesting. It turns Claude Code into the operator of a small media pipeline, where transcription, translation, burn-in, and verification are coordinated like a production line.

That distinction matters. The repo is not trying to replace every stage with a model. It keeps the heavy lifting local, then uses Claude where human judgment would normally sit, cleaning transcript errors, enforcing line length, and checking the finished render.

Why This Pipeline Is Mostly Local

The economics are the first clue that this project is carefully designed. Audio extraction and encoding are done on the machine. The model sees text, not raw video, which keeps token use low and the workflow practical for long clips.

Workflow layerTraditional subtitle serviceadd-ja-subs
Audio and encodingCloud handled or hidden behind a web appLocal via ffmpeg and scripts
TranscriptionCloud API or SaaS pipelineLocal ASR with hardware-aware model selection
TranslationDirect API callClaude Code instruction pass with subtitle rules
Editing and cleanupManual fix-up after exportBuilt into the agent workflow
Quality controlOften eyeballed by the userExplicit visual frame check after render

The pipeline is split on purpose. Local scripts do the repeatable work, and Claude handles the editorial decisions that benefit from language understanding.

Inside SKILL.md: The Brain of the System

The smartest part of the repo is also the least flashy. The core logic lives in SKILL.md, which tells the agent what to do, in what order, and under which constraints. In other words, the system is not hardcoded around a single app flow. It is encoded as instructions for a general-purpose operator.

1. Check dependencies.
2. Run setup.sh.
3. Extract audio from the source video.
4. Transcribe locally.
5. Translate with subtitle constraints.
6. Run QC on the render.

That skill layer is the real product shape. Scripts do the deterministic work. The skill tells Claude how to behave. The result is a hybrid system that looks simple from the outside, but is actually a carefully staged collaboration between automation and editorial reasoning.

The Subtitle Editor, Not Just the Translator

This is where the repo stops being a translation helper and starts acting like a professional subtitle tool. The agent is told to fix ASR mistakes, split long segments, obey line-length constraints, and adjust tone based on the kind of video it is working on.

A close view of a subtitle timeline showing one rough transcript on the left and a cleaned Japanese subtitle block on the right. The image explains how the workflow edits timing, line breaks, and wording instead of only translating raw text.
The agent is not just translating. It is editing subtitles as if it were a careful human reviewer.

That editorial layer is the differentiator. A subtitle tool that only converts speech to text is useful. A tool that enforces legibility, pacing, and tone is much closer to the way a subtitle editor actually works.

How the Repo Handles Whisper’s Failure Modes

The transcription script does not assume ASR will behave. It includes a simple hallucination heuristic that flags segments where Whisper repeats words too aggressively, which is a common failure mode in silence or music-heavy sections.

def looks_hallucinated(words):
    return len(words) >= 8 and len(set(words)) <= 2

That is a small piece of logic with outsized value. It is a reminder that reliability often comes from a good filter, not just a bigger model. The repo also switches between mlx-whisper on Apple Silicon and faster-whisper elsewhere, which makes the pipeline hardware-aware without making it brittle.

The Final Guardrail: Visual QC

The last step is what makes the whole system feel serious. After rendering, the agent extracts frames and inspects them for overflow, garbling, and layout problems. That closes the loop between generation and verification.

What This Repo Suggests About Claude Code Skills

The larger lesson is bigger than subtitles. This repo shows a useful pattern for agent-native software: keep the local scripts small and explicit, give the model a narrow editorial role, and add a verification step before the result ships.

PatternWhy it worksWhat it suggests
Skills plus scriptsInstructions and execution stay separateAgent workflows can be composable software
Local-first computeAudio and video stay on the machineModels do not need to touch every expensive asset
Editorial model useThe LLM handles judgment, not brute forceThe best use of AI may be a narrow one
Visual QCRendered output gets inspected before completionAutomation gets more trustworthy when it can check itself