[BUG] the teleport feature doesn't properly handle multi-byte UTF-8 characters in session context.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running claude --teleport <session_id> to resume a session, the CLI panics with a byte index boundary error during the "Checking out branch" step. The error indicates an attempt to slice a UTF-8 string at an invalid boundary (byte index 21, which falls inside a multi-byte Chinese character).
What Should Happen?
The --teleport command should successfully restore the session and check out the associated branch without crashing, even when the session contains non-ASCII characters (e.g., Chinese text in commit messages or branch descriptions).
Error Messages/Logs
claude --teleport session_01AsCge2trSdJiYokqip****
◑ Teleporting session…
session_01AsCge2trSdJiYokqip****
✔ Validating session
✔ Fetching session logs
✔ Getting branch info
◑ Checking out branch
thread '<unnamed>' (418382) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 21 is not a char boundary; it is inside ')' (bytes 19..22) of `實作 FilamentUser)`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
[1] 32218 abort claude --teleport session_01AsCge2trSdJiYokqip****
Steps to Reproduce
Simply execute claude --teleport session_01AsCge2trSdJiYokqip**** again
(The **** is mask by me because I don't think this should be published on the Internet)
<img width="627" height="371" alt="Image" src="https://github.com/user-attachments/assets/74b2a130-d196-4f8e-b8e4-4a8da90f6a5e" />
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.72
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal I used is PHPStorm Terminal
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗