Hello! For a few years before the AI era I wrote Clojure in IntelliJ/Cursive with Parinfer/Paredit and rainbow parens turned on. The editor handled most of the structural pain for me: I’d “slurp” and “barf” forms around, and Parinfer would keep the brackets balanced as long as my indentation made sense. I almost never thought consciously about where a particular ] or } should go – the REPL plus the editor gave me instant feedback if something was off. This week I set up a small Clojure project and asked a coding assistant to help with a nested routes.clj . The model produced a believable route table with… subtly broken brackets deep inside. We fixed it, then broke it again on the next change. And unlike my usual IntelliJ workflow, there was no Parinfer/Paredit on the agent’s side, and no structural editor guarding its edits – the error only surfaced when Clojure complained at compile time. For those of you here working in Clojure (or other Lisps): how are you extending your classic REPL + structural editing workflow to include coding agents that don’t live inside IntelliJ/Emacs? What has actually worked?
I don't really use AI tools much, but you might want to look in #ai-assisted-coding?
one way to deal with it is using the https://github.com/bhauman/clojure-mcp-light#clj-paren-repair from clojure-mcp-light. Is fairly simple and make you save some tokens from the LLM looping to fix the unbalanced parens issue 🙂 I've also seen some folks using https://github.com/licht1stein/brepl
Thank you! Have taken this thread to https://clojurians.slack.com/archives/C068E9L5M2Q/p1778237685328229
Thank you @nathanfurnal . I came to the same conclusion. https://clojurians.slack.com/archives/C068E9L5M2Q/p1778250158629589?thread_ts=1778237685.328229&channel=C068E9L5M2Q&message_ts=1778250158.629589
You should have a hook/plugin that runs after every edit to ensure you're writing proper clojure. That's a deterministic signal and your tools should handle it, not the agents.