Agent skill · software engineering · secondsky
bun-hot-reloading
Use when implementing hot reloading with Bun (--hot, --watch), HMR, or automatic code reloading during development. Covers watch mode, hot mode, and HTTP server reload.
Why this skill is useful
Provides specific commands and patterns for implementing hot reloading with Bun that the AI wouldn't reliably generate on its own.
What it needs
Requires bun installed locally. About 4k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.
What this skill does
Bun Hot Reloading Bun provides built-in hot reloading for faster development cycles. Watch Mode vs Hot Mode Feature --watch --hot --------- ----------- --------- Behavior Restart process Reload modules State Lost on reload Preserved Speed ~20ms restart Instant reload Use case Any file type Bun.serve HTTP Watch Mode (--watch) Restarts the entire process when files change. package.json Scripts 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. HTTP Server Hot Reload When you modify server.ts, the module reloads instantly while counter keeps its value. Bun.serve with Hot Reload import.meta.hot API HTTP Server Patterns Express-like Pattern Stateful Server Custom Watch Implementation WebSocket Live Reload Server Vite Integration For frontend development with HMR: Testing with Watch Environment Detection Common Issues State Not Preserved Cleanup Not Running Module Not Reloading Common Errors Error Cause Fix ------- ------- ----- Changes not detected File not imported Check import chain State lost Using --watch Use --hot or globalThis Port in use Server not stopped await server.stop() before rebind Memory leak No cleanup Use dispose callback When to Load References Load references/advanced-hmr.md when: Custom HMR protocols Module federation Complex state management Load references/debugging.md when: HMR not working State issues Performance debugging
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills secondsky/bun-hot-reloading