{"version":"2.1.314","anchor":"new-env-vars-for-stream-event-hold-time-and-max-line-size","canonical_anchor":"new-env-vars-for-stream-event-hold-time-and-max-line-size","heading":"Two environment variables can batch stream-json output","tier":"use","area":"Headless Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314\/e\/new-env-vars-for-stream-event-hold-time-and-max-line-size","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314","markdown":"### Two environment variables can batch stream-json output\n\n`CLAUDE_CODE_STREAM_EVENT_HOLD_MS` and `CLAUDE_CODE_STREAM_EVENT_MAX_LINE_BYTES` let stream-json output hold and join partial-reply lines\n\n**Unclear.** What each variable does and which values it accepts is only implied by its name.\n\n**What**\n\nTwo new environment variables (settings read from your shell when Claude Code starts) control how Claude Code prints its stream-json output, the line-by-line machine-readable format used when other programs drive Claude Code:\n\n- `CLAUDE_CODE_STREAM_EVENT_HOLD_MS`: when set, the lines carrying pieces of a reply as it is written (`stream_event` deltas) are held for that many milliseconds and joined together before being printed. When it is not set, nothing is held and output works as before.\n\n- `CLAUDE_CODE_STREAM_EVENT_MAX_LINE_BYTES`: sets a size limit for these lines. If it is set to anything other than a whole number of at least 1, the hold is ignored and lines are printed as they arrive.\n\nBoth names were added to the lists of environment variables Claude Code passes on to the processes it runs, next to the other `CLAUDE_CODE_*` tuning variables.\n\n**Why**\n\nIf you run Claude Code from your own program or through the SDK, you can choose to receive fewer, larger output lines instead of one line per small piece of text. Nothing changes unless you set the variables.\n\n- Area: Headless Mode\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}