bun 0.1.0
How the Bun repository runs its agents: a shell guard that stops slow or wrong build and test commands, format on edit, and skills for its C++, Rust and test work.
Owner: Baudrier AI · MIT · from oven-sh/bun at e13b16b
Claude Code 9 of 9 guards holdCodex 9 of 9 guards holdGitHub Copilot 9 of 9 guards hold
Install
$ uv tool install baudrier # once
$ baudrier install bun --dry # look first: nothing is written
$ baudrier install bun # for the agents your repository uses; or --to claude|codex|copilot|generic
It shows what it will write, hook scripts first, and asks before it writes.
Last step: paste the line the install prints last into your agent, opened in your repository. It fits the harness to your repository. Don’t skip it. For Claude Code:
Read .baudrier/harness/bun/FINISH_SETUP.claude.md and follow it.
For another agent, the file ends in .codex.md, .copilot.md or .generic.md.
What each agent keeps
- Claude Code: 15 native, 0 emulated, 0 lost. Checks validated by the publisher: 9 of 9 guard cases give the expected decision, run on 2026-11-27.
- Codex: 14 native, 1 emulated, 2 lost. Checks validated by the publisher: 9 of 9 guard cases give the expected decision, run on 2026-11-27.
- GitHub Copilot: 14 native, 1 emulated, 0 lost. Checks validated by the publisher: 9 of 9 guard cases give the expected decision, run on 2026-11-27.
- Any agent: 13 native, 0 emulated, 2 lost. Its guards are written as instructions: nothing enforces them.
What Codex rebuilds or loses (3)
find-duplicate-prs: allowed-toolslost, Claude Code frontmatter that Codex does not read; the skill's text is unchangedfind-issues: allowed-toolslost, Claude Code frontmatter that Codex does not read; the skill's text is unchangedPostToolUse [Write|Edit|MultiEdit] → post-edit-format.jsrebuilt, Codex edits files with apply_patch: the adapter rebuilds a Write or Edit payload per file and blocks the patch if the hook blocks one of them. Deleting a file is not checked
What GitHub Copilot rebuilds or loses (1)
PostToolUse [Write|Edit|MultiEdit] → post-edit-format.jsrebuilt, Copilot names its edit arguments differently (path, file_text, old_str, new_str): the adapter rebuilds the Write or Edit payload the hook expects, file by file for a patch
What Any agent rebuilds or loses (2)
PreToolUse [Bash] → pre-bash-guard.jslost, no hook system is assumed for this agent: the hook does not run. Install for Claude Code, Codex or GitHub Copilot to enforce itPostToolUse [Write|Edit|MultiEdit] → post-edit-format.jslost, no hook system is assumed for this agent: the hook does not run. Install for Claude Code, Codex or GitHub Copilot to enforce it
The 9 guard cases
| Case | Must | Claude Code | Codex | GitHub Copilot |
|---|---|---|---|---|
| rustfmt run directly | block | ✓ blocks | ✓ blocks | ✓ blocks |
| cargo fmt | allow | ✓ allows | ✓ allows | ✓ allows |
| bun bd under a timeout | block | ✓ blocks | ✓ blocks | ✓ blocks |
| bun bd without a timeout | allow | ✓ allows | ✓ allows | ✓ allows |
| updating snapshots with a test name filter | block | ✓ blocks | ✓ blocks | ✓ blocks |
| the release bun used for tests | block | ✓ blocks | ✓ blocks | ✓ blocks |
| the release bun, asked for on purpose | allow | ✓ allows | ✓ allows | ✓ allows |
| the debug build testing one file | allow | ✓ allows | ✓ allows | ✓ allows |
| a harmless command | allow | ✓ allows | ✓ allows | ✓ allows |
The checks are the publisher's own run: the hub never runs a harness. baudrier selftest runs them again in your repository.
Hooks (run on your computer) 2
PreToolUse [Bash]runspre-bash-guard.jsPostToolUse [Write|Edit|MultiEdit]runspost-edit-format.js
Skills 13
implementing-jsc-classes-cppHow the JavaScript classes that are written by hand in C++ are built. Use when changing one of them. For a new class use implementing-jsc-classes-rust.implementing-jsc-classes-rustCreates JavaScript classes using Bun's bindings generator (.bind.ts). Use when implementing new JS APIs in Rust with JSC integration, prototypes, or constructors.javascriptcore-garbage-collectorJSC GC reference for Bun. Use for use-after-free, JS object leaks, "collected too early", or when touching WriteBarrier, visitChildren, visitAdditionalChildren, JSRef, JSC::Strong/Weak, hasPendingActivity, ensureStillAlive, addOpaqueRoot, reportExtraMemoryAllocated, IsoSubspace, HeapAnalyzer, finalize.rust-system-callsGuides using bun_sys for system calls and file I/O in Rust. Use when implementing file operations, opening fds, or any syscall path instead of std::fs or libc.slowest-testsFind the top-N slowest test files in CI from a recent BuildKite run, optionally posting the results to a Slack channel as a formatted table. Use when asked to find slow CI tests, "what's making CI slow", or to post a slow-test report to Slack.verifyVerify a Bun runtime change by driving the debug binary end-to-end.writing-bundler-testsGuides writing bundler tests using itBundled/expectBundled in test/bundler/. Use when creating or modifying bundler, transpiler, or code transformation tests.writing-dev-server-testsGuides writing HMR/Dev Server tests in test/bake/. Use when creating or modifying dev server, hot reloading, or bundling tests.find-duplicate-prsFind open PRs that may duplicate a given PRfind-issuesFind GitHub issues that a PR might fixupgrade-boringsslUpgrade Bun's BoringSSL fork (oven-sh/boringssl) to the latest upstream google/boringsslupgrade-nodejsUpgrading Bun's Self-Reported Node.js Versionupgrade-webkitUpgrade Bun's WebKit fork to the latest upstream version of WebKit
Its hooks need bun.
Notes from the publisher
- The licence was read by a person. Bun's licence file says "Bun itself is MIT-licensed" and then lists the licences of the libraries it bundles, so the tool could not name it alone. The harness records that MIT was entered by hand.
- One check never fires in Codex: the guard reads the time limit Claude Code sends with a command, and Codex does not send one. The nine cases proven here do not depend on it.
- The format hook needs the project's own Prettier (
./node_modules/.bin/prettier). Without it, the hook does nothing.
Files 20
- 1.3 kB
- 7.3 kB
- 1.7 kB
- 5.7 kB
- 1.4 kB
- 16.8 kB
- 1.2 kB
- 3.3 kB
- 3.9 kB
- 7.0 kB
- 2.8 kB
- 25.1 kB
- 3.9 kB
- 3.6 kB
- 7.0 kB
- 3.6 kB
- 4.2 kB
- 2.6 kB
- 4.5 kB
- 3.0 kB
Loading hooks/post-edit-format.js...
MIT (read and named by a person), its licence file travels with every install; from oven-sh/bun at e13b16b, absorbed on 2026-11-26. The files are the source repository authors' work, copied unchanged; Baudrier AI is not affiliated with that project.