# Clojure Debug

> Debugging workflow for Clojure/ClojureScript code. Use at the first sign of unexpected behavior or test failure in Clojure/CLJS, including any failing test, unexpected output, nils where data is expected, mismatched selectors, or unclear data flow—before making further implementation changes.

- Skill: `rcmerci/clojure-debug` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rcmerci/clojure-debug`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rcmerci/clojure-debug/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: rcmerci (https://skillmd.com/u/rcmerci)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rcmerci/clojure-debug

---


# Clojure Debug

## Core workflow

- Insert `prn` (or `prn` + labels) as early as possible in the suspected execution path.
- Prefer multiple small `prn` checkpoints over one large dump.
- Keep `prn` output focused on inputs, branch decisions, and key transforms.
- Remove or guard debug prints after validation.

## `clojure/node` CLI validation

- Use `clojure/node` CLI `eval` to validate small snippets or hypotheses.
- Keep eval expressions minimal and deterministic.
- Use it to confirm parsing, coercion, and data-shape assumptions before editing more code.

## Tips

- Favor `prn` over `println` to preserve readable EDN.
- When debugging async flows, print at boundaries: before request, after response, before transform, after transform.
- Add labels to output to correlate logs with branches.

