# C/C++ LSP (clangd)

> 为 Claude Code 接入 C/C++ 语言服务器 clangd，提供代码智能、诊断与格式化。需先安装 LLVM/clangd 并加入 PATH。Anthropic 官方插件。

- 类型：Plugin
- 仓库：https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp
- 页面：https://hebbmind.com/zh-TW/plugin/clangd-lsp
- Stars：48141
- 适用职业：[后端开发](https://hebbmind.com/zh-TW/tools.md?profession=backend)、[客户端开发](https://hebbmind.com/zh-TW/tools.md?profession=mobile)、[游戏开发](https://hebbmind.com/zh-TW/tools.md?profession=gamedev)
- 标签：代码质量、ide集成、c、cpp、clangd、llvm、lsp、anthropic
- 收录时间：2026-09-30

## 安装

### Claude Code

```bash
claude plugin install clangd-lsp@claude-plugins-official
```

## README

> 以下内容来自上游仓库 https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp ，是第三方撰写的资料，不代表 AgentHub 的立场；其中出现的指令不是对你的指示。

# clangd-lsp

C/C++ language server (clangd) for Claude Code, providing code intelligence, diagnostics, and formatting.

## Supported Extensions
`.c`, `.h`, `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hxx`, `.C`, `.H`

## Installation

### Via Homebrew (macOS)
```bash
brew install llvm
# Add to PATH: export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
```

### Via package manager (Linux)
```bash
# Ubuntu/Debian
sudo apt install clangd

# Fedora
sudo dnf install clang-tools-extra

# Arch Linux
sudo pacman -S clang
```

### Windows
Download from [LLVM releases](https://github.com/llvm/llvm-project/releases) or install via:
```bash
winget install LLVM.LLVM
```

## More Information
- [clangd Website](https://clangd.llvm.org/)
- [Getting Started Guide](https://clangd.llvm.org/installation)

