Skip to content
secondsky avatar

Bun Hot Reloading

Reload-focused Bun guide that contrasts --watch restarts with --hot in-place module reloads.

CCM score
52 of 100
skills.sh installs
418
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers --watch process restarts and --hot module reloading, with a comparison table of state retention, speed, and use cases
  • Includes import.meta.hot accept, dispose, decline, and invalidate patterns, plus HTTP server reload with server.reload()
  • Enforces cleanup through dispose callbacks and globalThis state storage so intervals and state survive or stop correctly across reloads
  • Designed for Bun developers building HTTP servers, WebSocket live reload, or Vite-based frontend workflows

Install

$ npx -y skills add secondsky/claude-skills --skill bun-hot-reloading -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Bun Hot Reloading

Bun provides built-in hot reloading for faster development cycles.

Watch Mode vs Hot Mode

Feature--watch--hot
BehaviorRestart processReload modules
StateLost on reloadPreserved
Speed~20ms restartInstant reload
Use caseAny file typeBun.serve HTTP

Watch Mode (--watch)

Restarts the entire process when files change.

# Basic watch mode
bun --watch run src/index.ts

# Watch specific script
bun --watch run dev

# Watch with test runner
bun --watch test

package.json Scripts

{
  "scripts": {
    "dev": "bun --watch run src/index.ts",
    "dev:server": "bun --watch run src/server.ts",
    "test:watch": "bun --watch test"
  }
}

Watch Behavior

  • Watches imported files automatically
  • Triggers on any .ts, .tsx, .js, .jsx change
  • Also watches .json imports
  • Restarts with fresh state

Hot Mode (--hot)

Reloads modules in-place without restarting the process.

bun --hot run src/server.ts

HTTP Server Hot Reload

// src/server.ts
let counter = 0; // State preserved across hot reloads

Details

Repository
github.com/secondsky/claude-skills
Categories
Backend & APIs, Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the bun-hot-reloading skill help with?

The bun-hot-reloading skill covers hot reloading with Bun, including watch mode, hot mode and HTTP server reload during development. It explains when to use --watch, which restarts the whole process, versus --hot, which reloads modules in place and keeps state.

How do I install the bun-hot-reloading skill?

Run npx -y skills add secondsky/claude-skills --skill bun-hot-reloading -y in your project to install bun-hot-reloading. After that, the agent can set up Bun watch mode, hot mode and import.meta.hot handlers for your server code.

Which skills lead bun-hot-reloading in the Backend & APIs category?

On Claude Marketplaces, bun-hot-reloading is listed under Backend & APIs next to entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. This skill sets itself apart by focusing on Bun's own reload modes and HTTP server patterns.

When should I use --hot instead of --watch with bun-hot-reloading?

Use --hot when you want modules reloaded in place with state preserved, such as a Bun.serve HTTP server. Use --watch when you need a full process restart on any file type, including tests, since state is lost on each restart.

More from secondsky/claude-skills

All 116

Similar to Bun Hot Reloading

More Backend & APIs