From clj-nrepl-eval
Evaluate Clojure code via nREPL using clj-nrepl-eval. Use this when you need to test code, check if edited files compile, verify function behavior, or interact with a running REPL session.
How this skill is triggered — by the user, by Claude, or both
Slash command
/clj-nrepl-eval:clj-nrepl-evalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when you need to:
Use this skill when you need to:
The clj-nrepl-eval command evaluates Clojure code against an nREPL server.
Session state persists between evaluations, so you can require a namespace in one evaluation and use it in subsequent calls.
Each host:port combination maintains its own session file.
For using the nREPL, we first need to know which port to connect to.
If the port is not clear from context, by the human specifying it, or by an .nrepl-port file in the cwd,
you can use $ clj-nrepl-eval --discover-ports (will show all nREPL servers (Clojure, Babashka, shadow-cljs, etc.) running in the current project directory).
Use the -p flag to specify the port and pass your Clojure code.
Recommended: Pass code as a command-line argument:
clj-nrepl-eval -p <PORT> "(+ 1 2 3)"
For multiple expressions (single line):
clj-nrepl-eval -p <PORT> "(def x 10) (+ x 20)"
Alternative: Using heredoc (may require permission approval for multiline commands):
clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(+ x 20)
EOF
Alternative: Via stdin pipe:
echo "(+ 1 2 3)" | clj-nrepl-eval -p <PORT>
Command-line arguments take precedence over stdin
Require a namespace (always use :reload to pick up changes):
clj-nrepl-eval -p <PORT> "(require '[my.namespace :as ns] :reload)"
Test a function after requiring:
clj-nrepl-eval -p <PORT> "(ns/my-function arg1 arg2)"
Check if a file compiles:
clj-nrepl-eval -p <PORT> "(require 'my.namespace :reload)"
Multiple expressions:
clj-nrepl-eval -p <PORT> "(def x 10) (* x 2) (+ x 5)"
Complex multiline code (using heredoc):
clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(* x 2)
(+ x 5)
EOF
Note: Heredoc syntax may require permission approval.
For everything more than evaluating a single expression, using HEREDOC is strongly recommended.
With custom timeout (in milliseconds):
clj-nrepl-eval -p <PORT> --timeout 5000 "(long-running-fn)"
Reset the session (clears all state):
clj-nrepl-eval -p <PORT> --reset-session
clj-nrepl-eval -p <PORT> --reset-session "(def x 1)"
-p, --port PORT - nREPL port (required)-t, --timeout MILLISECONDS - Timeout (default: 120000 = 2 minutes)-r, --reset-session - Reset the persistent nREPL session-h, --help - Show help messageclj-nrepl-eval -p <PORT> "(+ 1 2 3)" - works with existing permissions<<'EOF' ... EOF) for truly multiline code--reset-session is used:reload to pick up recent changesclj-nrepl-eval -p <PORT> "(require '[my.ns :as ns] :reload)"
clj-nrepl-eval -p <PORT> "(ns/my-fn ...)"
:reload, test againnpx claudepluginhub eighttrigrams/claude-stuff --plugin clj-nrepl-evalProvides CIDER integration for Clojure nREPL development: jack-in to start REPL, eval defun at point, eval buffer. For interactive REPL sessions.
Guides functional programming in Clojure: spec-validated domain modeling, REPL-driven prototyping, auto-generated tests, threading macros, and error pipelines.
Evaluates Julia code in a persistent REPLicant session via `julia +rpc`, avoiding cold-start overhead. Supports one-off evaluation, server management, and troubleshooting.