bun:migrate

bun:migrate is a command for Claude Code from secondsky/claude-skills. It costs 13 tokens per session (660 once invoked), scanned A, original, MIT.

A migration guide and command set for moving an existing Node.js project to Bun. Node.js and Bun are runtimes for running JavaScript outside a web browser.

In plain words
What is it for?
Use it to inspect an existing project, replace npm or other lockfiles, update commands, configure Bun, adapt tests, and run the migrated test suite.
Why use it?
It reduces the manual work of changing package management, scripts, configuration, tests, and TypeScript settings during the move.

Command for Claude Code

Written for Claude Code: arguments in frontmatter.

Part of the bun plugin — 27 skills, 6 commands, 3 agents, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/secondsky/claude-skills/bun-migrate
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install bun, the plugin that ships this one along with the rest of its 27 skills, 6 commands, 3 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bun:migrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/secondsky/claude-skills/bun-migrate.svg)](https://agentmods.dev/commands/secondsky/claude-skills/bun-migrate)
Your own site
<a href="https://agentmods.dev/commands/secondsky/claude-skills/bun-migrate"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/bun-migrate.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00660
Opus 5 $0.00006 $0.00330
Sonnet 5 $0.00003 $0.00132
Haiku 4.5 $0.00001 $0.00066

Measured 6d ago against content hash 46f29676d47b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

bun:migrate scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

| child_process | ✅ Full |
plugins/bun/commands/bun-migrate.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migrate to Bun

Migrate an existing Node.js project to use Bun as runtime and package manager.

Migration Steps

1. Analyze Current Project

Check for:

  • Current package manager (package-lock.json, yarn.lock, pnpm-lock.yaml)
  • Node.js version requirements
  • Native dependencies
  • Scripts that use Node-specific features
  • Test framework (Jest, Mocha, Vitest)

2. Package Manager Migration

# Remove old lockfiles
rm -f package-lock.json yarn.lock pnpm-lock.yaml

# Install with Bun
bun install

3. Update Scripts

Replace in package.json:

Before After
node script.js bun script.js
ts-node script.ts bun script.ts
npx command bunx command
npm run bun run
jest bun test
vitest bun test

4. Configuration Files

Create or update:

bunfig.toml

[install]
auto-install = true

[run]
bun = true

5. Test Migration

For Jest projects:

# Update imports
# Before: import { describe, it } from '@jest/globals'
# After:  import { describe, test } from 'bun:test'

# Run tests
bun test

6. TypeScript Configuration

Update tsconfig.json:

{
  "compilerOptions": {
    "types": ["bun-types"]
  }
}

Install types:

bun add -D bun-types

Compatibility Checks

Node.js APIs

API Bun Support
fs ✅ Full
path ✅ Full
http/https ✅ Full
crypto ✅ Full
child_process ✅ Full
worker_threads ✅ Full
stream ✅ Full

Potential Issues

  1. Native addons - May need recompilation
  2. Node.js-specific env vars - Check for NODE_* variables
  3. Babel/webpack configs - Usually not needed with Bun
  4. Jest configs - Convert to bunfig.toml

Rollback Plan

If migration fails:

# Restore old lockfile
git checkout package-lock.json

# Remove Bun lockfile
rm bun.lockb

# Reinstall with npm
npm install

Questions to Ask

  • "Do you have any native Node.js addons?"
  • "Are you using Jest for testing?"
  • "Do you need to maintain Node.js compatibility?"

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 137 lines · 13 tokens per session scan A 46f29676d47b

Subscribe to this mod's changes

bun:migrate is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed 3d ago), licensed MIT. It adds 13 tokens to every session and 660 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.