CLAUDE_CODE_FORCE_SYNC_OUTPUT
Updated by Alex Sorokoletov
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.
| Status | Present in v2.1.294 |
|---|---|
| Added | Added between v2.1.128 and v2.1.138 |
| Category | Feature toggles |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_FORCE_SYNC_OUTPUT=<value>
claudeTo 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
CCR_FORCE_BUNDLECLAUDE_CODE_FORCE_STRIKETHROUGHCLAUDE_CODE_FORCE_WINDOWS_CREDMAN: Forces credential storage through the Windows Credential Manager.CLAUDE_FORCE_DISPLAY_SURVEY: Force feedback survey display.FORCE_HYPERLINKFORCE_PROMPT_CACHING_5MCLAUDE_CODE_DIR_SYNC_DISABLE_ANCHORINGCLAUDE_CODE_DISABLE_DIR_SYNC
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.