claude/for
Search
Subscribe
Claude Code

How do I set `CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION` in Claude Code?

Claude Code 2.1.331 (November 23, 2026) adds CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION: set it to 1 if your proxy cuts off compressed replies.

CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION is an environment variable added in Claude Code 2.1.331, released November 23, 2026. Set it to 1 and Claude Code asks for uncompressed model responses, which is meant for a proxy that leaves compressed ones unfinished. Put it in your shell or your user settings, because Anthropic's docs say it is ignored in project and local settings.

claude/for is independent and not affiliated with Anthropic. As of November 29, 2026 we read the docs below, and we did not run this variable ourselves.

TL;DR: export CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION=1 before you launch claude, on version 2.1.331 or later, and only if a proxy cuts replies off. Skip it for self-hosted runners and Remote Control, and do not rely on a project settings file.

What the variable does

The Claude Code changelog entry for 2.1.331 reads, word for word:

Added CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION to ask for uncompressed model responses behind a proxy that cuts compressed ones off; not advised yet for self-hosted runners or Remote Control

The environment variables reference has a row for it. Five facts from that row:

  • You set it to 1 to request uncompressed model responses.
  • It targets a proxy that "leaves compressed ones unfinished".
  • "Not recommended for self-hosted runners or Remote Control."
  • "Ignored in project and local settings."
  • "Requires Claude Code v2.1.331 or later"

In plain terms: compression shrinks a reply while it travels to your computer. Some proxies mishandle that and stop the reply partway. This variable asks for the plain version instead. The row names no error message, so it does not tell you what a failing session looks like.

How to set it

now

Check your version

The env-vars row says Claude Code v2.1.331 or later. Run claude --version and update first if you are below that.

next

Choose where to set it

Your shell, or the env block of ~/.claude/settings.json. Not a file inside the project.

next

Restart Claude Code

Anthropic says variables exported in your shell are read once at startup, so an open session will not notice the change.

next

Repeat the task that stalled

Use the same prompt that stopped partway, so you compare like with like.

In a shell, before you launch claude:

export CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION=1
claude

In ~/.claude/settings.json, through the env block:

{
  "env": {
    "CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION": "1"
  }
}

Anthropic's network configuration page says "All environment variables shown on this page can also be configured in settings.json". The compression variable sits on the env-vars page instead, so using the env block for it is our reading of the docs, not a line we found about this variable.

Do not commit it. A .claude/settings.json or .claude/settings.local.json inside a repository is exactly where the docs say this variable is ignored. It will look set and do nothing.

The Claude moves worth stealing, by email

Workflows tested on real jobs, sent only when they are worth it. Free.

Where it works and where it does not

Anthropic's settings page lists four places Claude Code reads settings: user (~/.claude/settings.json), shared project (.claude/settings.json), project local (.claude/settings.local.json) and managed.

The env-vars row rules out the two project files. That leaves your shell, your user file and, for an organization, managed settings. Our managed settings guide shows how that tier works for another key. We did not find a line saying whether this variable is honored there, so check with /status before you roll it out.

When to use it, and when to leave it alone

Reach for it only when a proxy is the suspect: replies stop partway while a direct connection works. Do not set it as a general tuning knob, because nothing in the docs says it makes Claude Code faster or better.

Leave it off for self-hosted runners and Remote Control, where the docs do not recommend it. A near neighbor is easy to confuse with it, since the two work in opposite directions:

CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSIONAsks for uncompressed model responses coming back to you. Set to 1.
CLAUDE_CODE_GZIP_REQUEST_BODIESControls gzip on request bodies sent to api.anthropic.com. Set to 0 to turn it off.

The env-vars row for the second one says to use 0 "if a TLS-inspecting proxy that Claude Code can't detect mishandles compressed requests". If your proxy breaks what you send rather than what you receive, that is the variable to read about.

If the whole app fails to connect, not just long replies, start with Couldn't connect to Claude. It covers the chat apps, and it points to the same network page for work networks.

How to check it

Two checks come from the network page, and neither confirms this variable directly:

  • /status has a Proxy row that "shows the active proxy URL, and marks a value it can't parse as invalid and ignored". Use it to confirm Claude Code sees your proxy at all.
  • Start Claude Code with claude --debug. The page shows lines for certificates and client keys, not for this variable.

The honest test is behavioral. Run the task that used to stall, and see whether it finishes.

Honest limits

  • We did not run the variable. We have no proxy that cuts compressed replies, so we cannot show a before and after.
  • The docs give no error message tied to it. If your reply broke off for another reason, it will not help. Claude "response incomplete" covers the usual chat-side causes.
  • It needs a person with access to your proxy to confirm the proxy is the cause. We cannot diagnose that from the outside.
  • Plan usage limits are a separate topic, covered in our rate limits guide.

Questions people ask

What does CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION do?

It asks Claude Code to request uncompressed model responses when set to 1. Anthropic's env-vars page says it is for a proxy that "leaves compressed ones unfinished". It first appeared in Claude Code 2.1.331 on November 23, 2026.

Can I put CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION in .claude/settings.json?

You can write it there, but it will not take effect. The env-vars row says "Ignored in project and local settings". Use your shell or ~/.claude/settings.json instead, or managed settings if your organization deploys them.

Is it the same as turning off gzip for requests?

No. CLAUDE_CODE_GZIP_REQUEST_BODIES=0 turns off gzip on request bodies sent to api.anthropic.com. The response variable concerns what comes back. They address different failures, and one does not replace the other.

Which Claude Code version do I need?

Version 2.1.331 or later. The env-vars row says "Requires Claude Code v2.1.331 or later", and the changelog dates that release to November 23, 2026. Update before you set the variable.

If you want a short note when Claude Code changes how it talks to your network, the newsletter sends one.

Sources (checked November 29, 2026)

Related: Claude Code 2.1.310 notes · Overloaded retry delay

The Claude moves worth stealing, by email

Workflows tested on real jobs, sent only when they are worth it. Free.