跳到正文
Claude Code:GitHub Releases· ashwin-ant·· 3 小时前AI 评分46

Claude Code v2.1.295 发布

v2.1.295

AI 导读

Claude Code 发布 v2.1.295,新增 command 与 HTTP hooks 的 onFailure: "block" 配置,钩子启动失败、超时或异常退出时将直接阻断操作。

正文

What's changed

  • Added onFailure: "block" for command and HTTP hooks: a hook that can't start, times out, or exits with an unexpected code blocks the action instead of letting it through
  • Added Program Status Protocol (OSC 7501) support: terminals that implement it can show whether Claude Code is working, waiting on you, or done
  • Added quoted text to the /copy picker, so a drafted message copies without its > markers
  • Added a warning to claude plugin install, enable, disable and marketplace add when the settings file they write to does not load
  • Added a line on stderr, when it is a terminal, that says what a claude -p run is waiting for when it stays open after its last turn
  • Added support for timeouts.upstream_ttfb_ms on the Claude apps gateway's Bedrock, Vertex, Foundry and other cloud upstreams: a value you set now limits how long a stream may take to start there, after which it fails over or gets a 502
  • Added a "Backgrounding cancelled" message when you stop the turn while ← is waiting for the current tool to finish
  • Added an optional models list to every Claude apps gateway upstream: only the listed models are sent there, on failover too, and one * in an entry is a wildcard
  • Added support for forceLoginMethod: "gateway" and forceLoginGatewayUrl in your own user settings on machines with no managed settings, so /login opens on that Claude apps gateway
  • Added advice to claude plugin validate when a plugin's README has no install line: it prints the line to paste and never changes the exit code, even with --strict
  • Added upstream_request_id to the Claude apps gateway's inference audit event: the request ID from Amazon Bedrock, the Anthropic API or another upstream, for support cases
  • Added $.ui.notify for mods: raises a native notification through your own notification setting and says which channel sent it
  • Added children to a mod's Button: strings and Text, so a row of a list is one pressable with a chip or a dim detail inside
  • Added CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS to limit how long unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) waits out 429 and 529 errors
  • Added a request-id header to the Claude apps gateway's successful inference responses, so request_id in Claude Code telemetry matches the gateway's audit log
  • Fixed every request failing on a [1m] model when a gateway, Bedrock, Vertex or Foundry refuses the context-1m beta; Claude Code now resends without it
  • Fixed claude -p text output dropping earlier responses when background work started another turn; each turn's response now prints when the turn ends
  • Fixed remote MCP servers in headless and SDK sessions staying disconnected after an outage longer than 15 seconds, or reconnecting in a tight loop to a server that drops each connection right after it connects; repeated drops now back off, up to 30s
  • Fixed remote MCP connections being dropped when a server's error reply happened to contain a network error name
  • Fixed MCP servers that repeat a pagination cursor being asked for the same page up to 20 times at every connect
  • Fixed CSS, JavaScript and XML files returned by MCP tools being saved as .bin, which the Read tool refuses; font and icon files now get their own extension too
  • Fixed Bash tool calls failing when the model passes command_description instead of description
  • Fixed Claude in Chrome not applying a site deny rule written with port 80 (host:80) to plain http:// pages on that host
  • Fixed /plugin's Errors tab removing a marketplace that failed to load, and uninstalling its plugins, on Enter without asking first
  • Fixed claude plugin marketplace add reporting success for a marketplace whose name no plugin can be installed under; such an add is now refused
  • Fixed CLAUDE_AUTO_BACKGROUND_TASKS moving a subagent to the background while an edit or shell command waited behind it, which started that call before the subagent finished
  • Fixed PushNotification saying a push was not sent in claude remote-control sessions right after a phone message, without the /config toggle, or when started from inside Claude Code
  • Fixed files sent from remote sessions being refused as "could not be vouched for" when more than 256 were sent at once
  • Fixed a rare failure to load managed settings at startup right after a login refresh
  • Fixed /tui exiting without a message, or with a raw system error, when Claude Code could not be started again
  • Fixed a link address shown as text being hidden by a colour or conceal style a reply left on, including where it wraps in a table or a question preview
  • Fixed Fable models listed in availableModels not appearing in the /model picker for sessions signed in to a Claude apps gateway; such a model now shows its built-in row in place of a modelPicker row added for the same model
  • Fixed the Claude apps gateway's admin spend view showing a developer's old groups and group cap after their session stopped carrying groups
  • Fixed CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC hiding the Claude apps gateway spend limit in /usage and the status line. The spend limit request goes to the gateway the session is signed in to
  • Fixed subagents in their own linked worktree being shown the parent session's git branch, status and recent commits
  • Fixed Claude stopping at the end of the current tool when text typed in the prompt cancelled backgrounding with ←; Claude now keeps working in the foreground
  • Fixed --tools and --restricted not applying to built-in tools that register after launch, and deprecated tool names reaching tools outside the caller's tool set
  • Fixed an interrupt not ending the turn until a timeout while Claude waited for an MCP server's resource list
  • Fixed a mod's hook being handed a deeply nested tool input cut short with no error, so a guard could pass content it never saw
  • Fixed Esc not stopping a self-paced /loop that was moved to the background with ←; cancelling a pending wakeup now shows a notice
  • Fixed commands and hooks in background sessions inheriting FORCE_COLOR=3, which put color escape codes into the output Claude reads
  • Fixed claude agents starting a new background service as it exited when both were stopped with a session open (for example at a reboot), which could delay shutdown and restart an interrupted session
  • Fixed a custom agent named worker being shown as "Agent" in auto-mode denial notices and in the activity lists of task detail views
  • Fixed Bash permission checks for for-loops over glob patterns, improving permission-check accuracy
  • Fixed forked skills invoked from Workflow subagents delivering their results to the main conversation instead of the invoking agent
  • Fixed in-process agent teammates failing their first SendMessage call until they loaded the tool through tool search
  • Fixed Claude being told on resume that an unfinished background workflow may have been stopped by TaskStop, which can never be the cause
  • Fixed Claude not being told when you stop a long-running MCP tool call from the tasks panel or a connected client
  • Fixed a background session's /loop stopping without notice when its next wakeup came due while the session's process was down; the session now says so and Claude is told
  • Fixed raw terminal hyperlink bytes in a reply or a teammate's message being drawn as a clickable link with a hidden address
  • Fixed plugin marketplaces whose repository has large git submodules failing to add or refresh: only the submodules that hold plugin files are now fetched
  • Fixed the /advisor dialog showing a checkmark on a saved advisor model that is no longer available; it now opens on "No advisor"
  • Fixed the notification for an MCP tool call that moved to the background showing a shortened task id
  • Fixed vim mode's ~ moving the cursor past the last character of a line, so x after it did nothing, and 3~ running on into the next line
  • Fixed the cursor landing one character too far after pasting accented text copied from macOS (such as a file name) into the middle of the prompt
  • Fixed the terminal freezing, with ctrl+c ignored, when a response ran to tens of thousands of lines
  • Fixed calls a mod makes while it reloads during a plugin hooks worker restart getting past another mod's guard hook that has a .catch; such calls are now refused
  • Fixed plugins whose hooks module nests code thousands of levels deep failing to load or validate with a bare stack-overflow message
  • Fixed claude plugin test passing a session.append hook that removes tool call, tool result or thinking blocks that a real session keeps
  • Fixed Claude not being told it can resume background subagents with SendMessage after a session was killed and resumed a second time
  • Fixed a file being treated as already read after a Bash command such as cat ran without printing it
  • Fixed plugin options named constructor or prototype always reading as their default and never reloading the plugin when edited
  • Fixed a mod's hot reload missing a save made while /reload-plugins or session start was reading the mod's files
  • Fixed the mod hot-reloading question being asked again every turn for the whole session when it is approved without picking an answer
  • Fixed /model, /fast and /output-style saving their setting without asking a plugin's config.set hook
  • Fixed bold text being drawn faint in piped output when it directly follows dim text
  • Fixed replies whose quotes nest deeper every few lines freezing the terminal for seconds and using gigabytes of memory
  • Fixed a mod's hot reload missing a save made within a few milliseconds of its last reload, which left the mod on its old version until the next save
  • Fixed claude mcp serve background Bash results not naming the output file, and its tool description promising a notification that never arrives
  • Fixed an async SessionStart hook's unchanged context being added to the conversation again on every resume
  • Fixed variables a SessionStart hook writes to CLAUDE_ENV_FILE not reaching the Bash tool after an in-app /resume or /branch
  • Fixed a skill's allowed-tools and effort being dropped when the Skill tool finished before the response stream ended, which denied the skill's Bash commands in -p runs
  • Fixed a tampered cache of server-managed settings making a person's own plugin count as organization-managed on machines whose managed settings list or enable plugins
  • Fixed Claude 3 Opus and Claude 3.x Sonnet sessions being offered tool search, which those models reject, where feature flags are unavailable
  • Fixed generated type files being written into a --plugin-dir plugin's folder in -p and SDK sessions; they are now written only where a mod is being developed
  • Fixed text with tabs or bidirectional control characters losing its end at the edge of the screen or drawing over nearby rows
  • Fixed /model saying a Max effort pick was saved as your default for new sessions; Max applies to the current session only
  • Fixed an async hook's JSON output being ignored when it is printed over several lines
  • Fixed the Read tool rejecting calls with an empty pages parameter instead of treating it as omitted
  • Fixed project-scope plugins not loading in VS Code on Windows due to drive-letter casing (#74612)
  • Fixed plugin install and uninstall at project or local scope on Windows missing the install record, or adding a second one, when only the drive letter's case differs
  • Fixed a queued message being lost when pulled back into the prompt with ↑ or Esc just after ←: prompt history now keeps it
  • Fixed mod hot-reloading turning off for the whole session when an SDK host closed its enable question before anyone answered; the question is now asked up to three times
  • Fixed a prompt that a mod's prompt.submit hook rewrote or dropped still being saved as typed to prompt history and to the transcript's queued-prompt records
  • Fixed non-interactive sessions telling you about MCP servers that need authentication when your request doesn't use them
  • Fixed the claude_code.auth OpenTelemetry login event not being emitted on Claude apps gateway sign-in. The event is exported when OpenTelemetry is configured on the machine or the session is already signed in to the gateway
  • Fixed a plugin that adds very large interfaces getting another plugin unloaded when the plugin hooks worker stalls
  • Fixed Edit treating a file as fully read when its contents changed without its modification time advancing
  • Fixed short command output with Windows line endings (CRLF) being drawn on a single line
  • Fixed a stopped scheduled task coming back on resume after a rewind, and a scheduled task being lost on resume after Esc or a rewind following a compaction
  • Fixed the terminal freezing for seconds or minutes while syntax highlighting code with very long lines, long runs of blank lines, or unclosed strings and heredocs
  • Fixed temporary files left under ~/.claude/seed-admin by an interrupted /ultrareview upload never being removed by the retention cleanup
  • Fixed Desktop and SDK sessions refusing to switch back to auto mode until restart after disableAutoMode was removed from settings
  • Fixed claude.ai-synced plugin hooks failing with "Plugin directory does not exist" in long-running sessions after another session synced a plugin update
  • Fixed the prompt sent after a /rewind being lost, and the removed turns coming back, when the session was moved to the background or resumed after being killed
  • Fixed cloud sessions hanging when a mod's session.receive hook asked for permission before passing a message on
  • Fixed macOS background sessions that restart together after an update sometimes running outside the stable app wrapper, so folder-access prompts could reappear
  • Fixed an MCP sign-in or reconnect that finishes late in headless and SDK sessions relisting a server set with setMcpServers() as your own
  • Fixed changing the auto-update channel in /config saving before a plugin's config.set hook was asked
  • macOS: Fixed a file count at session start that could reach other apps' data and raise the "access data from other apps" prompt when a session starts in the home folder or above it
  • Improved token counts behind a Claude apps gateway on Amazon Bedrock, which /context and large file reads use: the gateway now gets them from AWS's CountTokens API instead of a one-token model request. Grant bedrock:CountTokens to use it
  • Improved the Claude apps gateway to log a warning every 30 seconds while its PostgreSQL database is read-only, saying what fails and how to recover
  • Improved the status shown in Remote Control, claude.ai and the desktop app for a session waiting on a permission prompt to name an MCP tool by its server and readable name instead of its mcp__server__tool identifier
  • Improved background requests behind a Claude apps gateway to use Haiku 4.5 instead of the session's model, falling back to the session's model where the gateway does not serve Haiku 4.5
  • Improved how the Claude apps gateway handles models not listed under models: in Amazon Bedrock regions outside AWS's US geography. AWS always refused those requests; the gateway now tries the model in your own region, and a refusal names the model to add
  • Improved headless rate_limit_event usage-limit warnings to say whether the account has extra usage turned on
  • Improved the built-in plugin-authoring skill: it no longer tells a session with no terminal to run terminal commands, and explains sharing a mod only when asked
  • Improved Grep input handling: a search sent with grep's -l, -c or -r flag now runs instead of failing the call
  • Improved claude plugin validate and plugin loading: when a hooks module is refused over a rebound top-level var, the error now names the line that rebinds it, the cause, and a fix
  • Improved the Workflow tool's scriptPath refusal: it now says to pass the script inline via script, the route that works in sessions without a Read tool
  • Improved what Claude is told when a large file it sends fails to upload with no reason given, so it reports the failure instead of shrinking the file
  • Changed MCP tool descriptions the model loads through tool search to be cut at 16,384 characters instead of 2,048
  • Changed subagents to preload at most 32 skills from the skills field, each once; a subagent with the Skill tool can still invoke the rest
  • Changed Ctrl+C at the idle prompt of an attached background session to leave a pending /loop wakeup alone, so pressing it twice detaches and the loop keeps running; press Esc to stop it
  • Changed claude agents stopped with its background service (macOS, or Linux without the service installed): running sessions now stop in about a minute unless it is run again, and a notice says so
  • Changed claude.ai connectors to negotiate MCP protocol version 2026-07-28 by default on installs that fetch no flags; MCP_PROTOCOL_NEGOTIATION=legacy opts out
  • Changed Artifact pages with no background of their own to show on white instead of off-white
  • Changed what Claude and you read when a mod denies a tool call after the tool ran: it now says the tool ran and a plugin withheld its result
  • Changed tab stops to count from where a text starts instead of from the screen's left edge: an answer indented by 2 has its first stop 8 cells in, where it was 6
  • Changed the Artifact tool's permission prompts with telemetry disabled to the same five questions other installs get, instead of asking before each read of someone else's artifact and each data edit
  • Changed scheduled and Run now routine runs in installs with telemetry disabled to publish new private artifacts, and update your own, without asking, as in other installs
  • Changed toasts from your organization's mods to show ahead of other mods' toasts instead of waiting behind them
  • Changed the Claude apps gateway to start with a warning and serve a desktop policy key its bundled Claude Desktop schema doesn't know, so new Desktop settings need no gateway upgrade
  • Changed WebSocket (ws) MCP servers: a message over 16 MiB is no longer parsed and closes the connection, the limit the other transports already have
  • [VSCode] Added a chat row for files Claude sends you: click a file's name to open it in the editor; Claude's caption shows underneath, and the row stays visible in Focus view
  • [VSCode] Fixed "Fork conversation from here" and Rewind's conversation restore failing with "Message not found in session" after a background agent's activity or one of the panel's own status lines
  • [VSCode] Fixed Ctrl+Shift+Tab, Cmd+Shift+Tab and Alt+Shift+Tab in the chat input also switching the permission mode, and Ctrl+Tab accepting the suggested prompt
  • [VSCode] Fixed keyboard focus bouncing between two Claude views visible at once, which could send typed text to the wrong conversation
  • Self-hosted runner: Changed the runner to stop passing CCR_AUTO_MODE_ALLOW, CCR_AUTO_MODE_ENVIRONMENT and CCR_AUTO_MODE_SOFT_DENY into a session's environment
  • Self-hosted runner: Fixed git fetches being cut off while the git server was still reporting progress on a large repository; CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS tunes or turns off the wait
  • [Cloud sessions] Fixed a message sent right after unarchiving a cloud session sometimes getting no reply because no container could start for it
  • [Cloud sessions] Fixed some older routines starting their runs without ever giving Claude their saved prompt; those routines now run their prompt again
  • [Cloud sessions] Improved how quickly a cloud session catches up after its connection drops: activity you missed now appears all at once instead of row by row
  • [Cloud sessions] Improved the setup script box in the cloud environment form: it starts taller, grows with your script, and can be resized by dragging
  • [Claude Tag] Changed the settings confirmation cards Claude posts in a Slack channel to stay open for 30 minutes instead of 10
  • [Claude Tag] Changed Claude's notice that a channel shared across Enterprise Grid workspaces uses organization defaults to post only when someone mentions Claude, at most once a month
  • [Claude Tag] Fixed channel links and @-mentions in a forked thread's "Continued from" card showing as raw Slack codes
  • [Claude Tag] Fixed Slack's Working status spinning on under a thread after @Claude !restart had already confirmed the restart
  • [Claude Tag] Fixed another app's or bot's @claude going unanswered in a busy channel where Claude had stopped reading untagged messages
  • [Claude Tag] Added a confirmation in Claude Tag admin settings before adding a channel manager moves that member to Custom roles, which can remove their other access
  • [Code Review] Fixed Code Review re-reviews saying no issues were found while earlier findings were still open; the comment now says how many remain open
  • [Code Review] Fixed Code Review still skipping a large CLAUDE.md's rules when the pull request edits that file
  • Fixed web searches and agent hook evaluations taking much longer at xhigh and max effort

来源:Claude Code:GitHub Releases · github.com