[BUG] terminal window size issue or rendering calculation bug
Resolved 💬 4 comments Opened Apr 3, 2026 by LeonDeligny Closed May 12, 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?
Randomly, sometimes claude shows this error and exits:
ERROR Invalid count value: -3
- at String.repeat
(<anonymous>)
-YO7
(file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/c
laude-code/cli.js:8066:207)
-E_ (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:20985)
-Hw (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:39521)
-tk (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:50211)
-jX6 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8686
8)
-H38 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8583
1)
-O96 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8565
2)
-w38 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8240
2)
-b6 (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:6356)
I did not modify the terminal's size when the error happened.
What Should Happen?
Claude should simply not fail this way, and erase all logs and prompts before hand.
I lost all conversation log + prompts.
Error Messages/Logs
ERROR Invalid count value: -3
- at String.repeat
(<anonymous>)
-YO7
(file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/c
laude-code/cli.js:8066:207)
-E_ (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:20985)
-Hw (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:39521)
-tk (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:50211)
-jX6 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8686
8)
-H38 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8583
1)
-O96 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8565
2)
-w38 (file:///opt/homebrew/lib/
node_modules/@anthropic-ai/
claude-code/cli.js:554:8240
2)
-b6 (file:///opt/homebrew/lib/n
ode_modules/@anthropic-ai/cl
aude-code/cli.js:554:6356)
Steps to Reproduce
I do not know, but it is the 3d time it happened to me while I was not interacting at all with the cli.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.91
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
I can not even go back look at the prompt i ran and the previous Claude log messages.
It is as if he did /clear and then displays the ERROR Invalid count value: -3 error.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗