bun:debug

bun:debug is a command for coding agents from secondsky/claude-skills. It costs 11 tokens per session (813 once invoked), scanned A, original, MIT.

A command for diagnosing common problems in Bun applications. Bun is a JavaScript runtime and toolkit that can run code, tests, and builds.

In plain words
What is it for?
Use it to inspect module resolution, environment variables, imports, test discovery, mocks, timeouts, coverage, entry points, loaders, and build output.
Why use it?
It turns common runtime, test, and build failures into specific checks and diagnostic commands.

Command

Part of the bun plugin — 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-debug
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Or install bun, the plugin that ships this one along with the rest of its 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:debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/secondsky/claude-skills/bun-debug.svg)](https://agentmods.dev/commands/secondsky/claude-skills/bun-debug)
Your own site
<a href="https://agentmods.dev/commands/secondsky/claude-skills/bun-debug"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/bun-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 813 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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 $0.00011 $0.00813
Opus 5 $0.00005 $0.00407
Sonnet 5 $0.00002 $0.00163
Haiku 4.5 $0.00001 $0.00081

Measured 4d ago against content hash 0c9d40335659, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bun:debug scanned grade A with 0 findings 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/bun/commands/bun-debug.md · 168 lines

How it starts

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

Bun Debug Helper

Diagnose and resolve common issues in Bun applications.

Debugging Categories

Runtime Issues

Check for:

  1. Module resolution - bun --print-resolved
  2. Environment variables - Missing or incorrect env vars
  3. Type errors - TypeScript configuration issues
  4. Import errors - Incorrect import paths or missing exports

Commands:

# Check module resolution
bun --print-resolved src/index.ts

# Verbose output
bun --verbose run src/index.ts

# Check environment
bun --print env

Test Issues

Common problems:

  1. Tests not found - Check file naming (*.test.ts)
  2. Mock not working - Verify mock.module syntax
  3. Timeout - Increase timeout in bunfig.toml
  4. Coverage not generating - Add --coverage flag

Diagnostic commands:

# Run with verbose output
bun test --verbose

# Show test discovery
bun test --list

# Check timeout issues
bun test --timeout 30000

Build Issues

Check for:

  1. Entry point - Verify entrypoints array
  2. External packages - Check external configuration
  3. Loaders - Ensure correct loader for file types
  4. Output format - Verify target and format settings

Debug build:

const result = await Bun.build({
  entrypoints: ["./src/index.ts"],
  outdir: "./dist",
});

if (!result.success) {
  console.error("Build failed:");
  for (const log of result.logs) {
    console.error(log);
  }
}

Memory Issues

Commands:

# Run with memory stats
bun --smol run src/index.ts

# Check memory usage
bun --print-memory run src/index.ts

Common causes:

  • Large file reads without streaming
  • Unbounded caches
  • Event listener leaks
  • Large response bodies

Performance Issues

Profile with:

# CPU profile
bun --cpu-prof run src/index.ts

# Heap snapshot
bun --heap-prof run src/index.ts

Common causes:

  • Synchronous file I/O
  • Blocking operations
  • Inefficient database queries
  • Missing caching

Quick Diagnostics

Run these commands to gather information:

Read the full file on GitHub · 168 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. 4d ago First seen · 168 lines · 11 tokens per session scan A 0c9d40335659

Subscribe to this mod's changes

bun:debug is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed today), licensed MIT. It adds 11 tokens to every session and 813 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.