{"version":"2.1.317","anchor":"plain-delta-take-at-source-env-var-for-headless-output","canonical_anchor":"plain-delta-take-at-source-env-var-for-headless-output","heading":"Headless mode can write streamed text out as soon as it arrives","tier":"notice","area":"Headless Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317\/e\/plain-delta-take-at-source-env-var-for-headless-output","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317","markdown":"### Headless mode can write streamed text out as soon as it arrives\n\nHeadless and SDK runs gain a step that writes each piece of streamed text immediately, plus a new CLAUDE_CODE_PLAIN_DELTA_TAKE_AT_SOURCE variable\n\n**Unclear.** It is not clear whether setting CLAUDE_CODE_PLAIN_DELTA_TAKE_AT_SOURCE changes how text is streamed or is only recorded in the report.\n\n**What**\n\nIn headless mode (running Claude Code without its interactive screen, for example from a script or through the Agent SDK), Claude Code streams its answer as small pieces of plain text. These pieces used to go out only through Claude Code's usual event path. A new step can now write each piece out immediately.\n\nA new environment variable, `CLAUDE_CODE_PLAIN_DELTA_TAKE_AT_SOURCE`, is part of this setup. An environment variable is a named value you set in your shell before starting a program. The end-of-run report now also counts how many text pieces were written immediately and how many were taken at their source.\n\n**Why**\n\nPrograms that read Claude Code's streamed output may receive text sooner.\n\n- Area: Headless Mode\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}