Found 10 results
i've encountered the following situation with clj-nrepl-eval from clojure-mcp-light, which can mislead coding agents:
1. clj-nrepl-eval "(require 'x.y :reload) (clojure.test/run-tests 'x.y-test)"
2. test succeeds
3. the x.y ns is edited in a way it's rendered unloadable
4. clj-nrepl-eval "(require 'x.y :reload) (clojure.test/run-tests 'x.y-test)"
5. require prints an exception
6. tests still run and pass
the require may fail, but evaluation continues, using the code compiled by the last successful require call,
resulting in passing tests, giving LLMs a false sense of success.
would it make sense, if the evaluation would stop on re-loading a namespace?i've encountered the following situation with clj-nrepl-eval from clojure-mcp-light, which can mislead coding agents:
1. clj-nrepl-eval "(require 'x.y :reload) (clojure.test/run-tests 'x.y-test)"
2. test succeeds
3. the x.y ns is edited in a way it's rendered unloadable
4. clj-nrepl-eval "(require 'x.y :reload) (clojure.test/run-tests 'x.y-test)"
the require may fail, but evaluation continues, using the code compiled by the last successful require call,
resulting in passing tests, giving LLMs a false sense of success.
would it make sense, if the evaluation would stop on re-loading a namespace?Nice. I am working atm. to make Carp fit Rust's memory model, Carpaccio creates automatic bindings because of this, which I think is optimal to "script" Rust. I added the nrepl support, so you can basically use Carp with an LLM and clj-nrepl-eval to iterate on Rust-based prototypes with Clojure iteration times.
llm-repl is pre-released. I extracted it from my runtime into a stand-alone tool. It can be used as a standard clojure nrepl, as well as the llm-repl. The main use-case is for 1 model to drive another model for testing. nrepl allows multiple attachments. I have been running the tui with bb llm-repl and having me eca agent use clj-nrepl-eval to drive the llm-repl. Feedback welcome. https://github.com/michaelwhitford/llm-repl
llm-repl is released. I extracted it from my runtime into a stand-alone tool. It can be used as a standard clojure nrepl, as well as the llm-repl. The main use-case is for 1 model to drive another model for testing. nrepl allows multiple attachments. I have been running the tui with bb llm-repl and having me eca agent use clj-nrepl-eval to drive the llm-repl. Feedback welcome. https://github.com/michaelwhitford/llm-repl
llm-repl is pre-released. I extracted it from my runtime into a stand-alone tool. It can be used as a standard clojure nrepl, as well as the llm-repl. The main use-case is for 1 model to drive another model for testing. nrepl allows multiple attachments. I have been running the tui with bb llm-repl and having my eca agent use clj-nrepl-eval to drive the llm-repl. Feedback welcome. https://github.com/michaelwhitford/llm-repl
we are driving the cursive repl server from claude code via 2 scripts
1. eval
#!/bin/sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
NREPL_PORT_FILE="$SCRIPT_DIR/.nrepl-port"
NREPL_PORT="$(cat "$NREPL_PORT_FILE")"
# Assume $NREPL_PORT is opened on the same host as this script is executing on
# which wouldn't be the case, if we see the $NREPL_PORT_FILE over a network
# filesystem.
if nc -z 0.0.0.0 "$NREPL_PORT"; then
CLJ_EVAL_NREPL="$(which clj-nrepl-eval)"
(cd "$SCRIPT_DIR" && direnv exec . "$CLJ_EVAL_NREPL" --port "$NREPL_PORT" "$@")
else
# Remove presumably stale port file, to prevent AI seeing a stale port number
test -f "$NREPL_PORT_FILE" && rm "$NREPL_PORT_FILE"
cat <
2. start-nrepl-server:
#!/bin/sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "${SCRIPT_DIR}"
if [ -f deps.edn ]; then
exec direnv exec . clojure -M:test:dev:nrepl "$@"
else
echo "Missing ${SCRIPT_DIR}/deps.edn"; exit 1;
fi
which is introduced to claude via a /.claude/rules/clj-nrepl-eval.md :
---
origin: ""
---
# Clojure REPL Evaluation
This is a monorepo, containing multiple Clojure modules in subdirectories, each
containing an `eval` script, which you must use to run Clojure code, forms,
expressions, programs via nREPL for that module.
If there is no nREPL server process running for this project, the `eval` script
prints the shell command for starting it.
Ask the user whether they want to run that command and run in the background,
then retry the `eval` without any sleep!
`eval` accepts an optional `--timeout ` argument.
Always provide Clojure code via stdin!
Example:
shell
<module-dir>/eval --timeout 3000 <<'EOF'
(require 'some.name.space :reload)
EOF
Clojure code running in REPL should not read from stdin!
The REPL session persists between evaluations, so namespaces and state is
preserved.
Always use :reload when requiring namespaces to pick up source file changes.```What's your preferred way to receive a repro? clj-nrepl-eval cli with raw ops ok?
it was very simple. launch browser nrepl. tell claude to write tetris using reagami and iterate via the repl (via clj-nrepl-eval, see clojure-mcp-lite). but it didn't need to iterate a lot, just a few seconds
@U064J0EFR I just wanna say that https://github.com/bhauman/clojure-mcp-light/tree/main?tab=readme-ov-file#clj-nrepl-eval-llm-nrepl-connection-without-an-mcp has been really useful for me in combination with #jank's nREPL server. Used it here: https://clojurians.slack.com/archives/C03SRH97FDK/p1772926521725949