CLAUDE_CODE_FORCE_SYNC_OUTPUT

Updated by

CLAUDE_CODE_FORCE_SYNC_OUTPUT is a Claude Code environment variable: Disable streaming output in favor of synchronous writes. If you're capturing Claude Code output in a script and seeing partial lines or buffering artifacts, this forces fully-written output. Also useful in piped workflows where the downstream consumer can't handle a streaming input. Added between v2.1.128 and v2.1.138 and still present in v2.1.294. It is listed in the official reference.

StatusPresent in v2.1.294
AddedAdded between v2.1.128 and v2.1.138
CategoryFeature toggles
Official docsListed

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_CODE_FORCE_SYNC_OUTPUT=<value>
claude

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_FORCE_SYNC_OUTPUT": "<value>"
  }
}

Release notes that mention it

Related variables

Frequently asked questions

What does CLAUDE_CODE_FORCE_SYNC_OUTPUT do?

Disable streaming output in favor of synchronous writes. If you're capturing Claude Code output in a script and seeing partial lines or buffering artifacts, this forces fully-written output. Also useful in piped workflows where the downstream consumer can't handle a streaming input.

Which Claude Code version has CLAUDE_CODE_FORCE_SYNC_OUTPUT?

Added between v2.1.128 and v2.1.138 and still present in v2.1.294.

How do I set CLAUDE_CODE_FORCE_SYNC_OUTPUT?

Export it before starting Claude Code (export CLAUDE_CODE_FORCE_SYNC_OUTPUT=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.

All variables, searchable: Claude Code environment variables.