r/Clojure • u/calmest • Jan 19 '26
Agentic Coding for Clojure
I just wanted to post a quick note about my experience over the last month using Cursor for my development work. I am a solo developer working on an education app that supports student writing with AI. This app is in use around the world at universities and K-12 schools. It is under active development with grants from the IES and NSF and some commercial support.
I have been a software developer for 30+ years. I have been using Clojure for my work in earnest since 2016. This app is an SPA with over 58,000 LOC of both Clojure(script) and a little Javascript. I have been using Cursor as my IDE for a little over a year.
Prior to a month or so ago, my typical usage was to run agents in Ask mode, meaning the agent did not do anything autonomously. I inspected all work and would transfer code into the project manually (Cursor makes this easy). This worked quite well and was the only way I felt comfortable coding given the limitation of the agents. As time progressed, the AI and agent framework has improved dramatically. I can now say that I code new features and fixes with supervised full agent autonomy. I of course thoroughly review everything still, and my long experience as a developer helps a lot with strategic choices about what to develop and how.
The introduction of Claude Opus 4.5 and improvements in Cursor's agent scaffolding have made autonomous agent coding not only possible, but it is now my daily process. I use plan mode to create a complete development plan which I revise extensively until it is good, then I have the agent implement the plan. This has been working very well. Opus 4.5 handles Clojure(script) very well. It has full access to Clojure documentation and any library docs. It uses the linter on its own to fix mismatched form closes (or any issue) which is quite a sight to see. It really is a major leap forward in competency for these agent frameworks. I have not had time to explore other frameworks like Claude Code etc... but I expect they would provide similar results.
I use the $200/mo. plan from Cursor and have managed to burn through about 70% of my monthly usage allotment. I was on the $20/mo. plan initially but needed to upgrade for usage. The cost is very well worth it IMO.
TL;DR Clojure(script) autonomous agent coding is now completely doable with a good agent framework and AI model (i.e. Opus 4.5). These agent frameworks are not just for popular JS frameworks any longer. The AI tools can adeptly handle all of Clojure tooling. This is just a heads up to the community for those of you that have not been in this space. I would be interested in hearing about other's experiences.
View all comments
Show parent comment
3
u/256BitChris Jan 19 '26 edited Jan 19 '26
I typically don't refactor things, especially if they involve breaking changes.
I tell it to create new functions in parallel to existing ones, then cut over from the old functions to the new ones, ensuring functionality remains the same or the new functionality works as intended. I find this works best for all the programming languages I use, not just Clojure.
I also have validation done via Postman tests, which Claude Code writes, then updates in Postman and then verifies that they are passing - side benefit is then I have an instant http client to click and send requests against my endpoints (Postman is amazing and Claude Code can write amazing test suites if pointed at your apis or clojure routes).
As far as the data driven stuff, it's hard to explain, but I work on a product that supports different HTTP client requests that ultimately map down to S3 requests (put/get) - there are about 30+ different client types and before I had only implemented two and I had done it in a really janky way that required almost custom implementation for each (very java ish, custom namespace for each, etc).
Anyway, discussing that with Claude, it made a very elegant solution where it basically performs transforms from:
Http Request -> client-specific-transform -> S3 Request -> client-specific-transform -> http response
And so now I just have to provide one transform function per client type instead of one namespace like I was doing. Like I said, that's probably a no brainer for a Clojure savant, but being a former Java guy I was used to defining a lot more per use case.
Anyway, when Claude did that, it instantly clicked for me and that's what I credit to showing me the power of a data driven (in this case it's a function) approach and how Clojure enables that.
It's hard to explain but Claude showed me how to leverage Clojure in a way that simplified my entire system - but with the caveat that the system is like a 10 year old system that was written way back when I first learned Clojure but has been running in production without problem the entire time (another testament to Clojure/JVM working well in production).