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.332. It is listed in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| 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_DISABLE_DIR_SYNC: Turns off the background directory-sync worker on a remote session.CLAUDE_CODE_DISABLE_WORKING_SYNC: Set to stop the synced file syncer from starting in remote sessions; read until v2.1.310.CLAUDE_CODE_DISABLE_WORKING_SYNC_WATCH: On Linux, set to disable the working-sync file watcher; without it the watcher is used.CLAUDE_CODE_FORCE_FIRST_LAUNCH: Forces the first-launch flow; the value is used as a pretend last-seen marker so first-run behavior replays.CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM: Set to force mid-conversation system messages on, overriding the per-model and server-flag decision.CLAUDE_CODE_FORCE_RC_LONG_TURN_NUDGE: Set to force the long-turn nudge that suggests continuing the session on your phone, with a 5-second threshold, shown every time and no impression cap.CLAUDE_CODE_FORCE_STRIKETHROUGH
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.332.
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.