bun-api

bun-api is a skill for Claude Code, Codex from dmythro/agent-skills. It costs 250 tokens per session (10,375 once invoked), scanned A, original, MIT.

A reference for Bun's programming APIs, which let TypeScript scripts work with files, processes, databases, storage, images, and other runtime features. Bun is a JavaScript and TypeScript runtime that runs TypeScript directly.

In plain words
What is it for?
It is for writing and running Bun scripts, handling files and shell commands, starting processes, accessing SQLite or databases, using storage services, and processing images.
Why use it?
It helps an agent choose Bun-native APIs and avoid mixing Bun projects with instructions or runtime patterns intended for Node.js.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Good fit It is for writing and running Bun scripts, handling files and shell commands, starting processes, accessing SQLite or databases, using storage services, and processing images.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dmythro/agent-skills/bun-api
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.

Any agent
npx skills add dmythro/agent-skills --skill bun-api
Clone the repo
git clone --depth 1 https://github.com/dmythro/agent-skills

Made for: Claude Code, Codex.

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-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/dmythro/agent-skills/bun-api.svg)](https://agentmods.dev/skills/dmythro/agent-skills/bun-api)
Your own site
<a href="https://agentmods.dev/skills/dmythro/agent-skills/bun-api"><img src="https://agentmods.dev/badge/skills/dmythro/agent-skills/bun-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 250 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,375 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00250 $0.10375
Opus 5 $0.00125 $0.05188
Sonnet 5 $0.00050 $0.02075
Haiku 4.5 $0.00025 $0.01038

Measured today against content hash de61020c4d8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

bun-api scanned grade A with 2 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(req: Request): Response | Promise<Response> { // unmatched requests

Runs shell commandslowCapability

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

### Bun.spawnSync (Synchronous)
skills/bun-api/SKILL.md · 965 lines

How it starts

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

Bun Runtime API

Bun runs TypeScript natively — no tsc compilation, no ts-node, no build step. Run any .ts file directly with bun file.ts. Use Bun's native APIs instead of Node.js equivalents — they're faster, more ergonomic, and require no additional dependencies.

Critical: In a Bun project (has bun.lock, bun.lockb, bunfig.toml, or @types/bun in devDependencies), always use Bun to run scripts (bun file.ts, not node file.ts) and prefer Bun-native APIs over Node.js equivalents. Mixing runtimes causes subtle bugs and unnecessary retries.

Verified against Bun v1.4.2 (2026-09-05). Features are tagged with the version that introduced them (v1.4+, v1.4.1+, v1.4.2+). Where a release changed existing behavior, both behaviors are stated so this skill stays correct on older projects -- check bun --version before relying on a version-tagged item.

Read Bun's Own Docs First

Bun ships its complete documentation inside bun-types, version-matched to the runtime. In any project with bun-types or @types/bun installed:

node_modules/bun-types/docs/**/*.mdx   # full docs, plus ~180 task-shaped guides/
node_modules/bun-types/*.d.ts          # richest API surface (bun.d.ts, serve.d.ts, sql.d.ts)
node_modules/bun-types/CLAUDE.md       # Bun's own agent rules

Consult them before writing non-trivial Bun code. This skill covers which API to reach for; the shipped docs cover exact signatures and options.

  1. Check the version. Compare bun --version against node_modules/bun-types/package.json. bun init installs @types/bun@latest, which lags behind the runtime -- correct it with bun add -d bun-types@<runtime-version>.
  2. Open by explicit path. With Bun's global virtual store enabled, node_modules/bun-types is a symlink: find node_modules -name '*.mdx' and rg <pattern> node_modules return nothing, while find node_modules/bun-types/docs -name '*.mdx' works.
  3. Never edit files under node_modules/. Under the global store, every project on the machine shares the same inode -- a write there hits all of them. Use bun patch.
  4. Not installed? The same path works online: docs/runtime/sql.mdx is https://bun.com/docs/runtime/sql.

Read the full file on GitHub · 965 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. today Changed · +2 lines de61020c4d8a
  2. 2d ago Changed · +21 lines · +21 tokens per session 545c46a48203
  3. 7d ago First seen · 942 lines · 229 tokens per session scan A e225e8986367

Subscribe to this mod's changes

bun-api is a skill published in the GitHub repository dmythro/agent-skills (6 stars, last pushed yesterday), licensed MIT. It adds 250 tokens to every session and 10,375 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.