LSP Code Navigation for Openclaw

A multi-language LSP client that manages persistent background daemons for precise code navigation and semantic analysis.

adamnaghs
v2.0.0
Mar 1, 2026
0
1.9k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install lsp

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install lsp using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is LSP Code Navigation?

The LSP skill is a high-performance tool designed to provide IDE-level intelligence to AI coding agents. By utilizing the Language Server Protocol, it moves beyond simple text-based searching to provide semantic understanding of source code. This skill manages per-language background daemons that lazy-start as needed, allowing for rapid access to definitions, references, and type information across a wide variety of languages including Python, TypeScript, Rust, Go, and C++. Integrating this into your workflow via Openclaw Skills ensures that your development environment remains responsive while providing deep technical insights into your codebase.

Unlike traditional tools that rely on grep, this skill understands the context of your project. It automatically detects the programming language based on file extensions and routes queries to the appropriate server. Each server is managed efficiently, idling out after five minutes of inactivity to preserve system resources. This makes it an essential part of the Openclaw Skills ecosystem for any developer looking to automate complex code navigation and refactoring tasks.

LSP Code Navigation Use Cases

  • Replacing imprecise grep searches with semantic Go to Definition queries.
  • Finding all usages of a specific symbol or function across an entire workspace to assist in refactoring.
  • Retrieving detailed type signatures and docstrings through hover actions.
  • Auditing code quality by generating diagnostics and type-checking reports before running scripts.
  • Generating a comprehensive list of all classes, functions, and variables within a specific file for documentation or analysis.

How LSP Code Navigation Works

  1. The user or agent invokes the lsp-query script with a specific command like definition or symbols.
  2. The skill auto-detects the programming language by analyzing the file extension of the target file.
  3. On the first request, a background daemon is spawned to manage communication via a Unix socket.
  4. The daemon starts the required language server (e.g., pyright-langserver or gopls) if it is not already running.
  5. Commands are translated into LSP-compliant JSON-RPC requests and sent to the language server.
  6. The results are parsed and returned in a human-friendly format, while the server remains active for future queries to ensure sub-200ms response times.
  7. After five minutes of inactivity, language servers and the daemon automatically shut down to save memory.

LSP Code Navigation Setup

To get started with this component of Openclaw Skills, ensure you have Python 3.10+ installed. Follow these steps for installation:

  1. Install the language servers relevant to your project (e.g., npm install -g pyright typescript-language-server).
  2. Symlink the lsp-query script to your local path for easy access:
ln -sf {baseDir}/scripts/lsp-query.py /usr/local/bin/lsp-query
  1. Configure your workspace root by setting the environment variable:
export LSP_WORKSPACE=/path/to/your/project
  1. Verify the installation by checking supported languages:
lsp-query languages

LSP Code Navigation Data Schema & Taxonomy

The skill manages its state and communication through a localized cache and environment variables. Data is organized as follows:

Component Path / Variable Purpose
Socket ~/.cache/lsp-query/daemon.sock Communication bridge between CLI and background daemons.
Workspace LSP_WORKSPACE Defines the root directory for indexing symbols and references.
Server Overrides LSP_SERVER Allows manual specification of a language server binary.
Idle Logic LSP_TIMEOUT Integer value in seconds (default 300) for auto-shutdown.

LSP Code Navigation Advanced Features

  • Workspace-wide symbol searching for finding definitions across thousands of files instantly.
  • Real-time diagnostic reporting to catch syntax and type errors within Openclaw Skills workflows.
  • Rename preview capabilities to simulate refactoring changes before applying them to the filesystem.
  • Support for signature help to assist agents in generating correct function calls.
  • Intelligent server management including manual shutdown and per-language status monitoring.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*