ScriptsJul 17, 2026·3 min read

Babashka — Fast Native Clojure Scripting for the Command Line

A native, fast-starting Clojure interpreter for scripting, built with GraalVM native-image, that starts in milliseconds and provides a rich set of built-in libraries.

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 64/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Babashka Overview
Review-first command
npx -y tokrepo@latest install 88a1c2a2-81dd-11f1-9bc6-00163e2b0d79 --target codex

Dry-run first, confirm the writes, then run this command.

Introduction

Babashka is a native Clojure interpreter designed for scripting. Unlike standard Clojure which requires JVM startup time, Babashka starts in under 10 milliseconds thanks to GraalVM native compilation. It brings the expressiveness of Clojure to shell scripting, data processing, and automation tasks where JVM startup overhead would be prohibitive.

What Babashka Does

  • Runs Clojure scripts with near-instant startup (under 10ms)
  • Includes a rich standard library with built-in support for JSON, YAML, CSV, HTTP, and SQL
  • Provides a babashka.process namespace for shell command execution
  • Supports running tasks defined in a bb.edn project file (like a Clojure Makefile)
  • Executes multi-file projects with namespace resolution and dependency management

Architecture Overview

Babashka is built on the Small Clojure Interpreter (SCI), which interprets Clojure code without JVM compilation. SCI is compiled to a native binary using GraalVM native-image, bundling the interpreter and all included libraries into a single executable. The result is a self-contained binary that provides most of Clojure's functionality with startup times comparable to Bash or Python.

Self-Hosting & Configuration

  • Install via Homebrew, the official bash installer, or download prebuilt binaries from GitHub releases
  • Available for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows
  • Configure project-level tasks and dependencies in a bb.edn file at the project root
  • Dependencies from Clojars and Maven can be loaded at runtime via the :deps key in bb.edn
  • Use bb.edn tasks as a cross-platform alternative to Makefiles or npm scripts

Key Features

  • Near-instant startup makes it practical for CLI tools and git hooks
  • Built-in libraries for HTTP clients, JSON/YAML/CSV parsing, and SQLite access
  • Compatible with a large subset of Clojure, including most of clojure.core
  • Task runner (bb tasks) for defining project automation in Clojure
  • Extensible via pods — external processes that communicate via bencode over stdin/stdout

Comparison with Similar Tools

  • Clojure (JVM) — full language with long startup; Babashka trades some features for instant start
  • Bash — ubiquitous but limited data structures; Babashka offers Clojure's rich collections
  • Python — similar scripting use case; Babashka starts faster and has immutable-first data
  • Deno — fast TypeScript scripting runtime; Babashka serves the Clojure ecosystem
  • Nushell — structured data shell; Babashka provides a full programming language

FAQ

Q: Is Babashka a full Clojure implementation? A: It supports most of Clojure's standard library but not all. Features requiring JVM interop (like Java class loading) are not available.

Q: Can I use Clojure libraries from Clojars? A: Yes, as long as they don't require JVM-specific features. Many popular libraries work out of the box.

Q: How does it compare to Planck or Joker? A: Planck uses ClojureScript on JavaScriptCore; Joker is a Go-based interpreter. Babashka offers the broadest library support and most active development.

Q: Can I build standalone CLI tools with Babashka? A: Yes. You can distribute scripts as single files or use bb.edn projects with dependencies bundled.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets