
What happened
A Zenn post shares an install script that adds a Stop hook to Claude Code; it reads last_assistant_message, strips code blocks, inline code, links and URLs, then flags a reply as English when Latin letters reach 40 and kana fall below 10% of them.
Why it matters
The hook gives users a way to automatically bounce a reply back for rewriting instead of manually prompting again, according to the post's test showing a flagged message exits with code 2.
Summaries like this, every morning.
By signing up you agree to the Terms of Service and Privacy Policy.
The post addresses a common friction point for Japanese-speaking users of Claude Code: the assistant sometimes replies in English, forcing a manual re-prompt. The hook automates that correction by running after each response and checking the last_assistant_message field.
The detection logic deliberately ignores code, links and URLs so that technical content does not skew the language judgment. With thresholds set at 40 Latin characters and a 10% kana ratio, short replies like "Done." are excluded, while Japanese sentences with English identifiers still pass because kana particles remain present.
The post also provides a test command showing a flagged reply exits with code 2 and surfaces the rewrite instruction, plus an uninstall script for clean removal.
Pick your industry and the AI tools you use, and get news related to your work every day.
By signing up you agree to the Terms of Service and Privacy Policy.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
At AWS re:Invent 2026, AWS announced Project C2, where an AI agent writes Lean proofs of what code should do…

At re:Invent 2026, AWS announced Project Code Confidence, which pairs LLMs with the Lean theorem prover to wri…
A Claude Code-written piece said unmanned-agent article drafts kept failing for "nearly a week"; lining up the…

Across 10 apps built with Claude Code (Sonnet 5.5), adding a single security instruction changed nothing in th…

The developer says coding is handed to worker AI agents, while the human moves cards on the kanban and answers…

A practitioner describes using Claude, Codex, Kiro and several other AI tools side by side, choosing which too…
