claude-clojure-lsp
A Claude Code plugin wiring clojure-lsp into Claude Code's
LSP tool, across every Clojure dialect the server can actually handle.
There is no Clojure entry in the official plugin marketplace. This fills that gap.
Install
claude plugin marketplace add apollonicolson/claude-clojure-lsp
claude plugin install clojure-lsp@apollonicolson
Requires clojure-lsp on PATH — see installation.
Extensions
.clj .cljs .cljc .cljd .cljr .cljp .bb .edn
Coverage is not uniform, and the difference is worth knowing before you rely on it.
Two independent gates decide whether a file is analysed, and a file must clear both:
| gate | source | accepts |
|---|
clj-kondo source-file? | src/clj_kondo/impl/core.clj | .clj .cljs .cljc .cljd .edn .clj_kondo |
clojure-lsp uri->file-type | lib/src/clojure_lsp/shared.clj | .clj .cljs .cljc .edn .bb .cljd .clj_kondo |
:unknown file types are excluded from the project index. So:
| extension | open-file symbols, hover, diagnostics | project index (workspace symbols, cross-file refs) |
|---|
.clj .cljs .cljc .cljd .edn | yes | yes |
.cljr (ClojureCLR) | yes | no |
.bb (Babashka) | yes | no |
.cljp | yes | no |
The "no" rows are still worth mapping: open-file operations work, so documentSymbol,
hover and diagnostics all function on the file you are editing. Only cross-file
navigation is missing.
clj-kondo's README states directory scans process "only .clj, .cljs and .cljc".
That is out of date — .cljd and .edn are both in source-file? at HEAD. There is
no configuration key to add extensions; this has to be fixed upstream.
source-file? gates enumeration, not analysis
Worth knowing if you run clj-kondo in CI. Those gates apply when clj-kondo walks a
directory. A file named explicitly on the command line bypasses enumeration and lints
normally, hooks included — clj-kondo --lint src/task.bb works even though
clj-kondo --lint src/ silently skips it.
So a lint gate written as --lint src test covers none of your .bb sources, exits 0,
and reads as passing. Pass the files explicitly to fix it:
clj-kondo --lint $(find src test -name '*.bb') src test
Order matters. clj-kondo dedupes against paths it has already enumerated, so files
listed after a directory containing them are dropped:
--lint src/app src/app/task.bb → 0 findings for task.bb
--lint src/app/task.bb src/app → findings reported
A gate written the first way is indistinguishable from a passing one.
Performance
clojure-lsp analyses Java class and member definitions by default. On a project with a
large dependency tree this dominates startup, because it inflates the cache that
:db/read-cache must read back on every launch.
Measured on a 40-file Clojure project with a heavy dependency set (clerk, tablecloth,
fastmath, libpython-clj), time from process launch to a textDocument/hover that
returns content — cache rebuilt per variant, graceful shutdown so it persists,
median of 3 runs:
| configuration | time to first useful answer | cache |
|---|
| default | 6.73s | 9M |
:analysis {:java {…}} disabled | 2.63s | 6M |
:hover {:clojuredocs false} | 6.61s | 9M |
Disabling clojuredocs buys nothing — it refreshes asynchronously after initialize
returns, so it never delays an answer. The Java setting is the whole difference.
To apply it, in ~/.config/clojure-lsp/config.edn or a project's .lsp/config.edn:
{:analysis {:java {:class-definitions false
:member-definitions false}}}
Cost of that trade: hover on JDK interop is unaffected, and goToDefinition into the
JDK returns nothing either way because :download-jdk-source? defaults to false.
Re-enable it if you need jump or completion into third-party Java classes from jars —
that path was not covered by the measurement above.
Project roots and false positives
clojure-lsp resolves .clj-kondo/config.edn relative to the project root it was
started with. A server rooted above the project silently bypasses that config, along
with any :config-paths imports, which surfaces as a burst of unresolved-symbol
findings on interop that is actually fine.
Measured on the same ClojureDart file: rooted at the project, 0 diagnostics; rooted one
level above it, 9 false positives on Dart core types (Duration, DateTime).
If you see interop symbols flagged unresolved, suspect the root before the code.
Notes per dialect