You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part 4/4 of the local-llm rightsize effort (research in hallouminate/.cheese/research/{serena-ra-memory,lspmux-serena-status}/).
Problem
Every Claude Code session spawns its own serena MCP server, which spawns its own rust-analyzer at ~4.4 GiB RSS each (3 found concurrently = ~13 GiB; one was 3 days stale). Two upstream causes:
serena hardcodes cachePriming.enable=true + cargo.autoreload=true in solidlsp/language_servers/rust_analyzer.py → each instance eagerly indexes the full dep graph (arrow/fastembed) instead of ~400 MB lazy. Fix PR rust-analyzer: lightweight profile (disable cachePriming + cargo.auto… oraios/serena#1557 is maintainer-acknowledged ("makes sense, helps us" — MischaPanch), blocked only on a flaky-test timeout bump (#1559). Serena ships ~1 release/week, so this lands on its own — no local patch.
serena never shares LS instances (one per session by design; #693 closed as "client's problem") and doesn't reap children on ungraceful exit (#1490, zero maintainer engagement).
Decision: lspmux — N serena sessions share one rust-analyzer, idle-killed after timeout.
lspmux status (verified 2026-06-11): it IS ra-multiplex renamed at v0.3.0 (GitHub pr2502/ra-multiplex redirects to codeberg.org/p2502/lspmux); last commit 2026-02-25; packaged in Homebrew/Nix/AUR; recommended by the rustaceanvim maintainer; sunshowers/lspmux-rust-analyzer wraps it for exactly the Claude-Code-multi-session case. v0.3.0 fixed processId handling so the LS survives the first client disconnecting.
Tasks
Install lspmux (cargo install or AUR; pin version) via dotfiles tooling.
Shim rust-analyzer so serena launches the lspmux client instead of the real binary. Verification gate first: serena's DependencyProvider may resolve via rustup which rust-analyzer, bypassing a PATH shim — confirm with ps parentage after a fresh session; consider shimming the rustup proxy path or using sunshowers/lspmux-rust-analyzer.
Gate 2: confirm lspmux passes serena's initializationOptions through unmodified (it rewrites processId in initialize; if it strips cachePriming settings the upstream #1557 fix would be lost through the mux).
If either gate fails: stop, document findings on this issue — do not silently fall back to patching serena.
One-time cleanup of current stale rust-analyzers (pkill -f rust-analyzer; serena respawns on demand).
Part 4/4 of the local-llm rightsize effort (research in
hallouminate/.cheese/research/{serena-ra-memory,lspmux-serena-status}/).Problem
Every Claude Code session spawns its own serena MCP server, which spawns its own rust-analyzer at ~4.4 GiB RSS each (3 found concurrently = ~13 GiB; one was 3 days stale). Two upstream causes:
cachePriming.enable=true+cargo.autoreload=trueinsolidlsp/language_servers/rust_analyzer.py→ each instance eagerly indexes the full dep graph (arrow/fastembed) instead of ~400 MB lazy. Fix PR rust-analyzer: lightweight profile (disable cachePriming + cargo.auto… oraios/serena#1557 is maintainer-acknowledged ("makes sense, helps us" — MischaPanch), blocked only on a flaky-test timeout bump (#1559). Serena ships ~1 release/week, so this lands on its own — no local patch.Decision: lspmux — N serena sessions share one rust-analyzer, idle-killed after timeout.
lspmux status (verified 2026-06-11): it IS ra-multiplex renamed at v0.3.0 (GitHub pr2502/ra-multiplex redirects to codeberg.org/p2502/lspmux); last commit 2026-02-25; packaged in Homebrew/Nix/AUR; recommended by the rustaceanvim maintainer;
sunshowers/lspmux-rust-analyzerwraps it for exactly the Claude-Code-multi-session case. v0.3.0 fixed processId handling so the LS survives the first client disconnecting.Tasks
instance_timeout = 300(idle kill), per-workspace instance keying.rust-analyzerso serena launches the lspmux client instead of the real binary. Verification gate first: serena's DependencyProvider may resolve viarustup which rust-analyzer, bypassing a PATH shim — confirm withpsparentage after a fresh session; consider shimming the rustup proxy path or usingsunshowers/lspmux-rust-analyzer.initialize; if it strips cachePriming settings the upstream #1557 fix would be lost through the mux).pkill -f rust-analyzer; serena respawns on demand).Acceptance
ps axo pid,ppid,comm | grep rust-analyzer).Risks