
Bun Runtime
This gives Claude everything it needs to work with Bun's runtime: CLI flags, watch vs hot reloading, environment variables, and all those globals that come out of the box. The flag positioning matters here (put them before `run`, not after), and you get practical stuff like preload scripts and stdin execution. Useful when you're debugging why imports aren't resolving or setting up a project with bunfig.toml. The watch mode comparison is helpful since hot reloading preserves state while watch does full restarts. Covers the 80% case well, and the reference pointers tell you where to dig deeper for module resolution quirks or complete flag lists.
- skills.sh installs
- 342
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill bun-runtime --agent claude-codeInstalls into .claude/skills of the current project.
Files
Bun Runtime
Bun is a fast all-in-one JavaScript runtime built on JavaScriptCore (Safari's engine). It provides 4x faster startup than Node.js on Linux.
Quick Start
# Run a file
bun run index.ts
bun index.ts # shorthand
# Run with watch mode
bun --watch run index.ts
# Run package.json script
bun run dev
# Run with hot reloading
bun --hot run server.ts
Core CLI Flags
| Flag | Purpose |
|---|---|
--watch | Restart on file changes |
--hot | Hot module replacement (preserves state) |
--smol | Reduce memory usage (slower GC) |
--inspect | Enable debugger |
--preload | Load modules before execution |
--env-file | Load specific .env file |
-e, --eval | Evaluate code string |
Running Files
Bun transpiles TypeScript and JSX on-the-fly:
bun run index.js
bun run index.ts
bun run index.jsx
bun run index.tsx
Important: Put Bun flags immediately after bun:
bun --watch run dev # Correct
bun run dev --watch # Wrong - flag passed to script
Package.json Scripts
# Run script
bun run dev
bun dev # shorthand (if no Bun command conflicts)
# List available scripts
bun run
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Category
- CLI & Terminal
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Cloudflare Workers Testing340
- Bun Cloudflare Workers338
- Bun Test Coverage337
- Bun Http Server336
- Bun Test Mocking335
- Nuxt Seo335
- Bun Bundler334
- Bun Workers333
- Bun Shell331
- Bun React Ssr330
- Bun Tanstack Start329
- Cloudflare Workers Performance329
- Bun Hot Reloading328
- Bun Redis328
- Bun Ffi326
- Bun Jest Migration326
- Bun Websocket Server326
- Cloudflare Workers Runtime Apis326
- Swift Best Practices326
- Bun Nuxt323
- Bun Macros322
- Cloudflare Workers Frameworks321
- Supabase Postgres Best Practices319
- Cloudflare Workers Ci Cd318