AgentToolHub
Skill

clojure-eval

clojure-eval — a Claude Code skill from bhauman/clojure-mcp-light

Features

  • ✓CLI tools for LLM coding with Clojure
  • ✓nREPL evaluation from command line
  • ✓Auto-fix delimiters via Claude hooks
  • ✓On-demand delimiter repair for Gemini CLI and Codex
  • ✓Guided REPL sessions for LLMs

Installation Guide

Installation is in two steps, installing the command line tool and
then telling the coding assistants about clj-nrepl-eval.

bash
bbin install https://github.com/bhauman/clojure-mcp-light.git --tag v0.2.2 --as clj-nrepl-eval --main-opts '["-m" "clojure-mcp-light.nrepl-eval"]'

Or from local checkout:

bash
bbin install . --as clj-nrepl-eval --main-opts '["-m" "clojure-mcp-light.nrepl-eval"]'

Verify that it is installed and working by starting a nREPL and then doing a test eval.

bash
# this missing paren is there to demonstrate that delimiters are repaired automatically
clj-nrepl-eval -p 7888 "(+ 1 2 3" 
# => 6

Telling the LLM about clj-nrepl-eval

Choose one or more of these approaches. Each has trade-offs:

| Approach | Availability | When info is used | Best for |
|----------|--------------|-------------------|----------|
| Custom instructions | All LLM clients | Always in context | Simplest, most effective |
| Slash commands | Most coding assistants | When you invoke it | On-demand awareness |
| Skills | Claude Code only | LLM pulls when needed | Automatic, context-aware |

Each can be installed locally (per-project) or globally (all projects).

#### Custom instructions

The simplest and perhaps most effective approach. Works with all LLM coding assistants.

Add to your custom instructions file:

  • Global: ~/.claude/CLAUDE.md, ~/.gemini/GEMINI.md, ~/.codex/AGENTS.md

  • Local: ./CLAUDE.md, ./GEMINI.md, ./AGENTS.md in project root
  • markdown
    # Clojure REPL Evaluation
    
    The command `clj-nrepl-eval` is installed on your path for evaluating Clojure code via nREPL.
    
    **Discover nREPL servers:**
    
    `clj-nrepl-eval --discover-ports`
    
    **Evaluate code:**
    
    `clj-nrepl-eval -p <port> "<clojure-code>"`
    
    With timeout (milliseconds)
    
    `clj-nrepl-eval -p <port> --timeout 5000 "<clojure-code>"`
    
    The REPL session persists between evaluations - namespaces and state are maintained.
    Always use `:reload` when requiring namespaces to pick up changes.

    #### Slash commands

    Lets you interject REPL awareness into the conversation when you need it. Available in most coding assistants (installation varies by client).

  • /start-nrepl - Starts an nREPL server in the background and reports the port

  • /clojure-nrepl - Provides detailed usage info for clj-nrepl-eval
  • Claude Code - uses .md files in commands/ directory:

    bash
    # Global: ~/.claude/commands/
    # Local: .claude/commands/
    mkdir -p ~/.claude/commands
    cp commands/*.md ~/.claude/commands/

    Gemini CLI - uses .toml files (docs):

    bash
    # Global: ~/.gemini/commands/
    # Local: .gemini/commands/

    Codex CLI - uses .md files (docs):

    bash
    # Global: ~/.codex/prompts/

    #### Skills

    Allows the LLM to pull in REPL information when it's actually needed. Currently Claude Code only.

    bash
    # Global (all projects)
    mkdir -p ~/.claude/skills
    cp -r skills/clojure-eval ~/.claude/skills/
    
    # Local (this project only)
    mkdir -p .claude/skills
    cp -r skills/clojure-eval .claude/skills/

    Usage Tips

    Easiest strategy: Start nREPL before your coding session

    Start an nREPL before asking the LLM to use one. This way it can
    simply discover the port of the server in the current project
    with --discover-ports. Minimal ceremony to start interacting with the REPL.

    Advanced: Have the LLM start and manage your nREPL sessions

    Claude and other LLMs are perfectly capable of starting your nREPL
    server in the background and reading the port from the output. They
    can also kill the server if it gets hung on a bad eval.

    Customize to your workflow

    Once you start working with clj-nrepl-eval inside a coding assistant,
    it will quickly become clear how to adjust the above prompts to fit
    your specific projects and workflow.

    ---

    Reviews