[FEATURE] /insights: add --lang / --locale flag for non-English report output

Resolved 💬 2 comments Opened May 22, 2026 by xinbenlv Closed Jul 7, 2026

Summary

Add a language/locale option to the /insights slash command so the generated usage report can be produced in languages other than English (Chinese, Japanese, Spanish, etc.).

Motivation

/insights is one of the most polished slash commands — but the entire output (At a Glance summary, narrative analysis, friction categories, suggestions, horizon prompts, the embedded HTML report) is hard-coded English. For multilingual teams and individual users who prefer non-English output, this means either:

  1. Reading an English report when you'd rather read your native language.
  2. Manually translating the ~1000-line HTML afterward (real friction — I just spent an hour starting this by hand before stopping).
  3. Asking Claude in a follow-up turn to translate, which doubles the token cost.

There's no --lang / --locale flag today, and getPromptForCommand in src/commands/insights.ts only parses --homespaces. The output language is baked into the model prompts used for facet extraction and narrative generation.

Adding \"output in Chinese\" to CLAUDE.md does not help, because the internal queryWithModel calls in insights.ts use asSystemPrompt([]) — an empty system prompt deliberately isolated from CLAUDE.md context.

Proposed API

/insights                  # default: English (current behavior)
/insights --lang zh        # Simplified Chinese
/insights --lang zh-Hant   # Traditional Chinese
/insights --lang ja        # Japanese
/insights --lang es        # Spanish
/insights --lang en        # explicit English

A complementary persistent default would also be welcome:

// ~/.claude/settings.json
{
  \"insights\": { \"language\": \"zh\" }
}

Scope

The language switch should apply to:

  • The At a Glance summary (4 paragraphs)
  • Section headings (\"What You Work On\", \"How You Use Claude Code\", \"Where Things Go Wrong\", etc.)
  • Project area names and descriptions
  • Chart labels (\"Git Operations\", \"Multi Task\", \"Morning (6-12)\", etc.)
  • Narrative / friction / suggestions / horizon prose
  • HTML <title>, button labels (\"Copy\", \"Copy All Checked\"), and the JS-injected \"Copied!\" text

It should not translate:

  • CLAUDE.md additions in the suggested-snippets section (those are written into the user's CLAUDE.md, which has its own language convention).
  • Code samples, command names, file paths.

Implementation sketch

Simplest version: extend getPromptForCommand to parse --lang <code>, thread it through the existing Opus prompts (\"... and write all user-facing text in {{language}}\"). The HTML template can stay English for structural fields; only the model-generated content fields need to flip.

A bit more invasive but cleaner: a small i18n table for the static labels (section headings, chart titles, button text) keyed by locale code, with English as the default.

Workaround today

There isn't a good one. Possible options I considered:

  • Patching the local source — but claude is shipped as a compiled native binary (Mach-O arm64, version 2.1.148 in my install), so source patches don't take effect without an upstream rebuild.
  • A custom skill that runs /insights and then translates the HTML in a follow-on turn — workable but doubles the cost and timing.
  • Manually translating the HTML — possible, but ~1000 lines per report makes it unrealistic on any recurring cadence.

Related

  • #55432 ([BUG] /insights language categorizer silently drops .hack files) — unrelated to this request but the only existing issue mentioning \"language\" in the /insights context.

Thanks for considering — small change, disproportionate value for non-English users who otherwise love the command.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗