[BUG] `/clear` command injects non json-lines data in streaming usage
Resolved 💬 3 comments Opened Aug 24, 2025 by meawoppl Closed Dec 12, 2025
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: <!-- specify -->
- Claude CLI version: <!-- output of
claude --version--> - 1.0.89 (Claude Code)
- Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
Ubuntu 24.04.2 LTS
- Terminal: <!-- e.g. iTerm2, Terminal App -->
Bug Description
<!-- A clear and concise description of the bug -->
When running claude code in json streaming mode (SDK styled usage), if you issue the /clear command, some non-json data will get injected into the standard output (\^[[2J\^[[3J\^[[H) Perhaps intended to clear the screen in interactive mode?
Steps to Reproduce
- <!-- First step -->
- <!-- Second step -->
- <!-- And so on... -->
Expected Behavior
<!-- What you expected to happen -->
Actual Behavior
<!-- What actually happened -->
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗