clangd-lsp — Claude Code plugin for C/C++: what it does
Wires the clangd language server into Claude, so the agent gets code intelligence, diagnostics and formatting for C and C++.
/plugin install clangd-lsp@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-officialWhat clangd-lsp does
The plugin connects Claude to clangd, the language server for C and C++. Inside a session you get go-to-definition, error diagnostics and formatting. It covers .c, .h, .cpp, .cc, .cxx, .hpp, .hxx, .C and .H files.
clangd itself is not bundled, so install it first. On macOS that means brew install llvm, and the LLVM binaries are not on your PATH by default — the README suggests adding /opt/homebrew/opt/llvm/bin to PATH. On Linux, use your package manager: sudo apt install clangd on Ubuntu and Debian, sudo dnf install clang-tools-extra on Fedora, sudo pacman -S clang on Arch. On Windows, winget install LLVM.LLVM or a build from the LLVM releases.
If clangd is missing from PATH, the plugin has nothing to talk to, so check that before blaming the setup. Projects with a custom build usually need a compile_commands.json too, otherwise diagnostics complain about headers they cannot resolve.
What it helps with
- see C++ diagnostics without leaving Claude
- jump to a function definition in a large C codebase
- format a
.cppfile the way clangd does - track down compile errors while staying in the agent
- give the agent language-server support for
.hheaders
Example prompts for the agent
- Run clangd diagnostics on
src/main.cpp - Find the definition of
parse_configin this project - Format
include/utils.hppwith clangd
How to install clangd-lsp
Plugin marketplace
/plugin install clangd-lsp@claude-plugins-official/plugin marketplace add anthropics/claude-plugins-officialStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about clangd-lsp
How do I install clangd-lsp in Claude?
Add the marketplace first: /plugin marketplace add anthropics/claude-plugins-official, then install the plugin: /plugin install clangd-lsp@claude-plugins-official.
What does clangd-lsp do?
It connects the clangd language server to Claude for C and C++. The agent gains diagnostics, navigation and formatting.
Do I need to install clangd separately?
Yes. The plugin only links Claude to clangd; the server comes from a package manager — brew install llvm on macOS, sudo apt install clangd on Ubuntu and Debian, winget install LLVM.LLVM on Windows.
Source text
clangd-lsp · Apache-2.0
# 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)
© Anthropic · Apache-2.0 · anthropics/claude-plugins-official