npm 安装方式已废弃,应改用官方脚本或 Homebrew/WinGet;安装后需进入项目目录再运行 claude;使用需 Anthropic 账号并会收集使用与对话数据
claude-code
anthropics活跃维护终端里的智能编码助手,能理解你的代码库,用自然语言帮你执行日常任务、解释复杂代码、处理 git 工作流,让写代码更快。
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
curl -fsSL https://claude.ai/install.sh | bash
claudeREADME 未说明硬件要求,仅标注需要 Node.js 18+(npm 安装方式)
终端里的智能编程助手,用自然语言理解代码库并执行日常开发任务
终端里的智能编码助手,能理解你的代码库,用自然语言帮你执行日常任务、解释复杂代码、处理 git 工作流,让写代码更快。
核心能力
- 用自然语言命令执行日常编码任务
- 理解整个代码库并解释复杂代码
- 处理 git 工作流
- 可在终端、IDE 或 GitHub 中 @claude 使用
- 通过插件目录扩展功能
容易踩的坑
- v2.1.321最新正式版2026-11-09 · 2026-11-09 19:22 UTC
What's changed
- Added Claude Fable 5.2 (
claude-fable-5-2), now the default Fable model — 1M context, $8/$40 per Mtok with $0.20/Mtok cache reads - Added
--settings <file>toclaude remote-control, which applies a settings file to every session it starts; if the file changes, no new session starts until you restartclaude remote-control - Fixed MCP OAuth requests sending secrets such as refresh tokens to another host when a server redirected them
- Fixed a case where a read-only Bash command ran outside the sandbox without a permission prompt
- Fixed a case where Bash permission checks judged a file write from the wrong folder and didn't prompt
- Fixed deny rules and protected-file prompts not applying to the file that a
cpormvinto a directory writes - Fixed the "Draws from usage credits" note showing after a switch to Fable on Enterprise seats whose plan includes Fable
- Fixed the fallback model sometimes declining a request or mentioning a stopped response when the first model was blocked before replying
- Fixed
claude mcp loginprinting a SEP-2352 issuer warning each time you sign in again to a server that Claude Code registered with - Fixed
NotebookEditdeleting or overwriting a notebook's first cell when the call named no cell, on network paths (UNC shares, WSL folders,/netmounts) - Fixed Edit changing the first of several matches, replacing a whole file on an empty
old_string, or editing a notebook as text, on network paths (UNC shares, WSL folders,/netmounts) - Fixed
/configshowing Manual as the default permission mode when new sessions start in auto mode; pressing Space on "Auto (default)" now saves Don't Ask, not Plan - Windows: Fixed
FileChangedhooks stopping for paths set throughwatchPathsafter the first shell command, when the session's working directory had a lowercase drive letter - Fixed
--plugin-dir .and--plugin-dir ./builtinwriting generated type files for Claude Code's built-in plugins into abuiltinfolder - Fixed context usage estimates overcounting tool definitions when exact token counts are unavailable
- Fixed
/compactshowing twice in Remote Control on web and mobile - Fixed plugin auto-updates and
/pluginmarketplace updates downloading a plugin again for each worktree or folder of a repository - Fixed auto mode losing a background subagent's report that had started a turn when the conversation was compacted before Claude answered it
- Fixed project skills, commands and agents staying missing after their folder was removed and came back mid-session, such as with
git stash, including after entering a worktree - Fixed
claude -psometimes telling Claude that background commands get 30 minutes when they are stopped after 10 - Fixed
pkill,pgrepandpidwaitin cloud sessions matching the session's own parent processes - Fixed Claude in Chrome and computer use server processes staying alive after their parent exits behind a proxy that stalls connections
- Fixed a large hook output pointing Claude to a file that held another hook's output from the same tool call
- Fixed apps that embed Claude Code getting their own PreToolUse hook's
askreason instead of another hook's when both asked - Fixed a PreToolUse hook's
askbeing lost when another hook'sdeferfinished first and could not be honored - Fixed a rare crash on permission prompts and background tasks
- Fixed project skills, commands and agents disappearing from the menu in SDK and desktop sessions after Claude entered a worktree
- Fixed
/desktopon macOS saying Claude Desktop is not installed when it is in~/Applications - Fixed OpenTelemetry repository attributes (
vcs.*) missing from Claude Desktop sessions that start on a pre-started process - Fixed WebFetch passing "No response from model" to Claude as page content when the model reading the page returned no text; the call now fails with a clear error
- Fixed screen reader mode delaying the prompt at startup when the system c
- Added Claude Fable 5.2 (
- v2.1.3192026-11-06 · 2026-11-06 17:04 UTC
查看更新说明
What's changed
- Changed auto mode with telemetry or feature flags off, including behind LLM gateways: calls the server can't check are asked about or denied, with no fallback to the built-in classifier; set
CLAUDE_CODE_AUTO_MODE_SERVER=0to keep using it (Bedrock, Vertex and Foundry are unchanged) - Changed auto mode behind an LLM gateway:
CLAUDE_CODE_AUTO_MODE_SERVER=1turns on the server-side check even withCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASset; if managed settings set the latter, they must set the1too - Added support for MCP tasks in the terminal: when an MCP server runs a tool call as a task, Claude Code moves it to the background right away and tells Claude the result when it finishes
- Added the
CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUNDenvironment variable to make Claude Code wait for an MCP task inside its tool call instead of moving it to the background right away - Added
permissions.denyInsteadOfPromptingsetting: a tool call that would wait on a permission prompt is denied and the turn continues, in terminal sessions, subagents and teammates - Added
/claude-api latency-optimizeto find where your Claude API code makes people wait and try faster settings against your eval - Added the
CLAUDE_CODE_DISABLE_FEATURE_FLAGSenvironment variable, which stops feature-flag fetching without turning off telemetry; every flag then uses its built-in default - Added spend for today, this week and this month to
/usagefor developers behind a Claude apps gateway who have no spend limit, when the gateway runs this version or later - Added
admin.pooled_conflict_ruleandadmin.pooled_priority_orderto the Claude apps gateway, to set which pooled group budget pays first for a developer in several groups - Added an optional
login_noticesetting to the Claude apps gateway that shows an operator-defined message on the gateway's browser verification page and on Claude Code's sign-in screen - Added
CLAUDE_GATEWAY_LOG_FORMAT=jsonto the Claude apps gateway: operational log lines become JSON withseverity,timeandmessage, for log collectors that read the level from a field - Added a Claude apps gateway boot warning for a case where another policy's
availableModelsalso allows a custom model id that one policy lists by name - Added start-up warnings to the Claude apps gateway for policies with no
desktopHomethat rely oncoworkTabEnabled: falseorchatSessionRetentionDays, ahead of Claude Desktop's November 10 change - Added a warning when your claude.ai login ends and Claude Code continues on the sign-in from
ant auth login, which bills usage to your Claude Console organization - Added a line at startup naming the Claude Console organization that is billed in a case where Claude Code uses the sign-in from
ant auth login - Added an "Earlier in this session" row to
/tasksthat lists finished subagents, so you can reopen one and message it even after it leaves the list or you restart - Added a note to
/loopconfirmations in cloud sessions that a timer stops with its container, with an offer of a loop that survives - Fixed MCP servers on the older handshake failing to connect, or returning empty results, because Claude Code declared an extension that it only uses with newer servers
- Fixed a long-running MCP tool call on a claude.ai connector sometimes never reporting its result after
--resume - Fixed a session's diff failing to load on claude.ai and the mobile apps when the folder Claude Code runs in has a file or folder named
HEAD - Fixed
/diffshowing "Diff unavailable" when a git repository has a file or folder namedHEADat its top level - Fixed the
/diffpane opening blank in sessions where 64 or more turns edited files - Fixed slash commands typed after a leading space, tab or newline being sent to Claude as plain text instead of running
- Fixed a request that kept failing with a 401 refreshing your login on every retry and causing 401s in your other sessions
- Fixed `/co
- Changed auto mode with telemetry or feature flags off, including behind LLM gateways: calls the server can't check are asked about or denied, with no fallback to the built-in classifier; set
- v2.1.3182026-11-04 · 2026-11-04 00:01 UTC
查看更新说明
What's changed
- Added a record of your answer when Claude Code asks to turn on the mods it writes in a session
- Added
assume_roleonmantleupstreams of the Claude apps gateway, for a role in another AWS account and for per-developer AWS cost attribution - Added an
effortoption to a mod's$.model.fork, so a quick side job can run atlowwhatever effort the session uses; the result reports the effort sent - Added the date a stored claude.ai sign-in ends to
claude auth status(loginExpiresAt) and toclaude -pJSON results (credential_expires_at) - Added a one-line stderr warning to
claude -ptext output, starting 10 days before a stored claude.ai sign-in ends - Fixed
--continuesometimes losing the earlier conversation after a malformed tool call's retries ran out (regression in 2.1.314) - Fixed macOS sessions with many running Bash commands stalling while memory grew
- Fixed permission prompts being answered by keys typed just after sending a message, or before a slow prompt appeared
- Fixed
/logout,claude auth logoutandclaude mcp removereporting success, and changes to trust, consent or MCP settings being dropped with no word, when the config file could not be updated on a shared network home directory - Fixed jobs exiting with
Not logged inwhen another terminal or host signs in again to the same account and organization on the same home - Fixed
claude mcp addandremovewriting the config without its lock: they now wait for it or exit 1, though another job's save can still replace a saved server - Fixed
claude plugincommands exiting before a slow token refresh was saved, which could sign you out on the next run - Fixed
claude plugin validatepassing a custom-named marketplace file thatclaude plugin marketplace addrejects - Fixed stdio MCP servers that exit on the version probe being re-probed on every start; a server that dies in under 3s for its own reason is also pinned to the legacy handshake for 7 days
- Fixed sessions being refused at startup by an
allowedProviderslist that another login on the same machine had stored - Fixed idle compaction replacing a conversation with a reply that was not a summary
- Fixed the "Now using usage credits" notice reappearing about every 30 seconds while a background subagent is running
- Fixed custom slash commands that fail, or that only Claude can invoke, printing nothing in
claude -pand SDK sessions - Fixed
claude -pand Agent SDK sessions reporting success when an API error cut off a reply while a mod hookedturn.step - Fixed a message sent right after a model change still running after Stop in headless sessions: Stop now cancels or stops it as it would a queued message
- Fixed a deleted session transcript being re-created with its last prompt when an idle non-interactive session exited
- Fixed
claude remote-controlhosts, the background daemon and self-hosted runners failing to start new sessions (spawn ENOENT) after an update or version cleanup removed the binary of a still-running process - Fixed a running Claude Code process owned by another user (for example one left by
sudo claude) being treated as dead by version cleanup, which could delete its binary - Fixed
/remote-controlshowing a session as available after a failed connection - Fixed
/design revokereporting success when the request failed with a 404 - Fixed a shell command approved after a self-hosted runner or cloud session restart running in the session's start folder, not the folder it was asked in; if that folder can't be entered, it is not run
- Fixed Claude not being told when an approved connector tool was unavailable after a cloud session restart
- Fixed cloud sessions being stopped in the middle of a turn when the service refuses uploads for several minutes
- Fixed variables a
Setuphook writes toCLAUDE_ENV_FILEnot reaching the Bash tool in some cloud sessions - Fixed the iPhone app showing a cloud session's turn as finished while it
- v2.1.3172026-11-03 · 2026-11-03 01:25 UTC
查看更新说明
What's changed
- Added a warning to
/schedulewhen a new cloud scheduled task gets connectors you did not ask for, with how to remove them - Added a check that asks before a web or shell tool call sends your account email address to the network
- Added
onFailure: "block"for Agent SDK hook callbacks, so a callback that fails blocks the action instead of letting it run - Added a notice in Claude Desktop's Code tab when your organization's remote managed settings haven't loaded for the session, and another once they do
- Added a notice when auto mode's check has no answer for a subagent's tool call, which used to leave nothing in the main view
- Added
anthropic.plan,anthropic.seat_type,anthropic.providerandanthropic.custom_base_urlto OTel metrics, events and spans - Added a cost report to the Claude apps gateway admin API,
GET /v1/organizations/analytics/cost, for reading past spend over a date range in total, per developer, per day or per IdP group - Added a daily record of each developer's IdP groups on Claude apps gateways with
admin:set, kept foradmin.identity_retention_days, which the cost report groups by - Added
CLAUDE_CODE_DISABLE_NESTED_SESSION_ID: set it to1on a self-hosted runner to haveclaude -prun inside a session use that session's ID and transcript, as in earlier versions - Fixed project and local MCP servers disconnecting after the first turn in some Claude desktop sessions
- Fixed auto mode failing every turn when an LLM gateway set as the base URL answers 403 or 422 to its server-side safety check (a 403 with an apiKeyHelper is unchanged)
- Fixed
claude auth statusexiting before a slow token refresh was saved, which could sign you out on the next run - Fixed a project's
effortLevelsetting being ignored by sessions that an app starts ahead of time and then opens in the project, such as new sessions in the desktop app's Code tab - Fixed
claude --from-prreporting "No conversations found" in projects with many sessions when the linked session was older than the first page - Fixed the second of two simultaneous permission prompts showing no file path or command on claude.ai and the mobile apps
- Fixed Remote Control and SDK hosts offering "don't ask again" on a mod's tool calls
- Fixed session titles being lost in cloud and SDK sessions when a new message or Stop arrived while the title was generating
- Fixed self-paced
/loopwakeups sometimes not being scheduled when Claude left a field out of its request - Fixed auto mode in cloud sessions stopping for approval when the Artifact tool uploaded, wrote to a database or saved a file through the outputs folder
- Fixed skills synced from claude.ai being lost or downloaded again every ten minutes when they can't be written to disk
- Fixed
/scheduleleaving a cloud scheduled task's next run time and link out of its results after creating or updating it - Fixed screen readers speaking a running subagent's elapsed time and token count on every change in screen reader mode
- Fixed a region or network block (HTTP 403) being shown as a sign-in failure; the error now explains the block
- Fixed Claude saying a working claude.ai connector needed authorization or had failed in cloud sessions when a synced plugin included the same server
- Fixed
claude -pexiting 0 when a full disk or quota lost its transcript or ~/.claude.json writes; it now prints an error and, in text and json output, exits 1. Full NFS exports may be missed - Fixed edits to settings files made in the first second or so after launch not taking effect until a settings file changed again
- Fixed old transcripts not being cleaned up on machines where some runs skip cleanup, such as runs using
--setting-sources - Fixed deleted agent team inboxes being re-created by a teammate's late message
- Fixed a re-created agent teammate being removed from its team by an earlier shutdown approval
- Fixed stored scheduled tasks being impossible to list or delete after schedu
- Added a warning to
- v2.1.3162026-10-31 · 2026-10-31 01:01 UTC
查看更新说明
What's changed
- Added
CLAUDE_CODE_DISABLE_ULTRATHINK, which turns theultrathinkkeyword off - Added pooled group budgets to the Claude apps gateway: one monthly budget that a group's members share, on top of each member's own limit, set with
pooled_budgeton the spend limits admin API - Added
CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROPto keep system cross-certificates that certify each other in a loop, for servers whose private CA needs one - Added
CLAUDE_CODE_SUBAGENT_EFFORTto set the effort level subagents run at when nothing else names one, instead of inheriting the session's - Added
managed.policy_mode: layeredto the Claude apps gateway: every policy that matches a developer applies, each merged over the ones listed below it, not only the first - Added
guardrail.input_taggingon Claude apps gateway Bedrock upstreams, which wraps prompts in the input tags that an Amazon Bedrock guardrail's prompt attacks filter needs;all_messages_and_systemalso tags the system prompt - Deprecated fast mode for Opus 4.8 as of October 30, 2026; it will be removed on November 30, 2026. After removal, fast mode requests on Opus 4.8 return an error and do not fall back to standard Opus 4.8. Migrate to Opus 5.5 to keep the speedup
- Fixed shell commands being left running on macOS and Linux when Claude Code exits by itself, for example when credentials are refused or a cloud session is archived
- Fixed bash aliases with line breaks in their value (except in Git Bash), and functions whose names start with a dash, being garbled or lost in the Bash tool's shell
- Fixed bash scripts started from the Bash tool stopping after their first command when
SHELLOPTSis exported - Fixed PowerShell hooks not blocking on exit code 2 when the command begins with a type cast,
param,usingor an attribute - Fixed some network requests hanging when a compressed response was cut off or corrupted
- Fixed
sonnet,opusandhaikuon Vertex AI and Amazon Bedrock showing an error mid-session instead of switching to an older model when the newest is not yet available to the account or region - Fixed the Claude apps gateway not checking every model a request names against
availableModels,deniedModelsandmodels; a request that names a blocked model now gets a 400 naming the field - Fixed
claude auth loginrefusing to run where managed settings require a Claude apps gateway; in a terminal it now shows the gateway sign-in - Fixed
--restrictedsessions uploading files from outside the working directories when a Read allow rule covered them - Fixed prompts containing invisible characters needing a second Enter to send; plain prompts now send cleaned on the first Enter, and commands still wait for review
- Fixed sub-agents that inherited a parent sub-agent's model moving to the main model when a background job or message woke them
- Fixed a managed
autoMode.allowlist without"$defaults"getting the built-in exceptions back from a host app's--settings, a first rule added in/permissions, or/auto-mode-setup - Fixed cloud sessions and cloud scheduled tasks not being marked as failed when auto mode stopped a turn because the server returned no safety verdict
- Fixed
claude -ptext output sometimes not saying why auto mode stopped a turn when a background agent was still running - Fixed
CLAUDE_CODE_AUTO_MODE_SERVER=1being ignored in sessions started by a host application (such as Claude Desktop) behind a proxy or LLM gateway with experimental betas turned off - Fixed plugin MCP
headersHelperscripts receiving a corruptedCLAUDE_PLUGIN_ROOTand server URL when a credential-named environment variable was set to a switch value such as1 - Fixed the SDK
register_repo_rootcontrol request not loading the CLAUDE.md of a directory outside the working directory (withCLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1) - Fixed the Artifact tool showing
?for artifact database access rules at theselflevel, and not q
- Added
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Claude Code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows -- all through natural language commands. Use it in your terminal, IDE, or tag @claude on Github.
Learn more in the official documentation.
Get started
[!NOTE] Installation via npm is deprecated. Use one of the recommended methods below.
For more installation options, uninstall steps, and troubleshooting, see the setup documentation.
-
Install Claude Code:
MacOS/Linux (Recommended):
curl -fsSL https://claude.ai/install.sh | bashHomebrew (MacOS/Linux):
brew install --cask claude-codeWindows (Recommended):
irm https://claude.ai/install.ps1 | iexWinGet (Windows):
winget install Anthropic.ClaudeCodeNPM (Deprecated):
npm install -g @anthropic-ai/claude-code -
Navigate to your project directory and run
claude.
Plugins
Anthropic's Claude Code plugins are developed in claude-plugins-official. See the plugins directory for more about plugins.
Reporting Bugs
We welcome your feedback. Use the /bug command to report issues directly within Claude Code, or file a GitHub issue.
Connect on Discord
Join the Claude Developers Discord to connect with other developers using Claude Code. Get help, share feedback, and discuss your projects with the community.
Data collection, usage, and retention
When you use Claude Code, we collect feedback, which includes usage data (such as code acceptance or rejections), associated conversation data, and user feedback submitted via the /bug command.
How we use your data
See our data usage policies.
Privacy safeguards
We have implemented several safeguards to protect your data, including limited retention periods for sensitive information, restricted access to user session data, and clear policies against using feedback for model training.
For full details, please review our Commercial Terms of Service and Privacy Policy.