Configures Claude Code to use Bun-native APIs over Node equivalents, and provides conventions for bun build --compile, single-file HTML bundles, and lockfile handling.
Ships in supermodel-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use Bun when requested or when the project specifically requires it. Our conventions: Bun-native APIs over Node and npm equivalents, and its bundler for binaries and HTML apps.
Bun ≥ 1.1.45 writes text bun.lock by default; older projects have binary bun.lockb. Either at the repo root signals a Bun project. CI/reproducible installs: bun install --frozen-lockfile.
| Need | Use | Not |
|---|---|---|
| Read/write files | Bun.file(p).text() / Bun.write(p, data) | fs.readFile/writeFile |
| HTTP server | Bun.serve({ fetch }) (or Elysia, Hono) | Express, Fastify |
| SQLite | import { Database } from "bun:sqlite" | better-sqlite3 |
| Password hash | Bun.password.hash / .verify | bcrypt, argon2 |
| Hi-res time | Bun.nanoseconds() | process.hrtime() |
| Resolve module | Bun.resolveSync(spec, dir) | require.resolve |
| Env vars | Bun.env.X / process.env.X — .env auto-loaded | dotenv |
node:* modules work for compat — reach for them only when no Bun-native exists.
# Bundle
bun build ./src/index.ts --outdir ./dist --target browser --minify --sourcemap
# Standalone binary (cross-compile)
bun build ./src/cli.ts --compile --outfile myapp
bun build ./src/cli.ts --compile --target=bun-linux-x64 --outfile myapp-linux
bun build ./src/cli.ts --compile --target=bun-darwin-arm64 --outfile myapp-mac
bun build ./src/cli.ts --compile --embed ./assets --outfile myapp
Bun.build({ ... }) takes the same options programmatically, plus plugins.
Bun ≥ 1.3.10 takes .html files as bundler entrypoints — it traces <script type="module" src="./x.ts">, <link rel="stylesheet">, CSS imported from JS/TS, and url() references inside CSS. Pair it with --compile --target=browser to emit one self-contained HTML with every asset inlined as a data: URI (woff2 fonts from @fontsource/* work out of the box). Replaces Vite + vite-plugin-singlefile for iframe widgets, MCP App resources, and other single-file SPAs.
bun build --compile --target=browser ./src/app.html --outfile ./dist/app.html
<!-- src/app.html — the entry; Bun walks the graph from here -->
<!DOCTYPE html>
<link rel="stylesheet" href="./app.css">
<script type="module" src="./app.ts"></script>
<div id="root"></div>
// src/app.ts — CSS imports fold into the same bundle
import "@fontsource/inter/400.css";
import "./component.css";
[!CAUTION] Plain
bun build --html(without--compile --target=browser) emits sibling JS/CSS chunks, not one file. The single-file behavior comes from--compile --target=browseragainst an HTML entry, added in Bun 1.3.10. No third-party inliner needed —vite-plugin-singlefile,inline-source,posthtml-inline-assetsare all obsolete for this case.
{
"compilerOptions": {
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleResolution": "bundler",
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"jsx": "react-jsx",
"types": ["bun"]
}
}
Pair "types": ["bun"] with @types/bun as a devDependency. The legacy bun-types package is superseded.
Docs: https://bun.sh/docs
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/supermodel-skills:bunfrom supermodel-skills
npx claudepluginhub gwenwindflower/dotfiles --plugin supermodel-skills22 skills in this plugin
/agent-configCoding agent harness config - Claude Code hooks and settings, Codex config.toml layers, sandbox and approvals, permission profiles, MCP, plugins./analytics-engineeringAnalytics engineering - dbt projects, maintainable SQL as CTE pipelines, event patterns (funnels, sessions, retention, window functions, MATCH_RECOGNIZE)./ascii-animationsASCII and Unicode terminal animations - spinners, logo reveals, particles. Frame loops, character grids, per-character state, performance./browser-automationBrowser automation with agent-browser - navigating, forms, screenshots, scraping, web app QA and dogfooding, Electron apps. Version-matched guides served by the CLI./chezmoichezmoi dotfiles - source state, file attributes, templates, run scripts, ignore rules, dry-run verification./context-engineeringAgent context - AGENTS.md, CLAUDE.md, rules, memory, skills, subagents. Session capture, codebase and package mapping, zg and ast-grep code search, agentsview history.Other plugins' skills for the same job