[BUG] zlibError decompression failures on session start and command execution
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?
Image
Bug Description
i am using claude code with litellm and i keep getting decompression error: ZlibError but claude code works but it spams my ui with this error, i can avoid the issue by using alias claude ='claude 2> /dev/null' but i hope there can be a better fix for this. i am using the native build of claude code.. the old js version does not have this issue and if i use claude --debug it does not give my any indication of why the error is happening
Environment Info
Platform: darwin
Terminal: WarpTerminal
Version: 2.1.107
Feedback ID: ebf2a7c7-86d6-4c89-bce2-dc852fc25a94
https://github.com/anthropics/claude-code/issues/20199
https://github.com/anthropics/claude-code/issues/18302
What Should Happen?
no ZlibError spam in terminal/ghostty
Error Messages/Logs
osalloum
on Feb 7 · edited by osalloum
Author
I think that this bug is related to non streaming api calls which claude code does , when one of those fails, we get spammed with zlib error
Claude code does a lot of misc calls to generate custom titles , check token sizes, etc
I fixed the core issues in litellm but in the meanwhile if the specific issue you are facing is not impacting your core experience , you can just pipe error output to /dev/null
claude 2> /dev/null
ernestkoe
on Mar 7
Claude and I have a theory on what's happening:
HTTP MCP transport is sending compressed gzip that the client isn't handling.
The SDK uses fetch directly — it doesn't set Accept-Encoding, but Bun's fetch might auto-negotiate gzip. The issue is likely that the SSE event stream is being compressed by the server but the SDK's SSE parser can't handle it. The fix is to tell the server not to compress by adding Accept-Encoding: identity to the request headers:
Steps to Reproduce
just start claude in terminal (any terminal). Wait.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.105
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗