[BUG] OSC 0 code bleed with bunx and --print
Resolved 💬 3 comments Opened Oct 3, 2025 by CaddyGlow Closed Jan 7, 2026
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?
OSC 0 code used to set icon name and window title is bleeding into stdout when using bunx and try to set "claude-code" and running with bunx and --print claude argument.
What Should Happen?
Return the LLM result without injecting the OSC code
Error Messages/Logs
Steps to Reproduce
$ bunx @anthropic-ai/claude-code --print 'you must respond with a random word in a json without code fence { "word":"someword"}' | xxd
00000000: 1b5d 303b 636c 6175 6465 2d63 6f64 6507 .]0;claude-code.
00000010: 7b22 776f 7264 223a 2022 7465 6c65 7363 {"word": "telesc
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.5
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Environment:
- Claude: 2.0.5
- Bun: 1.2.22
- Node: v22.19.0
Terminals tested:
- kitty: 0.42.2
- wezterm: 0-unstable-2025-08-14
Command to reproduce the bug with bun 1.2.22:
$ bunx @anthropic-ai/claude-code --print 'you must respond with a random word in a json without code fence { "word":"someword"}' | xxd
00000000: 1b5d 303b 636c 6175 6465 2d63 6f64 6507 .]0;claude-code.
00000010: 7b22 776f 7264 223a 2022 7465 6c65 7363 {"word": "telesc
For comparison output:
$ which claude
/home/rick/.cache/.bun/bin/claude
$ claude -v
2.0.5 (Claude Code)
$ claude --print 'you must respond with a random word in a json without code fence { "word":"someword"}' | tee 1>&2 | tee >(xxd | head -n2) | jq .word
{"word": "telescope"}
"telescope"
00000000: 7b22 776f 7264 223a 2022 7465 6c65 7363 {"word": "telesc
00000010: 6f70 6522 7d0a ope"}.
$ bunx --version
1.2.22
$ bunx @anthropic-ai/claude-code --print 'you must respond with a random word in a json without code fence { "word":"someword"}' | tee 1>&2 | tee >(xxd | head -n2) | jq .word
{"word": "telescope"}
jq: parse error: Invalid numeric literal at line 1, column 2
00000000: 1b5d 303b 636c 6175 6465 2d63 6f64 6507 .]0;claude-code.
00000010: 7b22 776f 7264 223a 2022 7465 6c65 7363 {"word": "telesc
$ npx --version
10.9.3
$ npx @anthropic-ai/claude-code --print 'you must respond with a random word in a json without code fence { "word":"someword"}' | tee 1>&2 | tee >(xxd | head -n2) | jq .word
{"word": "telescope"}
"telescope"
00000000: 7b22 776f 7264 223a 2022 7465 6c65 7363 {"word": "telesc
00000010: 6f70 6522 7d0a ope"}.This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗