CLAUDE_CODE_MAIN_REPLY_HOLD_MS
Updated by Alex Sorokoletov
CLAUDE_CODE_MAIN_REPLY_HOLD_MS is a Claude Code environment variable: Number of milliseconds to hold back the main reply stream before handing pieces on; applies only when the relevant transport is active and defaults to 0. Added in v2.1.318 and still present in v2.1.318. It is not in the official reference.
| Status | Present in v2.1.318 |
|---|---|
| Added | Added in v2.1.318 |
| Category | Other |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_MAIN_REPLY_HOLD_MS=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_MAIN_REPLY_HOLD_MS": "<value>"
}
}Related variables
CLAUDE_CODE_UNWATCHED_REPLY_HOLD_MS: Number of milliseconds to hold streamed replies for unwatched contexts (subagent, auxiliary, compaction); defaults to 0, meaning no hold.CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT: Reported a parked turn at initialization, but only when CLAUDE_CODE_RESUME_INTERRUPTED_TURN was also set; read until v2.1.309.CLAUDE_CODE_REPLY_GATE_POLICY: Carries a reply-gate policy into agent-loop sessions: a list of terminal tools and caps on how many times Claude asks after a person's message, after its own task or a server event, and otherwise.ANTHROPIC_BETAS: Comma-separated beta feature headers.ANTHROPIC_CUSTOM_HEADERS: Custom HTTP headers (newline-separated Key: Value).ANTHROPIC_FEDERATION_RULE_IDANTHROPIC_ORGANIZATION_IDANTHROPIC_WORKSPACE_ID
Frequently asked questions
What does CLAUDE_CODE_MAIN_REPLY_HOLD_MS do?
Number of milliseconds to hold back the main reply stream before handing pieces on; applies only when the relevant transport is active and defaults to 0.
Which Claude Code version has CLAUDE_CODE_MAIN_REPLY_HOLD_MS?
Added in v2.1.318 and still present in v2.1.318.
How do I set CLAUDE_CODE_MAIN_REPLY_HOLD_MS?
Export it before starting Claude Code (export CLAUDE_CODE_MAIN_REPLY_HOLD_MS=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.