Chapter 21 · Recent Updates and New Features
Chapter goals: Learn about Claude Code's important version updates in the recent month, master new feature usage, and keep the toolchain up-to-date.
21.1 Version Overview
Claude Code iterates extremely fast (almost daily releases). Here are近期 noteworthy versions:
| Version | Release Date | Core Changes |
|---|---|---|
| v2.1.241 | Recent | Bug fixes and reliability improvements |
| v2.1.240 | Recent | Bug fixes and reliability improvements |
| v2.1.239 | Recent | /claude-api upgrade command, Bedrock/Vertex full-screen renderer |
| v2.1.238 | Recent | keybindingFlavor setting, Plugin marketplace headersHelper |
| v2.1.237 | Recent | Built-in "Concise" output style, LLM gateway prompt caching fix |
21.2 /claude-api upgrade: SDK Migration Assistant
v2.1.239新增 the /claude-api upgrade slash command, which自动 migrates Python projects from Anthropic SDK 0.x to 1.x:
> /claude-api upgrade
Analyzing your project...
Found 12 files using anthropic 0.x API patterns.
Key changes:
- anthropic.Anthropic() → anthropic.Client()
- httpx.Timeout → anthropic.Timeout
- completion.model → response.model
Apply changes? [y/N]Migration注意事项:
- Timeout classes change from
httpx.Timeouttoanthropic.Timeout - Streaming callback signatures have changes -建议 running the test suite before committing
21.3 keybindingFlavor: Keybinding Styles
v2.1.238 introduced the keybindingFlavor setting, supporting Bash readline-style keybindings:
// ~/.claude/settings.json
{
"keybindingFlavor": "readline"
}After setting, Ctrl+W in the prompt deletes to the previous whitespace (consistent with Bash behavior). Default "classic" remains unchanged.
21.4 Plugin Marketplace headersHelper
v2.1.238 added the headersHelper mechanism to the plugin marketplace — when the marketplace URL需要 dynamic auth headers, specify a command to generate temporary tokens:
// marketplace.json
{
"url": "https://internal.company.com/plugins/catalog.json",
"headersHelper": "/usr/local/bin/get-plugin-token"
}This command executes only during plugin install or update; suitable for short-lived token scenarios, avoiding hardcoding long-term keys.
21.5 Concise Output Style
v2.1.237内置了 Concise output style. When enabled, Claude skips intros and narratives, outputting results directly:
/config → Output style → ConciseSuitable for experienced developers — reduces reading time without sacrificing code quality.
21.6 Bedrock/Vertex Support
Same version adds full-screen renderer support for Bedrock, Vertex AI, and Foundry users; newly installed on these platforms now defaults to full-screen TUI.
21.7 LLM Gateway Prompt Caching Fix
v2.1.237 fixed a issue where prompt caching failed when using自定义 base_url or an LLM gateway. If your organization routes API requests through a proxy, upgrading自动享受s cache discounts.
Chapter Summary
- Claude Code releases almost daily;关注 changelog to及时获取新功能;
/claude-api upgradeautomates SDK migration, reducing手工修改;keybindingFlavor: readlinemakes terminal veterans more comfortable;- Concise output style提升效率 by reducing无效 reading;
- Plugin headersHelper supports dynamic auth,适配 enterprise security policies.
🧪 随堂测验
点击你认为正确的选项。答错时会展示正确答案与原因解析。
1. What is the main purpose of the /claude-api upgrade command?
2. After setting keybindingFlavor to "readline", what does Ctrl+W do?
3. What problem does the Plugin marketplace headersHelper solve?
4. What is the effect of the Concise output style?
🛠️ Hands-on Practice
- Upgrade to the latest version
npm update -g @anthropic-ai/claude-code; check the changelog to confirm新特性. - Try switching to the Concise output style;对比前后的对话体验.
- Set
"keybindingFlavor": "readline"in settings.json; verify the Ctrl+W behavior change.