
Claude Code v2.1.247 Major Updates - Addition of /claude-api cost-optimize tool and Sonnet 5 auto-compact 1M upgrade
This page has been translated by machine translation. View original
This is Ishikawa from the Cloud Business Division. Claude Code v2.1.247 (released 2026-08-26) has been released. This was a release where the newly added /claude-api cost-optimize tool caught my eye. I tried out /claude-api cost-optimize.
The previous update article is here.
Update Summary
v2.1.247 includes 33 changes. The breakdown is 4 new features, 5 improvements, 4 security-related, 1 performance, and 19 fixes. Fixes account for more than half of the total, and they include high-impact issues such as sessions becoming unresponsive and configuration files being lost. There are no explicit breaking changes or deprecations.
Notable Updates
Addition of the SendFeedback Tool
A SendFeedback tool has been added that allows Claude to draft a feedback report when a problem occurs during a session, which can then be reviewed and submitted via /feedback. If drafts are not needed, they can be disabled with the feedbackDrafts setting.
Since reporting destinations are now consolidated at /feedback, I feel it will be easier to capture minor bugs that previously went unreported.
Addition of /claude-api cost-optimize
/claude-api cost-optimize has been added. It profiles the Claude API usage costs of existing projects and allows you to review cost factors one by one—such as cache, token reduction, batching, effort, and model selection—while measuring each. At the same time, the /claude-api skill itself now supports the Admin API (organization members, invitations, workspaces, API keys, rate limit reports, workload identity federation, CMEK).
For those operating applications that use the Claude API directly, I feel this can serve as a first step toward identifying opportunities for cost reduction.
Sonnet 5 auto-compact Now Covers the Entire 1M Context
The default auto-compact window for Sonnet 5 has been changed to cover the entire 1M context. In sessions with a 1M window, auto-compact will now trigger at approximately 967K tokens instead of approximately 934K tokens.
For those running long sessions with a 1M context, this should be a change that's easy to notice, as it expands the headroom before compaction kicks in.
Fix for Sessions Becoming Unresponsive
A bug has been fixed where hooks or background agents producing error output on the order of several MB would overflow the conversation, causing sessions to become unresponsive with a "Prompt is too long" error. At the same time, a bug where subagents would stop if they received a 404 model error on the first call has been fixed, and they will now use the session's fallback model chain. Errors returned to the parent agent now include the error type, status, request ID, and model name.
I see this as a fix that will particularly benefit those who have set up hooks with large output, or those using subagents and background agents together.
Security Enhancements for Plugins and Terminal Display
Plugin marketplace hardening has progressed, and names containing control characters or invisible characters are now rejected. Additionally, marketplace-derived text included in the output of /plugin and claude plugin is now escaped. On the terminal side, hyperlinks in rendered Markdown that point to network paths or automounter paths, contain control characters, or begin with invisible characters are now displayed as plain text.
For those who install plugins from third-party marketplaces or casually click links flowing into the terminal, I feel this is a quietly effective defense.
Update Details
New Features
SendFeedbacktool: As mentioned above, feedback for problems occurring during a session can be reviewed and submitted via/feedback./claude-api cost-optimize: As mentioned above, cost factors for the Claude API can be reviewed while measuring each one.- Organization-specific Tips display: Entries in the format
{id, text, cooldownSessions, priority}along withtipsFileandlabelhave been added tospinnerTipsOverride, allowing organizations to rotate their own custom Tips alongside built-in Tips. - Auto mode guidance in Bash permission prompts: A tip guiding users to auto mode has been added to the Bash permission prompt, allowing "Yes, and switch to auto mode" to be selected with a single key.
Improvements
- Propagating MCP server connection failures to Claude: In Bedrock, Vertex, and Foundry sessions (and sessions with telemetry disabled), Claude is now notified when an MCP server fails to connect, improving the behavior where it would incorrectly conclude that the tool does not exist.
- Admin API support for the
/claude-apiskill: It can now handle organization members, invitations, workspaces, API keys, rate limit reports, workload identity federation, and CMEK. - Sonnet 5 auto-compact window: As mentioned above, the entire 1M context is now the default.
- Collapsing peer messages: Peer messages spanning sessions are now collapsed by default into a one-line preview of
Message from @<sender>: <first line>. The full message can be expanded with Ctrl+O. - Suppressing PR badge rechecks: The PR badge in the prompt footer now skips querying GitHub on terminal refocus if less than one minute has passed since the most recent check.
- Gateway sign-in identification: Sign-in requests to the Claude apps gateway can now be identified as coming from Claude Code (via the
surface=claude_codeparameter in device-authorization and theclaude-code/<version>User-Agent).
Security
- Plugin marketplace hardening: As mentioned above, names containing control characters or invisible characters are now rejected, and output escaping has been added.
- Terminal hyperlink safety: As mentioned above, links pointing to network paths, containing control characters, or beginning with invisible characters are displayed as plain text.
- Disabling analytics from startup: When gateway login is enforced via managed settings or a custom OAuth deployment is configured, analytics now remain disabled from startup rather than only after login.
- Change to sign-in enforcement behavior: If managed settings from the administrator cannot be read, the startup will now terminate due to the organization's sign-in enforcement even if host-provided settings or per-user Windows registry settings exist.
Fixes
- Fix for session stoppage due to large output from hooks and background agents: A bug where conversations would overflow due to error output on the order of several MB, causing sessions to become unresponsive with "Prompt is too long," has been resolved.
- Fix for subagent stopping on initial model 404: Subagents now use the session's fallback model chain, and errors returned to the parent agent now include the error type, status, request ID, and model name.
- Fix for Bash sandbox deleting
settings.jsonsymlinks: A bug where post-command cleanup would delete symlinks for~/.claude/settings.jsonthat pointed outside the sandbox's writable area due to dotfile management (nix/home-manager, stow) has been resolved. - Fix for
/terminal-setupoverwriting the entire Zedkeymap.json: A bug where the entire file was overwritten instead of merging keybindings has been resolved. - Fix for memory growth on hook output file write failures: A bug where memory usage would grow without limit has been resolved, and locations where output was lost are now recorded in the file.
- Fix for incorrect selection from fast arrow key + Enter operations: A bug where operations would be performed on the row above in history search,
/config,/mcp,/skills, background tasks, and/modelhas been resolved. - A quietly welcome fix: A bug where mouse reports read in split segments immediately after an escape prefix would cause strings like
<35;150;7Mto be entered into the prompt has been fixed. Many users may have been silently dismissing this without knowing the cause. - In addition, numerous minor bugs have been fixed in cloud sessions, background sessions, Remote Control, non-Latin keyboard layouts, initial setup, and more.
Trying Out the /claude-api cost-optimize Tool
This is a subcommand of the claude-api skill bundled with Claude Code, and it is an interactive auditing and improvement workflow for "reducing the execution cost of existing Claude API calls without degrading output quality."
To state the conclusion upfront: it was not an analysis of the Claude API call execution costs within a Claude project (repository). The approach may have been wrong, but here is what happened. That said, I still think this is a good feature.
Since the tab is an interactive UI, the steps are as follows.
-
Run
/claude-api cost-optimize
-
Select a scope from the scan results (
2. Target genu54's GenU)
-
The Claude project (repository) is analyzed and a report is output.

In the above, the artifact-design skill was automatically executed, the browser launched, and a report like the following was displayed. (After running it several times, there are also cases where you are asked whether to output the report as an Artifact.)

Closing Thoughts
With the addition of the /claude-api cost-optimize tool and the Sonnet 5 auto-compact 1M expansion, I feel this is a release that raises the daily usability by another notch. For those running long sessions that use up the 1M context, this is likely a particularly noticeable change.
For those who routinely use hooks and subagents, or those deploying organizationally with managed settings, I encourage you to check the relevant fixes and changes and give the update a try.
References
