---
title: "Claude Code v2.1.247 发布：新增反馈工具与 API 成本优化功能"
source: "Claude Code：GitHub Releases（RSS）"
source_tier: "t1_5"
url: "https://github.com/anthropics/claude-code/releases/tag/v2.1.247"
permalink: "https://feed.astralor.com/items/itm_37c894b173ddb1595098a0b8"
published: "2026-08-26T23:06:39.000Z"
score: 78
channel: "ai"
tags: ["Anthropic","API 成本优化","Claude Code","MCP","Sonnet 5"]
---

# Claude Code v2.1.247 发布：新增反馈工具与 API 成本优化功能

## AI 点评

> 这个版本最让我在意的是 /claude-api cost-optimize 的出现——它意味着 Claude Code 开始主动帮你算账，而不是单纯写代码。对于 API 花费压力大的团队，这可能是升级的最佳理由。另外，大量针对终端、快捷键和沙箱的修复，说明 Anthropic 在认真对待长期开发者体验。

## 速览

Claude Code v2.1.247 发布：新增 SendFeedback 工具，会话出错时 Claude 可起草反馈报告；新增 /claude-api cost-optimize 命令，用于分析 API 花费并逐步优化成本；/claude-api skill 扩展 Admin API 覆盖。Bash 权限提示支持一键切换到自动模式，Sonnet 5 默认自动压缩窗口扩展至完整 1M 上下文。此外还修复了大量终端、沙箱、插件市场和会话稳定性问题，并增强了插件市场安全加固。

## 关键点

- 新增 SendFeedback 与 /claude-api cost-optimize，前者让 Claude 自动起草出错反馈，后者用于量化并优化 API 成本。
- /claude-api skill 新增 Admin API 覆盖，可管理组织成员、工作空间、API keys、限流报告等。
- Bash 权限提示提供一键切换到自动模式；Sonnet 5 默认自动压缩窗口提升到约 967K tokens。
- 修复了大量终端、沙箱、插件市场及云会话问题，并增强插件市场安全加固。

## 全文

What's changed Added the SendFeedback tool: when something goes wrong in a session, Claude can draft a feedback report for you to review and send from /feedback (turn off with the feedbackDrafts setting) Added {id, text, cooldownSessions, priority} entries, tipsFile, and label to spinnerTipsOverride, so organizations can rotate their own tips alongside the built-in ones Added a tip on Bash permission prompts pointing to auto mode, with a one-keystroke "Yes, and switch to auto mode" option Added /claude-api cost-optimize to profile an existing project's Claude API spend and work through cost levers (caching, token hygiene, batch, effort, model choice) one measured change at a time Updated the /claude-api skill with Admin API coverage (organization members, invites, workspaces, API keys, rate limit reports, workload identity federation, CMEK) Fixed fast arrow-key + Enter sequences acting on the row above the one you navigated to in history search, /config, /mcp, /skills, background tasks, and /model Fixed sub-agents dying on a first-call model 404: they now use the session's fallback model chain, and the error returned to the parent includes the error type, status, request id, and model Fixed a hook or background agent that printed megabytes of error output being able to overflow the conversation and wedge the session on "Prompt is too long" Fixed Ctrl keyboard shortcuts not firing under non-Latin (e.g. Cyrillic) keyboard layouts in kitty-protocol terminals Fixed text like <35;150;7M being inserted into the prompt when a mouse report arrived split across reads right after the escape prefix Fixed the Bash sandbox's after-command cleanup deleting a dotfile-managed ~/.claude/settings.json symlink (nix/home-manager, stow) when it is repointed outside the sandbox's writable area Fixed /terminal-setup overwriting your entire Zed keymap.json instead of merging in its keybinding Fixed /rename silently confirming when the session registry could not be updated; it now says other sessions may still show the old name Fixed /compact and "Summarize from here" in sessions started with --agent summarizing under the default system prompt instead of the conversation's own Fixed a background session showing "opening…" forever in claude agents after its terminal host process died; the row now fails within seconds with the reason, and Enter restarts it Fixed unbounded memory growth when a hook's or background task's output file could not be written; the file now notes where output was lost Fixed /install-github-app over SSH: the copy shortcut now says how the sign-in URL was copied instead of always claiming success, and the URL appears immediately when no browser can open Fixed shell commands carried over from the foreground logging an internal error or showing a misleading [exited with code -1] line when they finish in background sessions Fixed a version-less marketplace plugin's live cache directory being deleted and recreated on a second-scope install, which could disrupt a running session using it Fixed Remote Control sessions started with /remote-control not reporting the working-tree diff to connected clients Fixed self-hosted runner sessions reporting running before Claude Code had started, which could trigger a premature "Claude is waiting for your input" notification from the Claude desktop app Fixed first-run setup exiting with "Unable to connect to Anthropic services" when managed settings configure Claude apps gateway sign-in and Anthropic endpoints are unreachable Fixed cloud sessions (Claude Code on the web, desktop and mobile apps) sometimes showing the previous permission mode when you switch modes right after sending a message Fixed cloud sessions going silent when the session's container restarts between turns while a background agent, shell, or monitor is still running — the resumed session now reports the lost work Improved plugin marketplace hardening: names containing control or invisible characters are rejected, and marketplace-supplied text in /plugin and claude plugin output is escape-safe Improved Bedrock, Vertex, and Foundry sessions (and any with telemetry disabled): Claude is now told when a configured MCP server failed to connect, instead of concluding its tools don't exist Changed Sonnet 5's default auto-compact window to its full 1M context, so sessions on the 1M window now auto-compact at about 967K tokens instead of about 934K Changed cross-session peer messages to collapse by default to a one-line Message from @<sender>: <first line> preview; Ctrl+O expands the full body Changed terminal hyperlinks in rendered markdown: link targets that point at a network or automounter path, contain a control character, or lead with an invisible character now render as plain text Changed the prompt-footer PR badge to skip its GitHub re-check on terminal refocus when the last check is under a minute old Changed analytics to stay off from startup, not only after login, when managed settings force gateway login or a custom OAuth deployment is configured Changed Claude apps gateway sign-in requests to identify Claude Code (a surface=claude_code device-authorization parameter and a claude-code/<version> User-Agent) Changed organization sign-in enforcement to exit at start when the administrator's managed settings cannot be read, even if host-supplied or per-user Windows registry settings exist

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_37c894b173ddb1595098a0b8
