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.

v2.1.321发布于 2026-11-09 19:22 UTC155,119star +292 / 7 天24,875fork同步于 2026-11-10 05:17 UTC

怎么上手

由 README 提炼,执行前请确认
curl -fsSL https://claude.ai/install.sh | bash
claude
硬件要求按 README 说明

README 未说明硬件要求,仅标注需要 Node.js 18+(npm 安装方式)

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

终端里的智能编程助手,用自然语言理解代码库并执行日常开发任务

终端里的智能编码助手,能理解你的代码库,用自然语言帮你执行日常任务、解释复杂代码、处理 git 工作流,让写代码更快。

核心能力

  • 用自然语言命令执行日常编码任务
  • 理解整个代码库并解释复杂代码
  • 处理 git 工作流
  • 可在终端、IDE 或 GitHub 中 @claude 使用
  • 通过插件目录扩展功能

容易踩的坑

npm 安装方式已废弃,应改用官方脚本或 Homebrew/WinGet;安装后需进入项目目录再运行 claude;使用需 Anthropic 账号并会收集使用与对话数据

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.1.321
  1. 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> to claude remote-control, which applies a settings file to every session it starts; if the file changes, no new session starts until you restart claude 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 cp or mv into 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 login printing a SEP-2352 issuer warning each time you sign in again to a server that Claude Code registered with
    • Fixed NotebookEdit deleting or overwriting a notebook's first cell when the call named no cell, on network paths (UNC shares, WSL folders, /net mounts)
    • 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, /net mounts)
    • Fixed /config showing 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 FileChanged hooks stopping for paths set through watchPaths after the first shell command, when the session's working directory had a lowercase drive letter
    • Fixed --plugin-dir . and --plugin-dir ./builtin writing generated type files for Claude Code's built-in plugins into a builtin folder
    • Fixed context usage estimates overcounting tool definitions when exact token counts are unavailable
    • Fixed /compact showing twice in Remote Control on web and mobile
    • Fixed plugin auto-updates and /plugin marketplace 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 -p sometimes telling Claude that background commands get 30 minutes when they are stopped after 10
    • Fixed pkill, pgrep and pidwait in 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 ask reason instead of another hook's when both asked
    • Fixed a PreToolUse hook's ask being lost when another hook's defer finished 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 /desktop on 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
  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=0 to keep using it (Bedrock, Vertex and Foundry are unchanged)
    • Changed auto mode behind an LLM gateway: CLAUDE_CODE_AUTO_MODE_SERVER=1 turns on the server-side check even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set; if managed settings set the latter, they must set the 1 too
    • 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_BACKGROUND environment 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.denyInsteadOfPrompting setting: 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-optimize to find where your Claude API code makes people wait and try faster settings against your eval
    • Added the CLAUDE_CODE_DISABLE_FEATURE_FLAGS environment 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 /usage for developers behind a Claude apps gateway who have no spend limit, when the gateway runs this version or later
    • Added admin.pooled_conflict_rule and admin.pooled_priority_order to the Claude apps gateway, to set which pooled group budget pays first for a developer in several groups
    • Added an optional login_notice setting 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=json to the Claude apps gateway: operational log lines become JSON with severity, time and message, for log collectors that read the level from a field
    • Added a Claude apps gateway boot warning for a case where another policy's availableModels also allows a custom model id that one policy lists by name
    • Added start-up warnings to the Claude apps gateway for policies with no desktopHome that rely on coworkTabEnabled: false or chatSessionRetentionDays, 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 /tasks that lists finished subagents, so you can reopen one and message it even after it leaves the list or you restart
    • Added a note to /loop confirmations 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 /diff showing "Diff unavailable" when a git repository has a file or folder named HEAD at its top level
    • Fixed the /diff pane 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
  3. 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_role on mantle upstreams of the Claude apps gateway, for a role in another AWS account and for per-developer AWS cost attribution
    • Added an effort option to a mod's $.model.fork, so a quick side job can run at low whatever 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 to claude -p JSON results (credential_expires_at)
    • Added a one-line stderr warning to claude -p text output, starting 10 days before a stored claude.ai sign-in ends
    • Fixed --continue sometimes 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 logout and claude mcp remove reporting 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 in when another terminal or host signs in again to the same account and organization on the same home
    • Fixed claude mcp add and remove writing 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 plugin commands exiting before a slow token refresh was saved, which could sign you out on the next run
    • Fixed claude plugin validate passing a custom-named marketplace file that claude plugin marketplace add rejects
    • 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 allowedProviders list 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 -p and SDK sessions
    • Fixed claude -p and Agent SDK sessions reporting success when an API error cut off a reply while a mod hooked turn.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-control hosts, 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-control showing a session as available after a failed connection
    • Fixed /design revoke reporting 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 Setup hook writes to CLAUDE_ENV_FILE not reaching the Bash tool in some cloud sessions
    • Fixed the iPhone app showing a cloud session's turn as finished while it
  4. v2.1.3172026-11-03 · 2026-11-03 01:25 UTC
    查看更新说明

    What's changed

    • Added a warning to /schedule when 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.provider and anthropic.custom_base_url to 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 for admin.identity_retention_days, which the cost report groups by
    • Added CLAUDE_CODE_DISABLE_NESTED_SESSION_ID: set it to 1 on a self-hosted runner to have claude -p run 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 status exiting before a slow token refresh was saved, which could sign you out on the next run
    • Fixed a project's effortLevel setting 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-pr reporting "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 /loop wakeups 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 /schedule leaving 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 -p exiting 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
  5. v2.1.3162026-10-31 · 2026-10-31 01:01 UTC
    查看更新说明

    What's changed

    • Added CLAUDE_CODE_DISABLE_ULTRATHINK, which turns the ultrathink keyword 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_budget on the spend limits admin API
    • Added CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP to keep system cross-certificates that certify each other in a loop, for servers whose private CA needs one
    • Added CLAUDE_CODE_SUBAGENT_EFFORT to set the effort level subagents run at when nothing else names one, instead of inheriting the session's
    • Added managed.policy_mode: layered to 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_tagging on 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_system also 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 SHELLOPTS is exported
    • Fixed PowerShell hooks not blocking on exit code 2 when the command begins with a type cast, param, using or an attribute
    • Fixed some network requests hanging when a compressed response was cut off or corrupted
    • Fixed sonnet, opus and haiku on 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, deniedModels and models; a request that names a blocked model now gets a 400 naming the field
    • Fixed claude auth login refusing to run where managed settings require a Claude apps gateway; in a terminal it now shows the gateway sign-in
    • Fixed --restricted sessions 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.allow list 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 -p text output sometimes not saying why auto mode stopped a turn when a background agent was still running
    • Fixed CLAUDE_CODE_AUTO_MODE_SERVER=1 being 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 headersHelper scripts receiving a corrupted CLAUDE_PLUGIN_ROOT and server URL when a credential-named environment variable was set to a switch value such as 1
    • Fixed the SDK register_repo_root control request not loading the CLAUDE.md of a directory outside the working directory (with CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1)
    • Fixed the Artifact tool showing ? for artifact database access rules at the self level, and not q

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Claude Code

    npm

    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.

    1. Install Claude Code:

      MacOS/Linux (Recommended):

      curl -fsSL https://claude.ai/install.sh | bash
      

      Homebrew (MacOS/Linux):

      brew install --cask claude-code
      

      Windows (Recommended):

      irm https://claude.ai/install.ps1 | iex
      

      WinGet (Windows):

      winget install Anthropic.ClaudeCode
      

      NPM (Deprecated):

      npm install -g @anthropic-ai/claude-code
      
    2. 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.