Thoughts on clojure, linux, security and Bitcoin's 0.1v (Satoshi Nakamoto's Design) in an era of artificial intelligence
Developing Clojure applications with AI assistance introduces a unique challenge: Clojure namespaces are dense, data structures are deeply nested, and code-as-data constructs demand precise context. If you feed entire namespaces and REPL outputs to reasoning-focused LLMs without a strategy, you will burn through your token quotas (and API budget) rapidly.
Here is how to optimize your developer workflow in Antigravity IDE using Gemini's Thinking Budget configurations.
Modern models (like Gemini 2.5/3.5 Flash and Pro) introduce a configurable Thinking Level (or Reasoning Budget). This setting represents how many internal, step-by-step reasoning tokens the model compiles before writing the final code.
To manage your tokens, you need to understand when to toggle between them:
| Setting | When to Use | Clojure Dev Tasks | Quota Consumption | Latency |
|---|---|---|---|---|
| Low / Off | Simple, rote coding and direct translations | Boilerplate templating, converting JSON to edn, writing basic Babashka shell scripts. | Minimal (Input + Output only) | Very Fast |
| Medium | Logical, multi-step coding problems | Standard app functions, writing test suites, refactoring standard functions. | Moderate | Moderate |
| High | Highly complex, stateful, or abstract logic | Designing advanced macros, debugging race conditions in core.async pipelines, orchestrating multi-agent systems. | Maximum (Adds hidden thinking tokens) | Slower |
Instead of copy-pasting your entire core.clj namespace to fix an error:
clojure.spec).In interactive chats, the IDE sends your entire chat history back to the model on every new turn. If your previous prompts returned responses that consumed 2,000 thinking tokens, those tokens are sent back as input on the next turn.
If you write automation scripts that query the Gemini API directly, you can configure the thinking budget dynamically in your payload using generationConfig.
Here is a Babashka script template showing how to switch thinking budgets dynamically:
#!/usr/bin/env bb
(require '[babashka.http-client :as http]
'[cheshire.core :as json])
(def api-key (System/getenv "GEMINI_API_KEY"))
(defn query-gemini [prompt thinking-budget]
;; thinking-budget = 0 (Minimal/Low)
;; thinking-budget = 1024 or 2048 (Medium/High reasoning token limit)
(let [url (str "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=" api-key)
payload {:contents [{:parts [{:text prompt}]}]
:generationConfig
(merge
{:temperature 1.0}
(if (zero? thinking-budget)
{:thinkingConfig {:thinkingBudget 0}}
{:thinkingConfig {:thinkingBudget thinking-budget}}))}]
(-> (http/post url {:headers {"Content-Type" "application/json"}
:body (json/generate-string payload)})
:body
(json/parse-string true)
:candidates
first
:content
:parts
first
:text)))
;; Example: Run a low-cost, fast query
(println (query-gemini "Generate a basic Babashka task definition for file-syncing." 0))
Treating LLM usage like hardware memory management makes you a highly efficient developer:
Published: 2026-06-14
Tagged: clojure llm workflow developer-experience babashka