Clojure and AI agents - an experience report

Clojure and AI agents - an experience report

Disclaimer: No AI was involved in the writing of this post.

Reluctant buyer

Since the start of the AI gold rush, I have been a skeptic. I still roll my eyes whenever someone brings up ChatGPT on their phone to ask a factual question. I cannot even with people that actually ask ChatGPT questions about their life.

However, since my day job involves a lot of coding, and I was using VSCode at the time, it made sense to see what the fuss was about. So I installed Copilot and got it to give me smarter completions. That was that for some time. I setup a subscription, and forgot about it.

Annoyed and disenchanted

For some months (or is it years now?) I left it at that. I noticed that most of the work in VS Code release announcements was about things I didn't use: at first, Notebooks, and then Chat. That made me a bit annoyed with my choice of IDE.

At some point, I did try Notebooks (Calva added some support for that), and it was meh (for me). I had a dream for a nice visualisation tool for Clojure REPLs, but at that point in time it wasn't there.

Regarding Chat, I really didn't understand what was it for. Why would I interrupt my coding session, to ask an LLM something, wait for some seconds? I could just google it and get authoritative results that I could read and form my own opinion.

I also tried asking AI to "write a function that ..." or "change this code so that ..." and it was always horrible. So that validated my well formed opinions that LLMs are a fad that will pass, so I don't have to deal with that.

I even turned off the AI-powered auto completions, because when they got it wrong, it was so annoying, they couldn't even get the syntax of Clojure right at times.

Eventually, Neovim started calling (again) and I abandoned VS Code. I spent a few blissful months with Neovim/LazyVim/Conjure and my REPL experience was so much smoother.

Brought back in

Eventually my good colleague Josh (go hire him!) started to bring up his use of Claude for AI tasks. My ears (metaphorically) perked up when he asked Claude to fix a Prosemirror bug that we couldn't figure out. He prompted something like "there's a bug in this code, can you find it"? And then Claude just fixed it.

At the same time, clients started booking meetings with feature requests for AI integrations. Other colleagues, whose judgements I trusted, mentioned using AI tools to good effect. I realised that it's probably time to have another look.

So, since I still had an active Github Copilot subscription, and VS Code was still installed, I launched it up, and had a peek around. The time was around start of December 2025, and now VS Code had Agents, and Claude Opus 4.5 was available. So I took it for a spin.

Jaw dropped

Spoiler alert: my jaw dropped.

For context, I'm working on a full stack web application built entirely in Clojure (our legacy Node.js code is almost out of the picture these days). It uses GraphQL, Mongo, Postgres, ClojureScript/React, SCSS and such other pretty common technologies.

I had started working on a new visualisation feature. It was green field, it was a single namespace, it didn't add any other logic to the application, so I thought it was a good testing ground. So after I setup some initial scaffolding manually, I started asking the Agent to add features.

And it did, oh it did. My mode of work quickly shifted to a higher level. I felt like I was the foreman on a construction site, and I was just giving orders to a lightning fast worker. Obviously, it was up to me to judge whether my intent was carried out as I expected. So that was another focus shift: from code writing to code reviewing.

That didn't come without downsides: the main thing being that now the code isn't as succinct and beautiful as it could have been. I have to accept the fact that for code at the edges, that is kind of boring and will not be built upon, that is OK.

Also, I have to sometimes accept the fact that I have to stop the agent, and go back to manual editing. It's very tempting to try to stay in foreman mode for as long as possible – but sometimes it's faster and better to just do it yourself.

Lessons quickly learned

Local Agents only

At the time of writing, asking for an Agent to do the work "offline", that is, go on the cloud and then open a PR, is just not good UX. VS Code has context like LSP that Agents use to find syntax and lint errors etc. Also, the feedback loop is so slow and the context switch so big, that I've never tried it again.

A machine cannot take responsibility

At the end of the day, agents or not, I'm still creating a PR for my colleagues to review. So it is really bad manners to just open direct-from-AI PRs. What I usually do is start with AI, make sure the functionality is there, do my own review, add my edits (or ask the AI to refactor) until I'm reasonably happy with the results. Only then do I ask a colleague to take time to review.

Support with tools

Agents edit code quite quickly, and rely on feedback from tools to validate their work. In my project, the agent has figured out how to run tests and does that. However, Clojure being a slow startup language, this can be slow. So I have added a few tools to help it along: reload code (via tools.namespace), restart the server, run tests via connecting to a REPL. Nothing fancy, just connect to a plain socket REPL and send code over, wrapped in bb tasks.

I did try to have agents access the full Calva REPL, but it wasn't a good fit. Might try again later.

You can still code, and might still be faster

Copilot was down for a brief 20-30 minutes the other day. I felt annoyed - I really got used to having Copilot do the work for me - but I didn't want to stop the momentum, so I went back to manual coding. It's such a different experience, but it's still totally viable, and I think that for some smaller and more targeted changes, I will be objectively faster - but subjectively it feels like more work.

Subjectively

So now it's been a full month. I have, objectively, produced A LOT of output. So much, that I fear that now the burden is on my colleagues to review the code. And while Copilot can do a good job at pointing small issues in PRs, it lacks the big picture and judgement that a seasoned developer that knows the business domain has.

Subjectively, I'm just less tired. I can start a new chat session, write a prompt explaining the task in a couple of minutes, then step away to reply to an email, think about something, do the dishes, etc.

I also don't go in a deep concentration and flow mode. While I do miss it sometimes, it also means that I can be interrupted by life (a phonecall, or my child etc) or work (an email or message) without going into a rage mode. Perhaps my concentration was too deep, but that was me.

At the literal end of the day, after the kid is in bed, I don't feel as drained and I can still knock out a few small tasks. I'm a fast reader, and reading code for me comes quite naturally. I can also go to sleep more easily without my brain going into overdrive mode.

Finally, I can finally justify adding some much needed quality of life improvements to the codebase. Things like build scripts, management UIs etc – tasks that I obviously could do (and have done!) before, but these days justifying taking a few hours or days for this felt hard. Now, it's just a second or third VS Code window open in a Git work tree, chugging away. It will get it mostly right, I will do a couple iterations, pat it on its head and move on.

Clojure

I didn't write too much about Clojure, because in the end my worries of a relatively niche language being unsupported by LLMs were unfounded. Sometimes the tool will mess up the parentheses, and will go around in circles trying to find the errant one - but in that case I will just open the file, scroll to the red squiggle and just add it myself.

I obviously don't have experience with Copilot/Opus 4.5 in any other language. But the Clojure code it produces is decent, simple enough to understand, and fits in the codebase pretty well. From time to time I will ask it to rewrite something or point out issues, and it will just fix them relatively quickly.

Where to go from here?

I did find that antirez's blog post resonated with me.

I am now a fan of the tool. It's made my life easier, and my productivity increased.

I'm not worried about cost. In the grand scheme of things, the cost is quite low compared to the value produced.

I am worried about the environment implications.

I am worried about vendor lock in.

I am worried about the future of coding.

I am worried about the job market now, and in the future for junior developers starting out.

But I have accepted that the world is moving towards that, and it would seem like a disservice to my employer if I refused to touch AI because of these worries - unfortunately, that's capitalism for you.