How do I make Claude Code's gopls-lsp plugin share one gopls daemon across sessions?
The official anthropics/claude-plugins-official gopls-lsp plugin starts one gopls instance per Claude Code session, consuming roughly 500-800MB of RAM each (a WSL2 report with Claude Code v2.1.309 measured 1.70 GiB RSS per instance). How can I make all sessions share a single gopls daemon with -remote=auto until the maintainers add support?
Originally asked on GitHub: https://github.com/anthropics/claude-plugins-official/issues/261
5 answers
Still open: as of the last update (October 2026), the official gopls-lsp plugin has no daemon-mode option — the implementing PR (anthropics/claude-plugins-official#2567) was auto-closed by a bot before merging — so each Claude Code session still spawns its own
gopls. A workaround from the thread is to edit the cached plugin files directly.- In
~/.claude/plugins/cache/claude-plugins-official/gopls-lsp/1.0.0/, create or edit.lsp.json:
json{ "gopls": { "command": "gopls", "args": ["-remote=auto", "-remote.listen.timeout=30m"], "extensionToLanguage": { ".go": "go" } } }- Create or edit
.claude-plugin/plugin.jsonwith the samecommandandargsunderlspServers.gopls, plus"name": "gopls-lsp","description", and"version": "1.0.0". - Restart Claude Code. To verify, first ask Claude to trigger an LSP operation (e.g.
LSP(operation: "documentSymbol", file: <any/file/path>)), then runps aux | grep gopls | grep -v grep— you should see a daemon with-listen.timeout 30mand a forwarder with-remote=auto.
Requirements and caveats from the thread: this needs gopls v0.4.4+ (current stable is v0.21.0), and gopls falls back to normal mode if the daemon connection fails. The config can't go through
marketplace.jsonbecauselspServersthere doesn't propagate to installed plugins (known issue anthropics/claude-code#15148), so the cache edit may need reapplying after plugin updates. This only shares the daemon among Claude Code sessions; sharing with VS Code would require VS Code to use the same daemon. A WSL2 report (Windows 16 GB, Ubuntu 22.04, 7.7 GiB WSL RAM limit, Claude Code v2.1.309) measured Claude's gopls at 1.70 GiB RSS while VS Code's own gopls used 1.94 GiB.Did this work for you?- In
What a GitHub user tried on GitHub (Worked)
Reporter tested a custom plugin with
"args": ["-remote=auto", "-remote.listen.timeout=30m"]on the gopls command. Multiple Claude Code sessions shared one daemon, memory dropped from roughly 500MB per session to roughly 500MB total, and completion, diagnostics, and hover kept working.Source: https://github.com/anthropics/claude-plugins-official/issues/261 (opens external site)
Did this work for you?What @corylanou tried on GitHub (Outcome unclear)
Commenter suggested writing the daemon args directly into the cached plugin files at
~/.claude/plugins/cache/claude-plugins-official/gopls-lsp/1.0.0/.lsp.jsonand.claude-plugin/plugin.json, then restarting Claude Code. Verification steps were given but no confirmed result appears in the thread.Did this work for you?What @ajvengo tried on GitHub (Outcome unclear)
A contributor submitted PR #2567 to add the daemon args to the official plugin, but the bot auto-closed it without merging. The thread does not report anyone testing that PR.
Did this work for you?What @anotherGoogleFan tried on GitHub (Outcome unclear)
A WSL2 reporter (Windows 16 GB, Ubuntu 22.04, VS Code, Claude Code v2.1.309) reproduced the problem on the default plugin rather than testing a fix: Claude's gopls used 1.70 GiB RSS, VS Code's gopls 1.94 GiB, WSL RAM hit 7.3/7.7 GiB with swap at 2.0/2.0 GiB, and VS Code repeatedly lost or stalled its WSL remote connection.
Did this work for you?
Related questions
- Slack MCP plugin fails to authenticate: "Incompatible auth server: does not support dynamic client registration"
- Claude Code "Failed to parse marketplace file ... plugins.N.source: Invalid input" with claude-plugins-official?
- Claude Code official marketplace fails with 'plugins.56.source: Invalid input'
- Claude Code 2.1.62: Failed to parse marketplace file (plugins.N.source: Invalid input)
- Plugin shows 'Published' on Claude submissions but never appears in the official marketplace