Claude Code v2.1.107 — 6 New Environment Variables: Worktrees, Away Mode, and Stream Resilience#

Published on April 14, 2026

Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog

Claude Code v2.1.107 adds 6 new environment variables since v2.1.104. The official changelog covers v2.1.105 and v2.1.107 (v2.1.106 has no published entry), which includes PreCompact hooks, background plugin monitors, worktree reuse via path parameter, away summaries, and a long list of stability fixes — from stalled API stream handling to washed-out terminal colors over SSH. The env var additions reveal investment in multi-worktree orchestration, asynchronous agent supervision, and stream-level reliability primitives.

What Changed#

v2.1.104v2.1.107
Environment variables224230 (+6)
Model IDs1616
Feature gates4141
Dynamic configs2929
Slash commands2424

New Environment Variables#

VariableLikely Purpose
CLAUDE_CODE_BASE_REFSSpecifies base git references (branches, tags, or SHAs) for diff comparison when Claude Code operates in a worktree or feature branch. In multi-worktree agent workflows — where several subagents run in parallel on isolated worktrees — each agent needs to know what "main" means for its context. This variable likely overrides the default base ref detection so that worktree agents produce diffs against the correct upstream, even when the worktree's local HEAD doesn't have the usual remote tracking relationship. The plural "REFS" suggests support for multiple bases, which would matter for monorepos or stacked PRs.
CLAUDE_CODE_ENABLE_AWAY_SUMMARYEnables generation of a summary when the user returns after being away from an active session. When Claude Code detects that the user has been idle or away while background agents continue working, this flag triggers a catch-up summary of what happened during the absence — new tool results, completed tasks, errors encountered. This is particularly useful for long-running autonomous loops (/loop) or background agents where the user steps away and needs to quickly orient on return without scrolling through pages of tool output.
CLAUDE_CODE_REPO_CHECKOUTSSpecifies a directory path (or paths) where Claude Code should create and manage git worktree checkouts. By default, worktrees land in a temporary location adjacent to the main repo. This variable lets organizations or power users redirect worktree storage — for example, to a faster disk, a location with more space, or a path that's excluded from backup/sync tools like Dropbox or iCloud. The v2.1.105 changelog adds path parameter support to EnterWorktree, and this variable likely sets the default root for those checkouts.
CLAUDE_CODE_RESUME_FROM_SESSIONInstructs Claude Code to bootstrap a new session's context from an existing session ID. Rather than starting fresh, the new session loads key context — conversation summary, active files, task state — from the referenced session. This enables session chaining: a completed or compacted session can seed its successor, preserving continuity across context window boundaries. The v2.1.105 changelog fixes several --resume related bugs, and this variable likely supports the programmatic/SDK equivalent of that workflow.
CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTUREPoints to a test fixture file used during the preflight phase of UltraReview — Claude Code's automated PR review pipeline. In test and CI environments, this injects a known fixture so preflight checks (repository access, diff parsing, review scope calculation) run against deterministic data rather than live git state. The PREFLIGHT qualifier suggests UltraReview runs validation before the actual review pass, and this variable lets the test harness control that phase. End users won't set this; it's internal test infrastructure surfacing in the binary.
CLAUDE_ENABLE_BYTE_WATCHDOGActivates 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 flow and triggers the abort-and-retry fallback when the stream goes silent. The name "byte watchdog" (rather than "message" or "event" watchdog) implies it operates below the SSE event layer, detecting TCP-level stalls that wouldn't trigger higher-level timeouts.

What These Tell Us#

Worktree orchestration is becoming a first-class subsystem. Three of the six new variables — CLAUDE_CODE_BASE_REFS, CLAUDE_CODE_REPO_CHECKOUTS, and CLAUDE_CODE_RESUME_FROM_SESSION — address the mechanics of running multiple Claude Code agents across parallel git worktrees. This isn't just "run in a worktree"; it's the plumbing for coordinated multi-agent development: where checkouts live, what they diff against, and how sessions chain across them. Combined with v2.1.105's new path parameter on EnterWorktree (reuse existing worktrees instead of creating new ones) and improved stale worktree cleanup, the picture is an agent orchestration layer where Claude Code can spin up, coordinate, and tear down parallel workstreams programmatically.

Asynchronous supervision is being formalized. CLAUDE_CODE_ENABLE_AWAY_SUMMARY acknowledges a usage pattern that's become common: kick off a /loop or background agent, walk away, come back later. The away summary turns Claude Code from a synchronous pair-programming tool into something closer to an asynchronous work supervisor — it watches, acts, and debriefs you when you return. This pairs with the new background monitor support for plugins (v2.1.105), which lets plugins auto-arm monitoring at session start. Together, these features suggest Anthropic is designing for workflows where human attention is intermittent and the agent needs to bridge the gaps.

Stream reliability is getting defensive depth. CLAUDE_ENABLE_BYTE_WATCHDOG adds a low-level safety net for the API connection itself. The fact that this operates at the byte level — not the SSE event level — means it catches a class of failures (half-open TCP connections, proxy buffering stalls, load balancer timeouts) that application-layer heartbeats miss. Combined with the improved network error messages and the removal of the hardcoded 5-minute timeout in v2.1.104, Claude Code's connection resilience stack now has three layers: byte watchdog (connection), stream timeout (transport), and API timeout (application). That's enterprise-grade reliability engineering.

Sources#

  1. Claude Code Official Changelog — v2.1.105, v2.1.107 release notes

This analysis is conducted for independent security research and interoperability purposes under fair use principles. All trademarks belong to their respective owners. The information presented here documents publicly observable behavior of installed software and is not intended to circumvent any technological protection measures, infringe on intellectual property rights, or encourage unauthorized use. Use these findings at your own discretion.


Related: Context Window Management Guide | Claude Code Productivity Tips | The Agentic Engineering Playbook