fileSuggestion command not invoked when typing non-ASCII (CJK) characters in @ autocomplete

Resolved 💬 4 comments Opened Feb 7, 2026 by RealmX1 Closed Mar 8, 2026

Bug Description

The fileSuggestion custom command configured in .claude/settings.json is not invoked when the user types non-ASCII characters (e.g., Chinese/Japanese/Korean) in the @ autocomplete input. English/ASCII input works correctly.

Steps to Reproduce

  1. Configure a fileSuggestion command in .claude/settings.json:

``json
{
"commands": {
"fileSuggestion": {
"command": "bash .claude/scripts/file-suggestion.sh"
}
}
}
``

  1. Add debug logging to the script:

``bash
RAW_INPUT=$(cat /dev/stdin)
echo "$RAW_INPUT" >> /tmp/file-suggestion-debug.log
``

  1. In Claude Code, type @ to trigger autocomplete, then type English text (e.g., sh or patt).
  • Result: Script is invoked. Debug log shows entries like {"query":"sh"}.
  1. Type @ again, then type Chinese text (e.g., 睡眠).
  • Result: Script is never invoked. No new entries appear in the debug log.

Evidence from Debug Log

# English queries - script is called:
{"query":"sh"}
QUERY=[sh] LANG=[en_US.UTF-8] LC_ALL=[en_US.UTF-8]
{"query":"patt"}
QUERY=[patt] LANG=[en_US.UTF-8] LC_ALL=[en_US.UTF-8]

# Chinese queries - NO entries at all (script never called)

The script itself handles CJK characters correctly when invoked directly from bash:

$ echo '{"query":"睡眠"}' | bash .claude/scripts/file-suggestion.sh
Lumi-supabase/docs/进行中/基于科学研究的个性化睡眠建议框架.md

Expected Behavior

The fileSuggestion command should be invoked for all typed characters, including CJK/non-ASCII input, so that custom file search scripts can handle them.

Actual Behavior

The fileSuggestion command is only invoked when ASCII characters are typed. When using an IME to input CJK characters, the command is never called.

Environment

  • OS: macOS (Darwin 24.x, Apple Silicon)
  • Claude Code version: Latest (as of 2025-06)
  • Input method: macOS built-in Chinese (Simplified) IME
  • Shell: bash/zsh
  • Locale: LC_ALL=en_US.UTF-8

Impact

Projects with CJK filenames or documentation cannot be searched via @ autocomplete when users type in their native language. This affects any non-ASCII locale (Chinese, Japanese, Korean, etc.).

Workaround

We've implemented pinyin-based search in our custom fileSuggestion script as a workaround. Users can type pinyin (romanized Chinese) to find CJK-named files:

# Example: typing "shuimian" finds files containing "睡眠"
@shuimian → Lumi-supabase/docs/进行中/基于科学研究的个性化睡眠建议框架.md

# Example: typing "gouhuo" finds files containing "篝火"
@gouhuo → matching files with 篝火 in path

Requirements: pip install pypinyin

How it works: The script has a 3-tier matching strategy:

  1. Substring exact match (case-insensitive)
  2. Pinyin substring match — converts CJK characters in file paths to pinyin, then matches against the ASCII query
  3. fzf fuzzy match (fallback)

Results are sorted by filename match priority (query found in basename ranks higher than directory-only match) and most recently modified first within each group.

This makes CJK file search usable via ASCII input, though native IME support from Claude Code would still be the ideal fix.

View original on GitHub ↗

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