set-language

set-language is a command for Claude Code from Claudate/project-multilevel-index. It costs 0 tokens per session (1,361 once invoked), scanned A, original, MIT.

A command for switching the language used by a project's multi-level index system between Simplified Chinese and English. It writes the language setting and checks that the needed translation files exist.

In plain words
What is it for?
Use it to choose the index system's interface language, create or update its locale configuration, and verify the required language files.
Why use it?
It lets the index system show messages and generated documentation in the preferred language. It also warns when the selected translation is incomplete and falls back to Chinese.

Command for Claude Code

Part of the project-multilevel-index plugin — 1 skill, 4 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/claudate/project-multilevel-index/set-language
Clone the repo
git clone --depth 1 https://github.com/Claudate/project-multilevel-index

Made for: Claude Code.

Or install project-multilevel-index, the plugin that ships this one along with the rest of its 1 skill, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for set-language

README.md
[![agentmods](https://agentmods.dev/badge/commands/claudate/project-multilevel-index/set-language.svg)](https://agentmods.dev/commands/claudate/project-multilevel-index/set-language)
Your own site
<a href="https://agentmods.dev/commands/claudate/project-multilevel-index/set-language"><img src="https://agentmods.dev/badge/commands/claudate/project-multilevel-index/set-language.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,361 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01361
Opus 5 $0.00000 $0.00681
Sonnet 5 $0.00000 $0.00272
Haiku 4.5 $0.00000 $0.00136

Measured 5d ago against content hash 4476832eaa02, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

set-language scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude-plugin/commands/set-language.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

命令: /set-language - 切换语言

🎯 使用场景

快速切换索引系统的界面语言(中文 ↔ 英文)。


📋 执行步骤

步骤 1: 询问用户选择语言

显示双语提示:

Choose your language / 选择语言:

1. 简体中文 (zh-CN)
2. English (en-US)

Please enter 1 or 2 / 请输入 1 或 2:

步骤 2: 验证选择

根据用户输入:

  • 1 → 设置为 zh-CN
  • 2 → 设置为 en-US
  • 其他 → 提示错误,重新询问

步骤 3: 创建/更新配置文件

配置文件路径: .claude/locale-config.json

配置内容:

{
  "language": "{用户选择}",
  "fallback": "zh-CN",
  "description": "项目多级索引系统语言配置 / Language configuration for project multi-level index system",
  "availableLanguages": ["zh-CN", "en-US"]
}

操作步骤:

  1. 检查 .claude/ 目录是否存在
    • 不存在 → 使用 Bash 工具创建: mkdir -p .claude
  2. 使用 Write 工具创建或覆盖 locale-config.json

步骤 4: 验证语言文件

检查对应语言文件是否存在:

必需文件:

locales/{language}/messages.json
locales/{language}/skill.json
locales/{language}/templates.json
locales/{language}/hooks.json

使用 Read 工具尝试读取,如果任一文件缺失:

⚠️ 警告: 语言文件不完整
缺失文件: locales/{language}/messages.json

索引系统将使用备用语言 (zh-CN)

步骤 5: 确认切换成功

成功消息(中文选择):

✅ 语言已切换为简体中文 (zh-CN)

配置文件已创建: .claude/locale-config.json

下次运行 /init-index, /update-index 或 /check-index 时将使用中文界面。

成功消息(英文选择):

✅ Language switched to English (en-US)

Configuration file created: .claude/locale-config.json

Next time you run /init-index, /update-index, or /check-index, the English interface will be used.

🔄 切换方式对比

方式 优点 缺点 适用场景
/set-language 命令 快速、交互式 需手动执行 偶尔切换
手动编辑配置文件 灵活、可批量 需了解JSON格式 高级用户
环境变量 CLAUDE_LOCALE 全局生效 需配置环境 CI/CD
初始化时询问 首次友好 只在初始化时 新项目

📝 配置文件示例

切换到英文

{
  "language": "en-US",
  "fallback": "zh-CN"
}

切换到中文(默认)

{
  "language": "zh-CN",
  "fallback": "zh-CN"
}

🌍 支持的语言

当前支持:

  • zh-CN: 简体中文(默认)
  • en-US: 美国英语

未来扩展(预留):

  • ja-JP: 日语
  • ko-KR: 韩语
  • de-DE: 德语
  • fr-FR: 法语

🔧 环境变量方式

如果用户更喜欢使用环境变量:

Linux/macOS

# 临时设置
export CLAUDE_LOCALE=en-US

# 永久设置(添加到 ~/.bashrc 或 ~/.zshrc)
echo 'export CLAUDE_LOCALE=en-US' >> ~/.bashrc

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 236 lines · 0 tokens per session scan A 4476832eaa02

Subscribe to this mod's changes

set-language is a command published in the GitHub repository Claudate/project-multilevel-index (139 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,361 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.