Claude code zh
把 Claude Code 汉化 —— 让 Claude 默认用中文回复,并给每个工具调用加中文 tooltip 提示。当用户想"汉化 Claude Code""让 Claude 说中文""装中文命令提示""localize Claude Code to Chinese"时使用。From its SKILL.md
npx -y skills add YuAICode/ai-skills --skill claude-code-zhAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 5 commands, including `bash install.sh` and 4 more.
SKILL.md
2.8 KB, 942 tokens by cl100k_base, as published. Nobody here has run it
claude-code-zh —— Claude Code 中文化
能做什么 / 做不到什么
| 层级 | 能不能 | 说明 |
|---|---|---|
| ① AI 全程中文回复 | ✅ | 写一段指令到 ~/.claude/CLAUDE.md,所有 session 永久生效 |
| ② 命令中文 tooltip | ✅ | PostToolUse hook,跑命令后弹中文解释,不碰 Claude 本体 |
| ③ 中文状态栏(statusline) | ✅ | 自前轻量 bash 脚本,经 settings.json 的 statusLine 输出「模型名 / 目录 / git 分支 / 上下文用量」。上下文段带进度条+颜色(<70 绿 / 70-84 黄 / ≥85 红+⚠ /compact)。默认不启用,ccstatus on 开启。 |
④ 界面 chrome(菜单//config 面板) | ❌ | Claude Code v2.1.113+ 已是编译二进制,无 cli.js,字符串替换汉化方案全部失效。别尝试改二进制(会破坏代码签名 + 升级即失效)。 |
如何使用
一键安装
bash install.sh
- 把中文回复指令写进
~/.claude/CLAUDE.md(用<!-- claude-code-zh:begin/end -->标记包裹,可逆) - 安装
tool-tips-post.sh到~/.claude/hooks/ - 用 python3 幂等地把 PostToolUse hook 写进
~/.claude/settings.json(安装前自动备份为settings.json.zh.bak)
安装后重启 Claude Code,tooltip 才会加载;中文回复指令下个 session 全局生效。
中文状态栏(可选)
ccstatus on # 开启:底部显示 🌸 🤖 模型 │ 📁 目录 │ 🌿 分支 │ ctx ▓▓▓░░ 72% /200k
ccstatus off # 关闭(还原你原来的 statusLine)
ccstatus status # 查看当前状态
默认不启用;开启会备份你已有的 statusLine,关闭时还原。改动 settings.json 后需重启 Claude Code 生效。
卸载
bash uninstall.sh
干净移除四处改动(CLAUDE.md 区块、settings.json 条目、hook 脚本、statusline/ccstatus 脚本及别名)。statusLine 若被 ccstatus 开过会先还原再删。
工作原理
- 中文回复:靠
CLAUDE.md指令引导模型语言,不改任何二进制,零风险。 - tooltip:
tool-tips-post.sh从 stdin 读工具调用 JSON,识别 Bash/Read/Write/Edit/Grep/MCP 等,输出{"systemMessage":"🌸 ... 🌸"},Claude Code 把它显示给用户。脚本只打印,不写文件、不联网、不执行下载内容,exit 0。
自定义
- 嫌 tooltip 太吵:把
settings.json里该 hook 的"matcher": ""改成"matcher": "Bash"(只在跑命令时提示)。 - 改/加命令翻译:编辑
~/.claude/hooks/tool-tips-post.sh里的desc_shell函数。
What ships with it: 10 files
34.8 KB alongside SKILL.md, 7 of them executable
bin/
- ccstatus.shruns2.8 KB
- statusline.shruns3.2 KB
- tooltip.shruns2.6 KB
hooks/
- tool-tips-post.shruns5.3 KB
tests/
- run.shruns7.7 KB
- .gitignore34 B
- install.shruns4.9 KB
- LICENSE1.0 KB
- README.md3.8 KB
- uninstall.shruns3.3 KB