Claude Code 2.1.78
**`StopFailure` hook event** — agents can now react to API errors that halt execution (rate limit, auth failure) instead of silent termination, enabling recovery workflows and graceful degradation.
New primitives
StopFailurehook eventFires when turn ends due to API error (rate limit, auth failure, etc.)
${CLAUDE_PLUGIN_DATA}environment variablePlugin persistent state that survives plugin updates; `/plugin uninstall` prompts before deleting it
effort, maxTurns, disallowedToolsfrontmatter keysConfiguration support for plugin-shipped agents
ANTHROPIC_CUSTOM_MODEL_OPTIONenvironment variableAdd custom entry to `/model` picker with optional `_NAME` and `_DESCRIPTION` suffixed vars for display
line-by-line response streamingcapabilityResponse text now streams line-by-line as it's generated
tmux terminal notifications passthroughcapabilityTerminal notifications (iTerm2/Kitty/Ghostty popups, progress bar) reach outer terminal when inside tmux with `set -g allow-passthrough on`
Workflow recipes
Rate limits and transient API failures currently kill entire workflows silently. By detecting failure via hook and streaming responses line-by-line, agents can offer partial results mid-task and queue retries instead of losing work.
An agent workflow that subscribes to StopFailure, captures the last-successful state (parsed from streamed lines), surfaces what succeeded to the user, and automatically retries the remaining work when the API recovers. Useful for long-running analyses, data pipelines, or multi-stage tasks where partial output is valuable.
Plugins can now ship agents that retain settings across updates and enforce execution constraints without global config pollution. This enables curated, reusable agent templates distributed via plugins.
A plugin-authored agent (e.g., security-auditor-pro) persists user preferences (sensitivity level, max passes) in ${CLAUDE_PLUGIN_DATA}, reads disallowedTools from frontmatter to block shell access, and uses effort + maxTurns to enforce bounded analysis time. Users install once, update transparently, and get consistent behavior without configuration drift.
Agents can stream output line-by-line while routing model selection via environment variable, enabling dynamic cost/quality trade-offs within a single session and real-time visibility into multi-step work.
A cost-sensitive multi-stage agent that streams intermediate results as they arrive (enabling user feedback early) and switches model via ANTHROPIC_CUSTOM_MODEL_OPTION based on task complexity — cheaper models for data validation, Opus for synthesis. Users see progress immediately and can steer work mid-task rather than waiting for complete batch results.
Agentic relevance
The `StopFailure` hook enables agents to build fault-tolerant workflows that respond to API degradation rather than failing silently. The new plugin state variable and frontmatter keys allow agents shipped via plugins to persist configuration and control execution boundaries. Together with line-by-line streaming, agents can now provide real-time feedback during long-running tasks and gracefully handle transient failures without user intervention.
Hardening & fixes (20)
- Fixed `git log HEAD` failing with "ambiguous argument" inside sandboxed Bash on Linux, and stub files polluting `git status` in the working directory
- Fixed `cc log` and `--resume` silently truncating conversation history on large sessions (>5 MB) that used subagents
- Fixed infinite loop when API errors triggered stop hooks that re-fed blocking errors to the model
- Fixed `deny: ["mcp__servername"]` permission rules not removing MCP server tools before sending to the model, allowing it to see and attempt blocked tools
- Fixed `sandbox.filesystem.allowWrite` not working with absolute paths (previously required `//` prefix)
- Fixed `/sandbox` Dependencies tab showing Linux prerequisites on macOS instead of macOS-specific info
- **Security:** Fixed silent sandbox disable when `sandbox.enabled: true` is set but dependencies are missing — now shows a visible startup warning
- Fixed `.git`, `.claude`, and other protected directories being writable without a prompt in `bypassPermissions` mode
- Fixed ctrl+u in normal mode scrolling instead of readline kill-line (ctrl+u/ctrl+d half-page scroll moved to transcript mode only)
- Fixed voice mode modifier-combo push-to-talk keybindings (e.g. ctrl+k) requiring a hold instead of activating immediately
- Fixed voice mode not working on WSL2 with WSLg (Windows 11); WSL1/Win10 users now get a clear error
- Fixed `--worktree` flag not loading skills and hooks from the worktree directory
- Fixed `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` and `includeGitInstructions` setting not suppressing the git status section in the system prompt
- Fixed Bash tool not finding Homebrew and other PATH-dependent binaries when VS Code is launched from Dock/Spotlight
- Fixed washed-out Claude orange color in VS Code/Cursor/code-server terminals that don't advertise truecolor support
- Fixed `ANTHROPIC_BETAS` environment variable being silently ignored when using Haiku models
- Fixed queued prompts being concatenated without a newline separator
- Improved memory usage and startup time when resuming large sessions
- [VSCode] Fixed a brief flash of the login screen when opening the sidebar while already authenticated
- [VSCode] Fixed "API Error: Rate limit reached" when selecting Opus — model dropdown no longer offers 1M context variant to subscribers whose plan tier is unknown
Raw changelog
## 2.1.78
- Added `StopFailure` hook event that fires when the turn ends due to an API error (rate limit, auth failure, etc.)
- Added `${CLAUDE_PLUGIN_DATA}` variable for plugin persistent state that survives plugin updates; `/plugin uninstall` prompts before deleting it
- Added `effort`, `maxTurns`, and `disallowedTools` frontmatter support for plugin-shipped agents
- Terminal notifications (iTerm2/Kitty/Ghostty popups, progress bar) now reach the outer terminal when running inside tmux with `set -g allow-passthrough on`
- Response text now streams line-by-line as it's generated
- Fixed `git log HEAD` failing with "ambiguous argument" inside sandboxed Bash on Linux, and stub files polluting `git status` in the working directory
- Fixed `cc log` and `--resume` silently truncating conversation history on large sessions (>5 MB) that used subagents
- Fixed infinite loop when API errors triggered stop hooks that re-fed blocking errors to the model
- Fixed `deny: ["mcp__servername"]` permission rules not removing MCP server tools before sending to the model, allowing it to see and attempt blocked tools
- Fixed `sandbox.filesystem.allowWrite` not working with absolute paths (previously required `//` prefix)
- Fixed `/sandbox` Dependencies tab showing Linux prerequisites on macOS instead of macOS-specific info
- **Security:** Fixed silent sandbox disable when `sandbox.enabled: true` is set but dependencies are missing — now shows a visible startup warning
- Fixed `.git`, `.claude`, and other protected directories being writable without a prompt in `bypassPermissions` mode
- Fixed ctrl+u in normal mode scrolling instead of readline kill-line (ctrl+u/ctrl+d half-page scroll moved to transcript mode only)
- Fixed voice mode modifier-combo push-to-talk keybindings (e.g. ctrl+k) requiring a hold instead of activating immediately
- Fixed voice mode not working on WSL2 with WSLg (Windows 11); WSL1/Win10 users now get a clear error
- Fixed `--worktree` flag not loading skills and hooks from the worktree directory
- Fixed `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` and `includeGitInstructions` setting not suppressing the git status section in the system prompt
- Fixed Bash tool not finding Homebrew and other PATH-dependent binaries when VS Code is launched from Dock/Spotlight
- Fixed washed-out Claude orange color in VS Code/Cursor/code-server terminals that don't advertise truecolor support
- Added `ANTHROPIC_CUSTOM_MODEL_OPTION` env var to add a custom entry to the `/model` picker, with optional `_NAME` and `_DESCRIPTION` suffixed vars for display
- Fixed `ANTHROPIC_BETAS` environment variable being silently ignored when using Haiku models
- Fixed queued prompts being concatenated without a newline separator
- Improved memory usage and startup time when resuming large sessions
- [VSCode] Fixed a brief flash of the login screen when opening the sidebar while already authenticated
- [VSCode] Fixed "API Error: Rate limit reached" when selecting Opus — model dropdown no longer offers 1M context variant to subscribers whose plan tier is unknown