# 使用 Homebrew Cask 安装 claude-code

查看 claude-code 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install cask:claude-code
```

## 代理安全回答

claude-code is an AI coding agent with local file and command access potential.

- **凭据访问:** May access project files, model credentials, and local tool configs exposed to the session.
- **远程变更:** Can drive tools that mutate Git, cloud, package, or deployment state.
- **发布/制品风险:** Can generate code and execute release or deployment commands.
- **推荐控制:** Run under containment and gate sensitive host tool actions.
- **代理使用指南:** Limit workspace scope; require approval before secret exposure, publishing, or remote writes.

其他安装命令:

### macOS

- Homebrew Cask (100%):

```sh
brew install --cask claude-code
```

  证据: local Homebrew cask metadata

## 软件包事实

- **软件包键:** cask:claude-code
- **软件包管理器:** Homebrew Cask
- **版本:** 2.1.212
- **来源摘要:** Terminal-based AI coding assistant
- **主页:** <https://claude.com/product/claude-code>
- **最后更新:** 2026-07-25T04:41:07Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- claude (二进制)
- claude (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.1.212
## 项目历史与用法

Claude Code is Anthropic's agentic coding tool for the terminal and related developer surfaces. Official docs describe it as a coding assistant that reads a codebase, edits files, runs commands, integrates with development tools, and works across terminal, IDE, desktop, browser, and automation surfaces.

### 项目历史

Anthropic introduced Claude Code on February 24, 2025 alongside Claude 3.7 Sonnet, calling it a limited research preview for delegating substantial engineering tasks to Claude directly from a terminal. The npm registry records the `@anthropic-ai/claude-code` package as created the same day.

The project later shifted away from npm as the preferred install path. The official GitHub README now says npm installation is deprecated and points users to native installers, Homebrew, WinGet, and setup documentation. Official docs describe Claude Code as available through terminal, VS Code, JetBrains, desktop, web, GitHub/GitLab CI, Slack, and other workflow surfaces.

### 采用历史

Official distribution broadened from the original npm package to native install scripts for macOS, Linux, WSL, and Windows, Homebrew casks, WinGet, and Linux package managers including apt, dnf, and apk. Homebrew's `claude-code` cask tracks the stable channel, while docs mention `claude-code@latest` for the latest channel.

The npm registry remains a useful historical source: it records 448 package versions and published version 2.1.196 by June 2026. Homebrew cask metadata records the cask binary artifact as `claude`, with cask zap paths covering Claude cache, config, local state, and `.claude` directories.

### 使用方式

The CLI is launched as `claude` from a project directory. Official docs highlight workflows such as building features, fixing bugs, writing tests, resolving merge conflicts, updating dependencies, creating commits and pull requests, connecting tools through MCP, customizing with CLAUDE.md, skills, and hooks, and piping command output into the CLI.

Claude Code stores settings in user and project scopes: `~/.claude/settings.json`, `.claude/settings.json`, and `.claude/settings.local.json`; it stores other configuration in `~/.claude.json` and project MCP servers in `.mcp.json`. These files became a configuration surface for many companion tools in this batch.

### 为什么软件包爱好者会关心

Claude Code is package-nerd significant because it rapidly turned an AI coding assistant into a multi-channel developer toolchain package: npm for early installs, native auto-updating binaries, Homebrew casks, WinGet manifests, Linux packages, IDE extensions, and CI actions all point at the same underlying agent.

It also created a secondary package ecosystem. Tools such as Claude Code Router, Claude Code Templates, claude-cmd, claude-hooks, and Claude Squad exist because Claude Code exposes configurable files, commands, hooks, MCP servers, worktrees, and terminal workflows that can be wrapped, routed, templated, or orchestrated.

### 时间线

- 2025-02-24: Anthropic announces Claude Code as a limited research preview with Claude 3.7 Sonnet.
- 2025-02-24: npm registry records creation of `@anthropic-ai/claude-code`.
- 2026: Official README marks npm installation deprecated in favor of native install, Homebrew, and WinGet.
- 2026-06: npm registry records published version 2.1.196 after 448 published versions.

### Related projects

- Claude 3.7 Sonnet is the model announcement alongside Claude Code's public research preview.
- Model Context Protocol is documented by Claude Code as the way to connect external tools and data sources.
- Claude Code Router, Claude Code Templates, claude-cmd, claude-hooks, and Claude Squad are related companion packages in this batch.
- Anthropic's VS Code, JetBrains, desktop, web, Slack, GitHub Actions, and GitLab CI/CD integrations are official adjacent surfaces.

### 来源

- <https://www.anthropic.com/news/claude-3-7-sonnet>
- <https://github.com/anthropics/claude-code>
- <https://code.claude.com/docs/en/overview.md>
- <https://code.claude.com/docs/en/setup.md>
- <https://code.claude.com/docs/en/settings.md>
- <https://registry.npmjs.org/@anthropic-ai%2fclaude-code>
- <https://formulae.brew.sh/api/cask/claude-code.json>


## 安全说明

没有找到 claude-code 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.claude/settings.json, .claude/settings.json, .claude/settings.local.json, ~/.claude.json, .mcp.json
- Windows: %USERPROFILE%\.claude\settings.json, .claude\settings.json, .claude\settings.local.json, %USERPROFILE%\.claude.json, .mcp.json

## Credential files

- Linux: ~/.claude/.credentials.json
- Windows: %USERPROFILE%\.claude\.credentials.json
## 其他软件包管理器记录

- Nix - claude-code: normalized package name match | nixpkgs package indexes: pkgs/by-name/cl/claude-code/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - claude-code: normalized package name match | MacPorts ports tree: llm/claude-code/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - claude-code: normalized package name match | Chocolatey community package catalog: claude-code from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','chocolatey-misc-helpers.extension'
- Scoop - main/claude-code: normalized package name match | Scoop official bucket manifest trees: bucket/claude-code.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Anthropic.ClaudeCode: normalized package name match | Windows Package Manager source index: Anthropic.ClaudeCode from https://cdn.winget.microsoft.com/cache/source.msix
- winget - ronghuaxueleng.ClaudeCodeConfigManager.CLI: normalized package name match | Windows Package Manager source index: ronghuaxueleng.ClaudeCodeConfigManager.CLI from https://cdn.winget.microsoft.com/cache/source.msix
- Chocolatey - claude: installed executable or alias match | Chocolatey community package catalog: claude from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','chocolatey-misc-helpers.extension'
- Scoop - extras/claude: installed executable or alias match | Scoop official bucket manifest trees: bucket/claude.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1
- winget - Anthropic.Claude: installed executable or alias match | Windows Package Manager source index: Anthropic.Claude from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [claude-code](https://pkg.so/zh-hans/pkg/npm/claude-code/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/claude-code.yml](https://github.com/mxcl/pkgdb/blob/main/combined/claude-code.yml)


## 来源

- pkg.so package database
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
