Claude Code v2.1.143 — 27 New Env Vars, /goal, Agent View, and a Free Model Upgrade#
27 new env vars, 2 removed — Published on May 18, 2026
Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog
Fifteen releases. The headline for most users: /goal ships a real completion tracker for complex work, Fast mode quietly upgraded to Opus 4.7 at no extra cost, and the plugin marketplace now tells you what a plugin costs in context before you install it. For teams running agents at scale, this stretch delivers the control plane that was missing — supervised mode, turn caps, stop-hook safety, and three new background session vars that move the BG layer from "it usually works" to "documented failure modes."
What Changed#
| v2.1.128 | v2.1.143 | |
|---|---|---|
| Environment variables | 284 | 309 (+25 net, 27 added / 2 removed) |
| Model IDs | 17 | 17 |
| Feature gates | 0 | 0 |
| Dynamic configs | 29 | 29 |
| Slash commands | 25 | 26 |
v2.1.129–v2.1.135 don't appear in the public changelog — consistent with the pattern of internal builds that don't clear release gates.
User-Facing Highlights#
/goal — set what done looks like, watch it happen (v2.1.139)#
The most practically useful new feature in this stretch. Before /goal, asking Claude to "refactor this module, fix the tests, and update the docs" meant hoping it would complete all three — with no live visibility into which step it was on or whether it had drifted. /goal changes the contract: you declare a completion condition, Claude tracks progress against it in real time, and the session ends when the condition is met rather than when Claude guesses it's done.
For developers: use it for multi-step tasks where you care about completion verification, not just effort. Set the goal at the start of a long agentic run; let the progress display tell you when to check back in. v2.1.140 fixed the case where /goal would hang with certain hook configurations.
Agent View — see your agents running (v2.1.139, research preview)#
claude agents opens the Agent View: a real-time surface for dispatched background sessions. This is the user-facing product that the internal "Agents Fleet" infrastructure was always building toward — and v2.1.142 added configuration flags for dispatched sessions so you can actually control what those background agents do when you launch them. It's a research preview; CLAUDE_CODE_DISABLE_AGENT_VIEW holds it back if you're not ready.
Fast mode → Opus 4.7, no config change needed (v2.1.142)#
If you use Fast mode, you got a free model upgrade. Opus 4.7 is now the Fast mode default. Your sessions are running on a better model than they were last week. CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE is the escape hatch if you need to pin back to 4.6.
Plugin marketplace: cost estimates before you install (v2.1.143)#
The marketplace now shows projected context cost for plugins before you install them. If you've ever installed a plugin and noticed your token counts climb without understanding why — this is the fix. You can now make an informed decision before adding a plugin to your setup. The same release also added dependency enforcement: you can no longer disable a plugin that another plugin depends on without seeing what breaks and why.
Rewind gets "Summarize up to here" (v2.1.141)#
Long conversation, you want to reset but keep the substance — the Rewind menu now offers "Summarize up to here." Condenses the conversation to that point into a compact summary you can carry forward. For complex debugging sessions where you've been going for 2 hours but want a clean starting point for the next phase, this is the move.
Hook args exec form: shell-less subprocess spawning (v2.1.139)#
Hooks can now use exec form in the args field to spawn subprocesses directly, without going through a shell. Why it matters: shell-based hooks inherit the shell's expansion, quoting, and injection risks. Exec form gives you direct subprocess control — no shell interpolation, predictable argument passing, cleaner exit code handling. If you're using hooks for anything security-sensitive or with user-controlled input in the path, switch to exec form.
MCP servers get CLAUDE_PROJECT_DIR (v2.1.139)#
MCP stdio servers now receive CLAUDE_PROJECT_DIR in their environment. Your MCP servers finally know which project they're running in. Any MCP integration that needed to infer this via filesystem heuristics or out-of-band config can now read it directly — cleaner project-scoped behavior without workarounds.
worktree.bgIsolation: "none" — agents edit your branch directly (v2.1.143)#
New worktree setting. Previously, background agents running in worktree isolation mode always worked in a copy; "none" lets them edit the working copy directly. Use case: you want a background agent to make changes on your current branch without the overhead of spinning up an isolated worktree. Opt-in by setting it explicitly — the safe default is still isolation.
MCP servers survive /clear (v2.1.136)#
Before this fix, /clear would drop MCP server connections along with conversation history — forcing you to reconnect or restart. Now /clear clears the conversation without destroying your MCP connections. If you use MCP servers heavily, this alone is worth the upgrade.
settings.autoMode.hard_deny — policy-level auto mode block (v2.1.136)#
You can now unconditionally block auto mode via settings — no user prompt, no override. For teams that manage Claude Code via policy config and need to prevent auto mode on specific machines or in specific environments, this is the enforcement knob that was missing.
Background agents now preserve permission modes (v2.1.141)#
Background agents inherit and maintain the permission mode they were spawned with. Previously, a background session could drift into a different permission posture than the parent intended. For automated pipelines where permissions are set deliberately, this is a correctness fix that matters.
New Environment Variables#
| Variable | What it does and why you care |
|---|---|
CLAUDE_BG_AUTH_SNAPSHOT_PATH | Path for snapshotting background session auth credentials to disk. Fixes the failure mode where a background session lost auth mid-run and corrupted its state — v2.1.143's "corrupt credentials handling" fix is backed by this var. If you run background agents overnight, this is what keeps them from silently dying when a token expires. |
CLAUDE_BG_STARTUP_WEDGE_MS | Startup jitter for background sessions. When you spawn many agents simultaneously, they can race for the same auth or daemon connections. This introduces a small configurable delay to stagger launches. Set it if you see authentication conflicts on mass concurrent spawns. |
CLAUDE_BG_TCC_DISCLAIMED | macOS TCC (Transparency, Consent, and Control) permission disclaimer state for background sessions. Background agents without a controlling terminal need different permission handling. This flag suppresses the disclaimer for sessions that have already gone through the flow — prevents repeated permission prompts on background session restarts. |
CLAUDE_CODE_AGENT_VIEW_RELAUNCH | Force-relaunches the Agent View UI component when it gets into a bad state. The Agent View is a separate surface from the main session; this is its dedicated restart trigger. If Agent View freezes or loses sync with active agents, this resets it without killing your session. |
CLAUDE_CODE_BYOC_ENABLE_DATADOG | Opt-in Datadog telemetry for BYOC (Bring Your Own Cloud) Bedrock/Vertex deployments. Route Claude Code operational metrics to Datadog alongside your existing OTEL pipeline — useful for teams whose observability stack is Datadog-first and who don't want a separate system for Claude Code data. |
CLAUDE_CODE_DISABLE_AGENT_VIEW | Disables Agent View. Renamed successor to CLAUDE_CODE_DISABLE_AGENTS_FLEET (removed this release). If you're managing Claude Code via policy config and aren't ready to roll out the Agent View research preview, this is the clean hold-back flag. The "Agents Fleet" naming is gone — update your configs accordingly. |
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN | Prevents the TUI from using the terminal alternate screen buffer. If Claude Code's UI is eating your terminal history, breaking tmux scrollback, or failing in CI log capture — this flag keeps output in the primary buffer. Useful for any environment where you need to scroll back through Claude's output after a session ends. |
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL | Re-enables the session quality survey for enterprise deployments with OTEL enabled. Backs the v2.1.136 changelog bullet explicitly. If your org collects Claude Code session quality signals through OpenTelemetry, set this to route feedback through the same pipeline rather than a separate channel. |
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY | Query available models from a gateway rather than a hardcoded list. For enterprise setups where model availability is controlled centrally — a new model rolls out to the gateway, Claude Code picks it up automatically without a binary update or config change on each developer's machine. |
CLAUDE_CODE_FORCE_SYNC_OUTPUT | Disable streaming output in favor of synchronous writes. If you're capturing Claude Code output in a script and seeing partial lines or buffering artifacts, this forces fully-written output. Also useful in piped workflows where the downstream consumer can't handle a streaming input. |
CLAUDE_CODE_LOOP_PERSISTENT | Persist loop state across session boundaries. Loops don't die when the session restarts — they resume. Turns /loop from a within-session tool into a durable recurring task mechanism. Combine with a cron-style trigger for genuinely automated periodic Claude Code jobs. |
CLAUDE_CODE_MAX_TURNS | Hard cap on conversation turns. The single most important variable in this release for anyone running unattended agents. Set it to 50, 100, or whatever your budget allows — when the session hits the cap, it stops. No more overnight runs that went way further than intended. Pair with CLAUDE_CODE_SUPERVISED for the full safety setup. |
CLAUDE_CODE_MID_CONVERSATION_SYSTEM | Inject a system message mid-conversation. Your harness can update Claude's constraints, inject new context, or shift behavioral guidelines without ending the session. If you're running a long multi-phase task and need to hand off between phases with different instructions, this is the mechanism to do it without losing conversation state. |
CLAUDE_CODE_NATIVE_CURSOR | Use native terminal cursor control. Extension of the terminal-native capabilities that came in with v2.1.113's binary launcher. If cursor positioning looks off in your terminal (jumping, flickering, wrong position), try toggling this. Particularly relevant on non-standard terminals or tmux configurations. |
CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE | Pin Fast mode to Opus 4.6. Fast mode upgraded to Opus 4.7 by default in v2.1.142. If you're evaluating 4.7 or have a reproducibility requirement — benchmarks, cost comparison — this lets you run the old default explicitly. Remove it once you've validated 4.7 behavior. |
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE | Control whether Claude Code auto-updates itself. If you manage Claude Code versions centrally (fleet policy, pinned version in a Dockerfile, corp registry), turn this off so Claude Code doesn't self-update out from under your managed version. If you're solo and just want the latest always, leave it on or default. |
CLAUDE_CODE_PLUGIN_PREFER_HTTPS | Force HTTPS for plugin source resolution. If you're in a network environment where HTTP traffic is intercepted or plugins could be fetched without TLS, this enforces the secure path. Particularly relevant for teams with a plugin registry behind a corporate proxy. |
CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY | Restore PowerShell execution policy checks. v2.1.143 made bypass-policy the default to reduce the most common Windows friction. If your environment uses execution policy as a security control (AppLocker, corp policy), set this to reinstate it. The bypass default is a usability win for most — this is the enterprise opt-out. |
CLAUDE_CODE_RESUME_PROMPT | Set the prompt injected when resuming a session. If you build on top of Claude Code's resume capability and want Claude to get oriented differently on re-entry — "you were in the middle of X, the current state is Y" — inject that here rather than as the first user message, keeping the conversation structure cleaner. |
CLAUDE_CODE_STOP_HOOK_BLOCK_CAP | Cap how long a stop hook can block session termination. If you've ever hit Ctrl+C and had Claude Code hang before actually closing — this is why, and this is the fix. A stop hook making an API call or running a slow cleanup script used to hold the session indefinitely. Set a cap (milliseconds), and if the hook exceeds it, the session closes anyway. |
CLAUDE_CODE_SUPERVISED | Mark a session as supervised — a human is watching. In supervised mode Claude is more likely to surface decisions for human confirmation rather than resolving ambiguity autonomously. Use this for any session where a wrong autonomous call has real cost: production code paths, irreversible operations, anything billing-sensitive. The companion to CLAUDE_CODE_MAX_TURNS for safe agentic deployments. |
CLAUDE_CODE_VERSION | Exposes the CLI version to subprocesses, hooks, and MCP servers. Your hooks and MCP tools can now read CLAUDE_CODE_VERSION directly — gate behavior on minimum version, log it for observability, or refuse to run on an incompatible version. Eliminates a class of "shell out to claude --version and parse it" hacks in hook scripts. |
CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED | Stream interim voice transcription results as you speak rather than waiting for the final transcript. With this on, you see words appear as the transcription model processes them — lower perceived latency, and you can catch a misrecognized word early and correct mid-sentence rather than after the full utterance is committed. |
CLAUDE_EFFORT | Set thinking effort level at spawn time without the interactive /effort picker. Scriptable effort control: run high effort on the architect agent, low effort on the summarizer, xhigh on the critic — from the same harness without any user interaction. The same levels as the interactive slider: low / medium / high / xhigh / max. |
CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK | Enable the byte watchdog on Bedrock connections. The watchdog fires when a connection opens but produces no bytes within a window — catching silent stalls that don't produce a connection error. Bedrock streaming has different timing characteristics than the direct API; this brings the same stall detection that API users have had since v2.1.107 to Bedrock-routed sessions. |
CLAUDE_MEMORY_STORES | Configure which memory backends are active. With the memory system now supporting typed files, project-scoped MEMORY.md indexes, and persistent cross-session state, this is the env-level toggle for backend selection. Expected to matter most for enterprise deployments running federated memory stores or for teams that need to isolate memory between environments. |
CLAUDE_SUBAGENT_BG_SHELL_MAX_MS | Time cap for shell commands run by background subagents. A background agent running a full test suite or a slow build command used to be bounded only by the overall stall timeout. This adds a shell-specific cap — separate from and shorter than the session-level timeout. If a background agent's shell command hangs, it gets killed cleanly on schedule rather than holding the agent indefinitely. |
What These Tell Us#
User experience was a stated priority — and it shows. Boris Cherny and the Claude Code team at Anthropic have been explicit that UX quality is a first-class concern, not an afterthought. This stretch is the evidence: /goal, Rewind's "Summarize up to here", plugin cost transparency, and the MCP-survives-/clear fix are all answers to real friction that real users hit every day. These aren't nice-to-haves — they're the kind of paper cuts that make power users build workarounds or quietly switch tools. Shipping them in the same stretch as significant infrastructure work isn't accidental; it reflects a team that tracks developer pain points and treats UX debt the same way it treats code debt.
The Agent View rebrand is the visible surface of a deeper shift. CLAUDE_CODE_DISABLE_AGENTS_FLEET is gone; CLAUDE_CODE_DISABLE_AGENT_VIEW is here. "Agents Fleet" was how engineers described the orchestration backend before anyone decided what to call the product. "Agent View" is the product name — something you can explain to a user, put in a help doc, and build UX around. The rename coincides with claude agents becoming a real interactive surface and v2.1.142 adding configuration flags for dispatched sessions. If you have DISABLE_AGENTS_FLEET in any config files, rename it now.
CLAUDE_CODE_MAX_TURNS + CLAUDE_CODE_SUPERVISED = the agentic safety pair you've been waiting for. Before this release, the main tools for preventing runaway agents were prompting and hoping. Now you have a hard numeric cap on turns and an explicit mode that tells Claude a human is watching. These two variables together cover the two failure modes that matter most in production agent work: sessions that run too long and consume unexpected resources, and sessions that make wrong calls autonomously when they should be asking. Set MAX_TURNS to your comfort ceiling; set SUPERVISED when the stakes are real.
If you build hooks, read the exec form change. Hook args exec form (v2.1.139) is not just a convenience — it's a correctness and security improvement. Shell-based hooks introduce quoting ambiguity and injection surface. Exec form removes both. Any hook that touches user-controlled data, file paths, or external services should be migrated to exec form. The v2.1.139 changelog bullet is terse; the security implication is not.
Sources#
Extracted from claude v2.1.143 binary at ~/.local/bin/claude. 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 Versions#
- Claude Code v2.1.128 — 2 New Environment Variables — Proactive idle mode and simple system prompt for subagents
- Claude Code v2.1.114 — 20 New Environment Variables — Native binary launcher,
/fewer-permission-prompts, Agent Teams plumbing - Claude Code v2.1.108 — 5 New Environment Variables — Prompt cache 1h TTL, session recap, model discovery
- Claude Code v2.1.107 — 6 New Environment Variables — Worktrees, away mode, and stream resilience
- Claude Code v2.1.104 — 2 New Environment Variables — Enterprise TLS and SDK OAuth
Related: Context Window Management Guide | Claude Code Productivity Tips | The Agentic Engineering Playbook