Claude Code v2.1.81 — 1 New Environment Variable: The --bare Flag and a Bug Fix Marathon#
Published on March 21, 2026
Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog
Claude Code v2.1.81 adds 1 new environment variable and ships 17 bug fixes compared to v2.1.80. The headline feature is --bare — a new flag that strips Claude Code down to its core for scripted -p calls — but the sheer volume of fixes is the real story. The bug-fixing spree that started in v2.1.79 shows no signs of stopping. Thanks Boris, Daisy, and the rest of the Claude Code ants.
What Changed#
| v2.1.80 | v2.1.81 | |
|---|---|---|
| Environment variables | 182 | 183 (+1) |
| Model IDs | 16 | 16 (no change) |
| Feature gates | 41 | 41 (no change) |
| Dynamic configs | 30 | 29 (-1) |
| Slash commands | 22 | 22 (no change) |
New Environment Variables#
| Variable | Likely Purpose |
|---|---|
CLAUDE_CODE_USE_POWERSHELL_TOOL | Enables a PowerShell-specific tool variant for Windows environments. This suggests the team is building first-class PowerShell support rather than routing everything through Bash — consistent with this release also disabling line-by-line streaming on Windows/WSL due to rendering issues. Windows users may eventually get a native shell experience instead of the current Git Bash workaround. |
Key Changes in This Release#
--bare — Stripped-Down Mode for Scripted Calls#
The most architecturally significant addition is --bare, a new flag for -p (print mode) invocations that skips hooks, LSP, plugin sync, skill directory walks, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. From claude --help:
Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials.
The naming likely echoes git init --bare — a repository with no working tree, just the essential data structures. Similarly, claude -p --bare gives you the inference engine with none of the interactive scaffolding. Auth is locked to ANTHROPIC_API_KEY or an apiKeyHelper passed via --settings; OAuth and keychain flows are completely disabled. Third-party providers (Bedrock, Vertex, Foundry) use their own credential chains as usual.
You can still explicitly provide context via --system-prompt, --add-dir, --mcp-config, --settings, --agents, and --plugin-dir — you just opt into exactly what you need. This makes --bare ideal for CI/CD pipelines, automated code review bots, and any scripted integration where startup latency and side effects matter. The flag effectively creates a "headless" Claude Code that is predictable, fast, and free of surprises from hooks or plugins you didn't ask for.
Concurrent OAuth Fix — A Long-Awaited Relief for Multi-Session Users#
Fixed multiple concurrent Claude Code sessions requiring repeated re-authentication when one session refreshes its OAuth token
This one deserves its own section. Issue #24317 — "Frequent re-authentication required with multiple concurrent Claude Code sessions (OAuth refresh token race condition)" — has been open since early March and haunted anyone running more than a couple of sessions simultaneously. The bug: when one session refreshes its OAuth token, the new token invalidates the old one in ~/.claude/.credentials.json, forcing every other session to re-authenticate through the browser flow. If you're a power user running 7-12 concurrent sessions (as the issue reporter described), this meant multiple browser popups per day. Big thanks from all of us who've been living with this — particularly Bedrock users who had it worst given the extra auth hop. It's finally fixed.
--channels Permission Relay#
Building on the --channels research preview from v2.1.80, channel servers that declare the permission capability can now forward tool approval prompts to your phone. This means if Claude Code needs permission to run a command, the prompt can appear in your Telegram or Discord chat instead of requiring you to be at the terminal. The release also fixes a bypass where --channels wasn't enforcing permissions for Team/Enterprise orgs with no other managed settings configured.
/btw and ! Bash Mode Improvements#
Two neat QOL improvements for the interactive experience. /btw — the side-channel for injecting context during an active response — now correctly includes pasted text, fixing a regression where only typed input was captured. And Claude now suggests ! bash mode when it detects you need to run an interactive command, surfacing the shortcut instead of making you context-switch. No more fumbling to remember the escape hatch when you need a quick git status mid-conversation.
Plan Mode Loses "Clear Context"#
Plan mode now hides the "clear context" option by default (restore it with "showClearContextOnPlanAccept": true in settings). This is a bittersweet change — the option was useful for those of us who wanted a clean slate after plan acceptance. But the math makes the UX confusion hard to justify: a plan that takes 7% of a 200k Opus 4.6 context window drops to under 2% on 1M. A heavier plan that fills 30% of the 200k window? A negligible 6% on 1M. Anthropic is clearly betting on the 1M window as the default experience, and at those ratios, manually clearing context after plan acceptance is overhead for almost no gain. The message is clear — keep your context, let auto-compaction handle the rest.
The Fix List#
Seventeen fixes landed in this release, continuing the quality push from v2.1.79 and v2.1.80:
| Fix | Impact |
|---|---|
| Voice mode swallowing retry failures | Now shows the actual error instead of a misleading "check your network" message. |
| Voice mode audio not recovering on silent WebSocket drops | Audio now reconnects when the server silently drops the connection. |
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS not suppressing structured-outputs header | Was causing 400 errors on proxy gateways forwarding to Vertex/Bedrock. Another win for enterprise proxy users. |
| Node.js 18 crash | Compatibility fix for environments still on the LTS version. |
| Unnecessary permission prompts for Bash commands with dashes | Commands containing dashes in strings no longer trigger false positive permission checks. |
| Plugin hooks blocking prompt submission | Deleting a plugin directory mid-session no longer freezes input. |
| Background agent task output hanging | Race condition between polling intervals and task completion is resolved. |
| Worktree resume | Resuming a session that was in a worktree now correctly switches back to it. |
| tmux clipboard race | Fast Cmd+Tab followed by paste no longer beats the clipboard copy. |
| Remote Control session titles, exit, rename | Three separate fixes for Remote Control session management. |
| Invisible hook attachments inflating message count | Transcript mode no longer overcounts messages from hidden hook data. |
Other Improvements#
- MCP read/search tool calls now collapse into a single "Queried " line — expand with Ctrl+O. Much cleaner output when using multiple MCP servers.
- Plugin freshness: ref-tracked plugins re-clone on every load to pick up upstream changes. No more stale plugin code.
- MCP OAuth now supports Client ID Metadata Document (CIMD / SEP-991) for servers without Dynamic Client Registration.
- Remote Control session titles refresh after your third message for better discoverability.
What These Tell Us#
Claude Code is splitting into two products: interactive and headless. The --bare flag formalizes what power users have been hacking together with CLAUDE_CODE_SIMPLE=1 and various DISABLE_* env vars — a minimal, predictable execution mode for automation. By making this a first-class flag with explicit auth constraints (no OAuth, no keychain), Anthropic is acknowledging that a significant chunk of Claude Code usage isn't a human at a terminal. CI pipelines, code review bots, automated refactoring scripts — these all need fast startup, no side effects, and no interactive auth flows. The --bare flag gives them that without the fragile env var dance.
The bug fix velocity is remarkable. Seventeen fixes in a single release, on top of seven in v2.1.80 and twenty-five in v2.1.77. That's nearly fifty fixes across three releases in under a week. The team is clearly in a stabilization sprint, and it shows in the breadth of fixes — voice mode, OAuth, enterprise proxies, Windows, tmux, Remote Control, worktrees, plugins. This isn't targeted triage; it's a systematic sweep across the entire surface area. For users who've been filing issues and waiting, this is the payoff.
The 1M context bet is becoming explicit. Hiding "clear context" in plan mode is a small UI change with a big signal. A plan that eats 7% on the 200k window is under 2% on 1M; one that fills 30% becomes a negligible 6%. At those ratios, a "clear context" button is more confusing than useful. Combined with the auto-compaction improvements from recent releases, the direction is clear: Anthropic wants you running long, rich sessions where context accumulates rather than being manually managed. The plan mode change is a nudge toward that future.
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.80 — Channels, Plugin Simplification, and a Bug Fix Sprint —
--channelsresearch preview, plugin install flow - Claude Code v2.1.79 — 3 New Environment Variables — subprocess sandboxing, startup optimization
- Claude Code v2.1.78 — 2 New Environment Variables — plugin persistence, security hardening
- Claude Code v2.1.77 — 1 New Environment Variable — cowork memory guidelines, 25+ bug fixes
- Claude Code v2.1.76 — 3 New Environment Variables — MCP elicitation, workspace host paths
Related: Context Window Management Guide | Claude Code Productivity Tips | The Agentic Engineering Playbook