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.294. It is listed in the official reference.
| Status | Present in v2.1.294 |
|---|---|
| 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_WAIT_MSCLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MSANTHROPIC_BASE_URL: Custom endpoint for Anthropic services.API_FORCE_IDLE_TIMEOUT
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.294.
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.