Feature request: Support connecting to an existing LSP server via TCP/socket
Problem
Currently, the LSP plugin system (lsp.json) only supports spawning a new LSP server process via the command field. Each Claude Code session starts its own LSP server, which must re-index the entire project from scratch.
For large projects (e.g., Unity/C# with OmniSharp), this indexing takes 30-60 seconds per session. When using parallel agents or worktrees, each one pays this cost independently, and there's no way to share a single indexed server.
Proposed Solution
Allow lsp.json to optionally specify a host and port (or Unix socket path) to connect to an already-running LSP server, instead of spawning a new process:
{
"csharp": {
"host": "127.0.0.1",
"port": 2089,
"startupTimeout": 180000,
"extensionToLanguage": {
".cs": "csharp"
}
}
}
This would allow users to run a persistent LSP server externally and have multiple Claude Code sessions connect to it, avoiding redundant indexing.
Use Case
- C#/Unity projects using OmniSharp where indexing is slow
- Any large codebase where LSP startup is a bottleneck
- Parallel agent workflows where multiple sessions need LSP access simultaneously
Notes
LSP protocol is stateful per client (each client has its own initialize handshake), so the external server would need to support multiple clients — or a multiplexing proxy could sit in between. Even supporting a single persistent server for sequential sessions would be a significant improvement.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗