v2.1.248
Claude CodeSummary
This release introduces enhanced security features with the new `--restricted` mode and improved cross-session messaging capabilities. Several bug fixes address prompt caching, session management, and tool behavior, while improvements focus on reducing prompt footprints and refining user experience for features like `/ultrareview` and PR badges.
New Features
- Added `--restricted` mode to remove built-in tools that run commands or code and `WebFetch` (unless explicitly named), restrict file tools to the working directory, refuse `bypassPermissions`, and ignore user, project, and local settings files.
- Introduced `experimental.cacheTtl` in agent frontmatter for per-agent prompt cache time-to-live settings.
- Enabled overriding the self-hosted runner's client label with `claude self-hosted-runner --client-label <label>`.
- Added server-managed settings diagnostics, including startup warnings for settings load failures and `/doctor` and `/status` messages explaining load issues.
- Added a warning in `/web-setup` when the GitHub CLI token lacks the `workflow` scope, preventing potential rejections for large repository pushes.
- Introduced `/usage-credits` for Enterprise organizations to request higher usage limits from administrators.
- Enabled cross-session messaging (`SendMessage` / `ListAgents`) between sessions on the same machine, even when telemetry is disabled.
- Changed shift+enter in the agent view dispatch input to insert a newline, while ctrl+enter dispatches and attaches.
- Made self-paced dynamic mode and the no-prompt autonomous default in `/loop` always available, including on Bedrock/Vertex/Foundry.
Bug Fixes
- Fixed a prompt-cache miss that occurred roughly once an hour in long sessions due to tool definitions re-rendering after an OAuth token refresh.
- Fixed the `ScheduleWakeup` tool definition changing between sessions when an account entered usage overage, preventing prompt-cache misses on resumed sessions.
- Resolved Claude Desktop and Cowork sessions disappearing after 30 days by updating transcript cleanup to retain desktop-written sessions.
- Prevented being sent to the login screen when another Claude Code process held the token refresh lock by failing the request with a retryable error instead.
- Fixed the `claude agents` list on Windows not responding to the keyboard after detaching from a session or when launched in a terminal tab left in win32-input-mode.
- Fixed the recommended Console sign-in in `/login` failing with an OAuth error on machines where it cannot be used, by falling back to API-key sign-in.
- Ensured model names in `/model` and fast-mode switch notices render as code to display suffixes like `[1m]` literally.
- Fixed `claude agents` skipping the workspace trust prompt when the `CI` environment variable is set.
- Fixed `claude agents` crashing on launch when the PR-status cache contained a malformed entry.
- Fixed agent view resurrecting week-old background sessions by showing them as stopped and prompting before resuming.
- Corrected agent view sometimes opening an older conversation and dropping the typed prompt when starting a new session.
- Prevented `claude agents` from starting a second process on a conversation when opening a stopped session already resumed in another terminal.
- Fixed `claude agents` and `claude rm` refusing to delete a session with unpushed commits when its worktree branch was already merged into the default branch.
- Fixed background sessions waiting silently when a `PermissionRequest` or `PreToolUse` hook printed an invalid answer by naming the hook and schema error.
- Fixed hooks silently treating non-JSON stdout objects as plain text by reporting them as hook errors with parse messages.
- Fixed `/mcp` listing a project `.mcp.json` entry under the wrong heading by displaying it under its real scope.
- Prevented MCP servers with `headersHelper` from falling into OAuth discovery on a 401 by correctly re-running the helper and retrying the call.
- Fixed `/login` to a Claude apps gateway hanging when the managed-settings security approval dialog was required.
- Fixed gateway model discovery never running when `apiKeyHelper` was the only credential.
- Fixed `claude logs` leaving terminal settings like mouse tracking and alternate screen enabled after execution.
- Corrected a garbled character in the trust dialog's list of repo permission rules when a long rule was cut off mid-emoji.
- Fixed the permission mode indicator staying hidden behind the 'Press Ctrl-C again to exit' hint.
- Prevented `/ultrareview` and locally seeded cloud sessions from uploading uncommitted edits and sensitive file copies by keeping them on the local machine.
- Resolved Remote Control sessions occasionally not showing a permission prompt or latest messages after silent reconnection.
- Fixed cloud sessions occasionally failing at startup when container session credentials were not yet readable.
- Prevented `claude remote-control` from rejecting its own flags when a global flag or wrapper-injected option preceded the subcommand.
- Fixed startup warnings rendering one column to the right of the rest of the transcript.
- Ensured a backgrounded worktree session retains its checkout by holding the worktree's lock while it runs.
- Fixed @-mentions of other sessions not matching names typed with non-Latin characters.
- Prevented an invalid `crossSessionInbound` value from being silently ignored by warning and holding or refusing messages until fixed.
- Fixed rate-limit, usage, and fast-mode messages incorrectly telling users to run `/usage-credits` when the command was unavailable.
- [VSCode] Fixed a chat tab getting stuck on 'No conversation found' by starting a new conversation instead.
Improvements
- Improved the Workflow tool's prompt footprint by reducing its description size and moving script-writing references to a bundled skill.
- Enhanced the prompt-footer PR badge to check GitHub less often for unchanged pull requests.
- Improved managed settings by preventing client-side timeout, MCP startup-mode, and stream-watchdog env vars from triggering the settings-approval prompt.
- Enhanced `/ultrareview <PR#>` to check repository access before launch and provide clearer instructions for fixing issues.
- Improved cross-session messaging by falling back to a private per-user `/tmp` directory when the default is unusable and providing clearer notices.
- Changed the default behavior of `/loop` to include self-paced dynamic mode and no-prompt autonomous mode.
- Changed Anthropic telemetry export failures to log at debug level instead of a more prominent level.