Clangd LSP

v1.0.0

C/C++ language server (clangd) providing code intelligence, diagnostics, and formatting for .c, .h, .cpp, .cc, .cxx, .hpp, .hxx files. Use when working with C or C++ code that needs autocomplete, go-to-definition, find references, error detection, or refactoring support.

0· 1.2k·4 current·4 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for bowen31337/clangd-lsp.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Clangd LSP" (bowen31337/clangd-lsp) from ClawHub.
Skill page: https://clawhub.ai/bowen31337/clangd-lsp
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install bowen31337/clangd-lsp

ClawHub CLI

Package manager switcher

npx clawhub@latest install clangd-lsp
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name, description, and SKILL.md all describe clangd-based C/C++ language-server functionality. The instructions only require standard LLVM/clang tooling and project build metadata (compile_commands.json/.clangd), which are appropriate and expected for this purpose.
Instruction Scope
SKILL.md stays on-topic: it explains how to install clangd, verify it, format/compile/analyze local source files, and configure project compile flags. It does not instruct reading or exfiltrating unrelated files, accessing secrets, or contacting unexpected external endpoints.
Install Mechanism
There is no automated install spec — the skill is instruction-only. It recommends standard, well-known package managers (brew/apt/dnf/pacman/winget) or official LLVM releases on GitHub, which is proportionate and low-risk compared with arbitrary download URLs or extract/install scripts.
Credentials
No environment variables, credentials, or configuration paths are required. The requested artifacts (compile_commands.json, .clangd) are project-local and appropriate for language-server operation.
Persistence & Privilege
always is false and the skill is user-invocable. There is no indication it attempts to persist or modify other skills or global agent configuration; autonomous invocation is allowed but is the platform default and not excessive here.
Assessment
This skill appears to be what it claims: a set of instructions for installing and using clangd and related LLVM tools. Before using it, be aware that: (1) you must install system packages (brew/apt/dnf/pacman/winget or GitHub releases) — only run installers you trust; (2) commands like clang-tidy --fix or build commands can modify files or run build steps, so review them before execution; and (3) avoid letting an agent run build or analysis on sensitive or untrusted code without review. If you want the agent to act on your code, ensure it only has access to the repositories/projects you intend to expose.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cq1ase5q0yvdyre6wjbcwbn80thmk
1.2kdownloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

clangd LSP

C/C++ language server integration providing comprehensive code intelligence through clangd (part of LLVM).

Capabilities

  • Code intelligence: Autocomplete, go-to-definition, find references
  • Error detection: Real-time diagnostics for compilation errors
  • Formatting: Code formatting with clang-format
  • Refactoring: Rename symbols, extract function
  • Supported extensions: .c, .h, .cpp, .cc, .cxx, .hpp, .hxx, .C, .H

Installation

Via Homebrew (macOS)

brew install llvm
# Add to PATH
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

Via package manager (Linux)

# Ubuntu/Debian
sudo apt install clangd

# Fedora
sudo dnf install clang-tools-extra

# Arch Linux
sudo pacman -S clang

Windows

winget install LLVM.LLVM

Or download from LLVM releases.

Verify installation:

clangd --version

Usage

The language server runs automatically in LSP-compatible editors. For manual operations:

Compile

gcc file.c -o output      # C
g++ file.cpp -o output    # C++
clang file.c -o output    # with clang

Format code

clang-format -i file.cpp

Static analysis

clang-tidy file.cpp -- -std=c++17

Configuration

Create .clangd in project root:

CompileFlags:
  Add: [-std=c++17, -Wall, -Wextra]
  Remove: [-W*]
Diagnostics:
  UnusedIncludes: Strict
  MissingIncludes: Strict

Or compile_commands.json for complex projects:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
# or
bear -- make

Integration Pattern

When editing C/C++ code:

  1. clangd uses compile_commands.json for project understanding
  2. Run clang-format to format code
  3. Use clang-tidy for static analysis
  4. Compile with warnings enabled (-Wall -Wextra)

Common Flags

Compile flags:

  • -std=c++17 - C++17 standard
  • -Wall -Wextra - Enable warnings
  • -O2 - Optimization level
  • -g - Debug symbols
  • -I<path> - Include path
  • -L<path> - Library path

clang-tidy checks:

clang-tidy file.cpp --checks='*' --
clang-tidy file.cpp --fix --  # Auto-fix

More Information

Comments

Loading comments...