Skip to content

Instantly share code, notes, and snippets.

@humorless
Last active February 13, 2026 01:49
Show Gist options
  • Select an option

  • Save humorless/c8fd31d3b085c8493c8be1155d15cbf9 to your computer and use it in GitHub Desktop.

Select an option

Save humorless/c8fd31d3b085c8493c8be1155d15cbf9 to your computer and use it in GitHub Desktop.
CLAUDE.md extension for a new Clojure empty project (which is created by "Clojure Stack Lite")

Dev Workflow

  • After editing source files, use brepl to require the changed namespace with :reload and test interactively, rather than relying solely on curl or bb test.

Interactive Development Techniques

  • Call handlers directly — Ring handlers are pure functions (request map → response map). Test them in brepl without going through HTTP or middleware: (handlers/home-handler {}), (handlers/inspect-handler {}). Inspect response structure with (keys resp) before dumping the full body.
  • Verify routes with Reitit — Use reitit.core/match-by-path to check route matching interactively without a browser: (reitit.core/match-by-path (reitit.ring/router app-routes/routes) "/"). Useful for verifying newly added routes before integration testing.
  • Compose and inspect HoneySQL queries — Build queries incrementally as data and preview the generated SQL with (honey.sql/format query {:quoted true}) before sending to the database. This lets you verify correctness without executing against the DB.
  • Reflect on Java objects — When interacting with unfamiliar Java objects or Interop, use (clojure.reflect/reflect obj) to inspect available methods and types instead of guessing. For a cleaner view of public methods, use: (->> (clojure.reflect/reflect obj) :members (filter :exception-types)(map :name) sort)
  • Debugging — When investigating a bug, start with (ex-message *e) and (ex-data *e). If state seems stale, use (integrant.repl/reset) to sync the system. Call functions directly to inspect return values, query the DB with (db/exec! ds ...), and check the Integrant system via (keys integrant.repl.state/system).

Balanced REPL Exploration (Token Optimization)

  • Incremental Inspection — Always start with low-token queries: use (keys ...) to see structure, (count ...) for size, or (take 5 ...) for samples.
  • Escalation Path — If sampling is insufficient to diagnose the issue, you are encouraged to retrieve specific nested data or full objects, but do so purposefully (e.g., (get-in ...)).
  • State Verification — After modifying code, use brepl to call the affected functions directly. If the output is a massive data structure, summarize the key changes for the session instead of printing the whole thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment