Verify a Bun runtime change

VerifiedCaution

Build and drive the Bun debug binary end-to-end to verify runtime changes. Includes gotchas for JS edits, cluster, and build environment.

Sby Skills Guide Bot
TestingAdvanced
8/29/2026
Claude CodeCursorWindsurfCopilotCodex
#bun#runtime#debug-build#end-to-end#node-compat

Recommended for

Automated summary

Verifies a Bun runtime change by building and driving the debug binary directly instead of running `bun test`.

Strengths

  • Gives a concrete build-and-run loop: `bun bd` to build, `-e` scripts to drive the debug binary on a minimal repro
  • Flags the key trap where a `src/js/**` edit silently never reaches the binary, plus the check and `touch` fix
  • Covers worker/subprocess-shaped changes, cross-checking against `node -e`, and the `node:cluster` file-on-disk exception
  • Documents environment friction: cargo PATH for the pinned nightly, the single-worktree build lock, debug log noise, and slow ASan builds

Limitations

  • Highly specific to the Bun repository and its internal tooling; not reusable elsewhere
  • Assumes a working local build (nightly Rust, C++ toolchain) and does not help debug build failures themselves
  • Deliberately skips unit tests and the existing test suites, so it is not a general testing guide
When to use it

Use it after editing Bun runtime code when you need to confirm the change end-to-end against the binary you actually just built.

When not to use it

Don't use it for ordinary application code or when running a project's normal test suite would answer the question.

Security analysis

Caution
Quality score85/100

The skill is a development workflow guide for verifying Bun runtime changes. It relies on bash, builds, and running code, which are powerful tools, but every command is legitimate, local, and non-destructive (no rm -rf, curl|sh, token exfiltration, or base64 payloads). The `touch` and scratch-script writes are benign repo-local operations. Hence 'caution' rather than 'risky' or fully 'safe'.

Findings
  • •Instructs running shell commands (`bun bd`, `touch src/jsc/bindings/InternalModuleRegistry.cpp`, scratch scripts) and executing arbitrary `-e` JS snippets through a locally built debug binary
  • •Writes files to disk (scratch scripts) and mutates source timestamps, which could interfere with a developer's working tree if followed blindly
  • •No destructive, exfiltrating, obfuscated, or safety-disabling content; all commands are standard dev workflow for the Bun repo
How this analysis is made

Examples

Verify a JS-visible runtime change
I just patched something under src/js in the Bun repo. Build the debug binary and confirm the change actually made it in by running the repro with `bun bd -e`, then cross-check the same snippet with `node -e`.
Check a worker/subprocess change
Verify my Bun change to worker teardown: spawn a subprocess from a `bun bd -e` one-liner so the event-loop-idle path runs, and show me the stdout.
Repro a node:cluster change
My edit touches node:cluster, which can't be driven with `-e`. Write a scratch script that calls cluster.fork() and run it with ./build/debug/bun-debug under timeout.

name: verify description: Verify a Bun runtime change by driving the debug binary end-to-end.

Verify a Bun runtime change

Build and drive the debug binary directly — never bun test, never import-and-call.

Build

bun bd --version   # builds ./build/debug/bun-debug and prints its version

Drive

For any JS-visible change, run the debug binary with -e and observe stdout:

bun bd -e '<repro>'   # builds, then runs; sets BUN_DEBUG_QUIET_LOGS for you

For worker/subprocess-shaped changes, spawn a subprocess (still -e) so worker teardown / event-loop-idle paths are exercised. Cross-check against node -e '<same repro>' for Node-compat changes.

Gotchas

  • A src/js/** edit can silently not reach the binary. bundle-modules regenerates build/<cfg>/codegen/InternalModuleRegistryConstants.h, but the C++ TU that embeds it is not always recompiled, so the build succeeds while the binary still runs the OLD JS. Gate on the binary, not the build: ask the binary you just built — bun bd -e 'console.log(<Class>.toString().includes("<new-id>"))' (or run ./build/<cfg>/bun directly). Plain bun is the system Bun on $PATH and never has your edit, so it answers about the wrong binary. If false, touch src/jsc/bindings/InternalModuleRegistry.cpp and rebuild.
  • Prefix every bun bd with PATH="$HOME/.cargo/bin:$PATH" — Homebrew's rust formula shadows the pinned nightly, and bun bd dies with the option 'Z' is only accepted on the nightly compiler. bun bd re-runs cargo on every invocation, so this is needed for follow-up runs too, not just the first build.
  • node:cluster changes can't be driven with -e: cluster.fork() re-execs argv[1], so workers need a real file on disk. Write a scratch script and run ./build/debug/bun-debug <file>.
  • Only one bun bd per worktree at a time — a second one blocks on the build lock and looks like a runtime hang. Build once, then drive ./build/debug/bun-debug directly under timeout.
  • BUN_DEBUG_QUIET_LOGS=1 suppresses debug-build log spam.
  • Debug builds print [cachefs]/[sys] lines to stdout; filter them before diffing output against node.
  • MessagePort's .on/.off are added by requiring worker_threads — plain new MessageChannel() ports only have addEventListener until then.
  • The debug+asan build is 10-100× slower than release; large-allocation stress tests can time out locally while passing in CI.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/verify-a-bun-runtime-change-mte1lfnd/download' --output '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md.part' && mv '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md.part' '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && test -s '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/verify' && cp -R '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd' '.claude/skills/verify'

Cursor
test -f '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && test -s '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/verify' && cp -R '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd' '.cursor/skills/verify'

Codex
test -f '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && test -s '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/verify' && cp -R '.skill-downloads/verify-a-bun-runtime-change-mte1lfnd' '.agents/skills/verify'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/verify-a-bun-runtime-change-mte1lfnd'

openskills read 'verify-a-bun-runtime-change-mte1lfnd'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/verify-a-bun-runtime-change-mte1lfnd/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills