CLAUDE_ENABLE_BYTE_WATCHDOG
Updated by Alex Sorokoletov
CLAUDE_ENABLE_BYTE_WATCHDOG is a Claude Code environment variable: Activates a byte-level watchdog on API response streams. The v2.1.105 changelog describes a fix for stalled API streams: "streams now abort after 5 minutes of no data and retry non-streaming instead of hanging indefinitely." This variable likely gates that behavior — when enabled, the runtime monitors incoming byte…. Added between v2.1.104 and v2.1.107 and still present in v2.1.310. It is listed in the official reference.
| Status | Present in v2.1.310 |
|---|---|
| Added | Added between v2.1.104 and v2.1.107 |
| Category | Network and proxy |
| Official docs | Listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_ENABLE_BYTE_WATCHDOG=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_ENABLE_BYTE_WATCHDOG": "<value>"
}
}Release notes that mention it
- Claude Code v2.1.107 — 6 New Environment Variables: Worktrees, Away Mode, and Stream Resilience
- Claude Code Version Tracker: Undocumented Env Vars, Feature Gates & Models
Related variables
CLAUDE_ENABLE_STREAM_WATCHDOG: Enable stream health monitoring.CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MSCLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING: Enable fine-grained (eager) input streaming for tools.CLAUDE_CODE_RETRY_WATCHDOG: Tunes the retry watchdog that detects API calls silently looping without progress.CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS: Bounds how long unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) waits for a usage-limit reset.CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS: Caps the total time unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) waits through 429 and 529 responses.CLAUDE_CODE_RETRY_WATCHDOG_SCOPE: Read alongside CLAUDE_CODE_RETRY_WATCHDOG.CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS: Governs how unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) rechecks a usage limit that was lifted before its reset, so a headless run can resume once the limit clears.
Frequently asked questions
What does CLAUDE_ENABLE_BYTE_WATCHDOG do?
Activates a byte-level watchdog on API response streams. The v2.1.105 changelog describes a fix for stalled API streams: "streams now abort after 5 minutes of no data and retry non-streaming instead of hanging indefinitely." This variable likely gates that behavior — when enabled, the runtime monitors incoming byte…
Which Claude Code version has CLAUDE_ENABLE_BYTE_WATCHDOG?
Added between v2.1.104 and v2.1.107 and still present in v2.1.310.
How do I set CLAUDE_ENABLE_BYTE_WATCHDOG?
Export it before starting Claude Code (export CLAUDE_ENABLE_BYTE_WATCHDOG=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.