Skip to content

Commit 87101f7

Browse files
authored
feat(plugins): use CLAUDE_PLUGIN_DATA for persistent LSP server installation (#96)
* feat(plugins): use ${CLAUDE_PLUGIN_DATA} for persistent LSP server installation Replace `bunx` invocations with persistent data directory pattern across all 32 LSP plugins, eliminating bunx resolution overhead on every session. - Group A (6 plugins): Direct system binary reference gopls, rust-analyzer, deno, gleam, ocaml, sourcekit - Group B (11 plugins): npm pre-install to ${CLAUDE_PLUGIN_DATA} typescript, pyright, prisma, yaml, bash, dockerfile, php, svelte, astro, vue, graphql - Group C (2 plugins): Project-local wrapper scripts biome, oxlint - Group D (13 plugins): @pleaseai/code installed to ${CLAUDE_PLUGIN_DATA} clangd, csharp, dart, elixir, eslint, fsharp, jdtls, kotlin, lua, rubocop, terraform, texlab, zls * chore: apply AI code review suggestions - Pin all 0.x dependency versions in plugin package.json files to exact versions (e.g., ^0.1.13 -> 0.1.13) to prevent pulling in breaking changes - Fix SessionStart hook commands in plugin.json files: add binary existence checks, fix install failure propagation, add mkdir -p for first-run setup - Remove unused typescript-language-server dependency from vue-lsp package.json * fix(plugins): remove unnecessary mkdir -p for CLAUDE_PLUGIN_DATA The directory is created automatically by Claude Code when the variable is first referenced, making mkdir -p redundant.
1 parent 0243d71 commit 87101f7

File tree

58 files changed

+527
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+527
-64
lines changed

plugins/astro-lsp/.claude-plugin/plugin.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@
66
"author": {
77
"name": "PassionFactory"
88
},
9+
"hooks": {
10+
"SessionStart": [
11+
{
12+
"hooks": [
13+
{
14+
"type": "command",
15+
"command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install --loglevel=error) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\""
16+
}
17+
]
18+
}
19+
]
20+
},
921
"lspServers": {
1022
"astro": {
11-
"command": "bunx",
12-
"args": ["@pleaseai/code@0.1.13", "lsp-server", "astro"],
23+
"command": "${CLAUDE_PLUGIN_DATA}/node_modules/.bin/astro-ls",
24+
"args": ["--stdio"],
1325
"extensionToLanguage": {
1426
".astro": "astro"
27+
},
28+
"initializationOptions": {
29+
"typescript": {
30+
"tsdk": "${CLAUDE_PLUGIN_DATA}/node_modules/typescript/lib"
31+
}
1532
}
1633
}
1734
}

plugins/astro-lsp/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"@astrojs/language-server": "^2.16.0",
5+
"typescript": "^5.7.0"
6+
}
7+
}

plugins/bash-lsp/.claude-plugin/plugin.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@
66
"author": {
77
"name": "PassionFactory"
88
},
9+
"hooks": {
10+
"SessionStart": [
11+
{
12+
"hooks": [
13+
{
14+
"type": "command",
15+
"command": "[ -x \"${CLAUDE_PLUGIN_DATA}/node_modules/.bin/bash-language-server\" ] && diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install --loglevel=error) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\""
16+
}
17+
]
18+
}
19+
]
20+
},
921
"lspServers": {
1022
"bash": {
11-
"command": "bunx",
12-
"args": ["@pleaseai/code@0.1.13", "lsp-server", "bash"],
23+
"command": "${CLAUDE_PLUGIN_DATA}/node_modules/.bin/bash-language-server",
24+
"args": ["start"],
1325
"extensionToLanguage": {
1426
".sh": "shellscript",
1527
".bash": "shellscript",

plugins/bash-lsp/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"bash-language-server": "^5.4.0"
5+
}
6+
}

plugins/biome-lsp/.claude-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
},
99
"lspServers": {
1010
"biome": {
11-
"command": "bunx",
12-
"args": ["@pleaseai/code@0.1.13", "lsp-server", "biome"],
11+
"command": "bash",
12+
"args": ["${CLAUDE_PLUGIN_ROOT}/scripts/lsp.sh"],
1313
"extensionToLanguage": {
1414
".ts": "typescript",
1515
".tsx": "typescriptreact",

plugins/biome-lsp/scripts/lsp.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
if [ -x "./node_modules/.bin/biome" ]; then exec ./node_modules/.bin/biome lsp-proxy --stdio; fi
4+
if command -v biome &>/dev/null; then exec biome lsp-proxy --stdio; fi
5+
echo "[biome-lsp] biome not found. Install: npm install --save-dev @biomejs/biome" >&2
6+
exit 1

plugins/clangd-lsp/.claude-plugin/plugin.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@
66
"author": {
77
"name": "PassionFactory"
88
},
9+
"hooks": {
10+
"SessionStart": [
11+
{
12+
"hooks": [
13+
{
14+
"type": "command",
15+
"command": "[ -x \"${CLAUDE_PLUGIN_DATA}/node_modules/.bin/code\" ] && diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install --loglevel=error) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\""
16+
}
17+
]
18+
}
19+
]
20+
},
921
"lspServers": {
1022
"clangd": {
11-
"command": "bunx",
12-
"args": ["@pleaseai/code@0.1.13", "lsp-server", "clangd"],
23+
"command": "${CLAUDE_PLUGIN_DATA}/node_modules/.bin/code",
24+
"args": ["lsp-server", "clangd"],
1325
"extensionToLanguage": {
1426
".c": "c",
1527
".cpp": "cpp",

plugins/clangd-lsp/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"@pleaseai/code": "0.1.13"
5+
}
6+
}

plugins/csharp-lsp/.claude-plugin/plugin.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@
66
"author": {
77
"name": "PassionFactory"
88
},
9+
"hooks": {
10+
"SessionStart": [
11+
{
12+
"hooks": [
13+
{
14+
"type": "command",
15+
"command": "diff -q \"${CLAUDE_PLUGIN_ROOT}/package.json\" \"${CLAUDE_PLUGIN_DATA}/package.json\" >/dev/null 2>&1 || (cd \"${CLAUDE_PLUGIN_DATA}\" && cp \"${CLAUDE_PLUGIN_ROOT}/package.json\" . && npm install --loglevel=error) || rm -f \"${CLAUDE_PLUGIN_DATA}/package.json\""
16+
}
17+
]
18+
}
19+
]
20+
},
921
"lspServers": {
1022
"csharp": {
11-
"command": "bunx",
12-
"args": ["@pleaseai/code@0.1.13", "lsp-server", "csharp"],
23+
"command": "${CLAUDE_PLUGIN_DATA}/node_modules/.bin/code",
24+
"args": ["lsp-server", "csharp"],
1325
"extensionToLanguage": {
1426
".cs": "csharp"
1527
}

plugins/csharp-lsp/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"@pleaseai/code": "0.1.13"
5+
}
6+
}

0 commit comments

Comments
 (0)