[Bug] Byte index out of bounds when loading sessions with Chinese characters
Bug Description
问题的根源是 Claude CLI 二进制程序内部 在加载或渲染会话时,对某个包含中文的字段使用了硬编码的字节切片
[0..17],而 17 正好落在"台"字中间。
这是程序 bug,不是数据问题。你能做的:
临时解决方案
- 用 -c 继续最近会话(绕过加载逻辑):
cd /Users/liujiahao/GolandProjects/interview && claude -c
- 升级 Claude CLI:
npm update -g @anthropic-ai/claude-code
- 如果升级后还有问题,先新建会话,在新会话里让我读取你之前的工作文件来恢复上下文。
向官方报告
这个 bug 需要官方修复。建议去 https://github.com/anthropics/claude-code/issues 提交 issue,附上:
- 错误信息:byte index 17 is not a char boundary; it is inside '台'
- 触发场景:会话中包含中文字符(如"东方财富"、"茅台")
- 版本号:2.1.4
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.4
- Feedback ID: fe336e76-9948-4cc2-b08a-890eef5b728e
Errors
[]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗