Skip to content

Instantly share code, notes, and snippets.

@realgenekim
realgenekim / MUSINGS.md
Last active November 6, 2025 20:19
S-Expression Balancing MCP Server: A Thought Experiment

S-Expression Guard MCP Server

Problem Statement

LLMs frequently emit malformed S-expressions (unbalanced ()[]{}) when generating Clojure/EDN/Lisp code. Post-hoc “repair” is surprisingly difficult. Saving source code files with balancing errors, or streaming them to nREPL/compilers, wastes time and relies on imbalance detection after the tokens are generated.

What if we could prevent these types of error by creating a tool (stateless, stack-based, cursor-aware) for LLMs to use to help them write perfectly balanced S-expression. Ideally while minimizing latency, round-trips, total time required to generate code, and without any MCP server-side state.

Current LLMs are inherently auto-regressive auto-completers, which makes them inherently bad at the problem of closing S-expressions -- they don’t have anything resemblig a “stack” for them to store state (e.g., I just emitted an open parenthesis, and here’s an open bracket. I want to close the form — now what?). Nor does it have an equivalent of a “find

@realgenekim
realgenekim / open-map-key-errors.md
Last active November 4, 2025 04:45
LLMs have problems with Clojure open maps -- and so does Python

Map Key Errors in Clojure and Python: A Silent Bug Category

Why This Matters

I've been compiling this document for a couple of weeks, with the intent of publishing it, to at least advertise this problem I've been struggling with. One that has been bothering me enough where I've done a ton of little experiments to see if I can ameliorate it, even by a little!

Then just now, I was talking with my friend Scott Prugh who was just complaining about something in Python, and he was lamenting how he wanted to do things in C#. I asked him why, and he was complaining about the same problem that I've been having!

The problem: LLMs will often hallucinate map keys that don't exist. He and I commiserated about how we both spent hours trying to hunt down a problem that would have been solved if there were a data structure more like a class or a struct in C, where you could generate an immediate error if trying to get or set a value that doesn't actually exist.

@realgenekim
realgenekim / .proxy-java-shim.env
Last active October 31, 2025 19:02
Fix Maven/Gradle 401 errors in Claude Code web environment
# Java proxy configuration for local proxy shim
# Source this file before running Maven/Gradle/Clojure builds
#
# Usage: . ./.proxy-java-shim.env && mvn test
export JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15080 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15080"
export MAVEN_OPTS="$JAVA_TOOL_OPTIONS"
@realgenekim
realgenekim / datasets.md
Created September 22, 2025 20:06
Data sets for Vibe Coding Workshop for Leaders

Fantastic—here’s a compact, copy‑pasteable doc you can hand to tech‑leader participants. Every dataset below is (a) free, (b) downloadable for local/offline analysis on a dev‑class laptop, and (c) has a clear “what it’s good for.” I include at least one option for each topic you asked for, plus a bonus section with public backlogs/tickets/incident datasets.


Vibe‑Coding Workshop Datasets (Local/Offline Friendly)

1) Jira / Backlog Data

Primary (recommended): The Public Jira Dataset (anonymized, 2025 release)

@realgenekim
realgenekim / get-claude-code-data.md
Created September 5, 2025 18:35
Instructions to retrieve Claude Code data

⏺ The instructions for retrieving Claude Code prompts are in /Users/genekim/src.local/mdparse/docs/claude-code-logs.md. Key locations:

Primary data storage:

  • ~/.claude/projects/ - Project-specific sessions as JSONL files
  • ~/.claude.json - Session index and configuration

To find your prompts:

List your Claude projects

ls -la ~/.claude/projects/

@realgenekim
realgenekim / expo-av-workarounds.md
Created August 20, 2025 17:11
Claude Code on CLJS difficulties wrapping expo-av

expo-av Sound Class Workaround for ClojureScript/React Native

Problem Discovery

When trying to use expo-av’s Audio.Sound class in a ClojureScript React Native app (using shadow-cljs), we encountered a persistent error:

TypeError: Cannot read property ‘prototype’ of undefined

This error occurred when trying to:

@realgenekim
realgenekim / add-to-claude-code.md
Created August 14, 2025 17:36
giving Claude Code power of nrepl access

nREPL Client Script (nrepl.clj)

A fast Babashka script for interacting with the running nREPL server. Located at server/nrepl.clj.

Usage

The script automatically reads the port from .nrepl-port file.

Command line argument (fastest for one-off commands):

./nrepl.clj '(+ 1 2 3)'
./nrepl.clj '(require '\''[podcast.db :as db]) (count (db/get-recent-episodes 10))'
@realgenekim
realgenekim / deps.edn
Last active June 10, 2025 21:18
create plotly graph from clojurecreate plotly from clojure, using libpython-clj
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
clj-python/libpython-clj {:mvn/version "2.026"}}
:aliases
{:dev {:jvm-opts ["--enable-native-access=ALL-UNNAMED"]}}}
@realgenekim
realgenekim / electric-clojure-v3-context.txt
Created January 18, 2025 18:40
All Electric Clojure v3 tutorial sample apps in one file, to easily copy/paste into Claude context
./forms_inline.cljc:
(ns electric-tutorial.forms-inline ; used in form_explainer
(:require #?(:clj [datascript.core :as d])
[hyperfiddle.electric3 :as e]
[hyperfiddle.electric-dom3 :as dom]
[hyperfiddle.electric-forms3 :as forms :refer
[Input! Checkbox! Checkbox* Form! Service try-ok effects*]]
[dustingetz.trivial-datascript-form :refer
[#?(:clj ensure-conn!) #?(:clj transact-unreliable)]]))
@realgenekim
realgenekim / hyperfiddle.cljc
Last active August 12, 2024 22:06
Getting hyperfiddle RCF working in CLJS (Fulcro app)
(ns com.example.hyperfiddle
(:require
[hyperfiddle.rcf]
[taoensso.timbre :as log]))
; wait to enable tests until after app namespaces are loaded
(defn rcf-enable []
(hyperfiddle.rcf/enable!))