Directory · Hooks
Claude Code Japanese Guard
A Claude Code Stop hook that detects English-dominant responses and sends them back to be rewritten in Japanese, for Japanese-speaking users.
★ 268 stars · last updated 2026-11-25 · Free, open source · View on GitHub
Best for
- Japanese-speaking developers whose Claude Code replies drift into English
- Enforcing response language when CLAUDE.md instructions are not enough
- Desktop app users who want the wrap_up summary box kept in Japanese
Install
mkdir -p ~/.claude/hooks
curl -fsSL https://raw.githubusercontent.com/minorun365/claude-code-japanese-guard/main/hooks/japanese-guard.py -o ~/.claude/hooks/japanese-guard.py
chmod +x ~/.claude/hooks/japanese-guard.py
Our take
Counts Latin vs Japanese characters in the turn's prose (ignoring code blocks, inline code, URLs, and links) and blocks the stop when Latin exceeds 3x Japanese, retrying at most once per turn. Setup also requires adding entries to hooks.Stop and hooks.PreToolUse (matcher mcp__.*__wrap_up) in ~/.claude/settings.json; thresholds are tunable via environment variables and it can be disabled for claude -p scripts. Pure Python 3 with no dependencies, includes tests and a --check mode for past session transcripts; README is in Japanese.
Similar hooks
- Claude Code Ultimate Guide: Large open guide to Claude Code covering agent workflows, hooks, skills, MCP, security, and team adoption, with reusable templates.
- dcg (Destructive Command Guard): Rust pre-execution hook that blocks destructive shell, git, filesystem, database, and cloud commands run by AI coding agents.
- Claude Code Showcase: Example Claude Code project config with hooks, skills, agents, slash commands, MCP setup, and GitHub Actions workflows to copy from.
- Claude Code Hooks Mastery: Reference project implementing all 13 Claude Code hook events as UV Python scripts, plus sub-agents, status lines, and output styles.
- Continuous Claude v3: Hooks, skills, and agents that keep Claude Code context across sessions via YAML handoffs, ledgers, and a PostgreSQL memory store.
- Build with Claude: Plugin marketplace and discovery hub of agents, commands, hooks, and skills for Claude Code users extending their workflows.