bun-file-io

bun-file-io is a skill for Claude Code, Codex from synthetic-sciences/openscience. It costs 49 tokens per session (429 once invoked), scanned A, original, Apache-2.0.

A guide to file and directory operations in Bun, a JavaScript runtime. It covers reading, writing, scanning, deleting, and running external tools, with separate guidance for directory work in Node.js.

In plain words
What is it for?
Editing file operations in the OpenScience CLI, reading and writing files, scanning directories with patterns, handling streams and binary data, checking for files, and launching external programs.
Why use it?
It helps developers choose the repository’s preferred file APIs and avoid inconsistent file-handling code. It also points out checks and patterns for large files, binary data, and directory scans.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Editing file operations in the OpenScience CLI, reading and writing files, scanning directories with patterns, handling streams and binary data, checking for files, and launching external programs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/synthetic-sciences/openscience/bun-file-io
About the project

synthetic-sciences/openscience is an AI workbench that carries out scientific research by reading papers, forming hypotheses, writing and running code, conducting experiments, analyzing results, and preparing reports. Researchers use it for work in machine learning, biology, physics, and chemistry with remote or local models. Catalogue add-ons extend its scientific workflows through skills and instructions.

synthetic-sciences/openscience · 4,082 stars · on GitHub · openscience.sh

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 synthetic-sciences/openscience --skill bun-file-io
Clone the repo
git clone --depth 1 https://github.com/synthetic-sciences/openscience

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-file-io

README.md
[![agentmods](https://agentmods.dev/badge/skills/synthetic-sciences/openscience/bun-file-io/github.svg)](https://agentmods.dev/skills/synthetic-sciences/openscience/bun-file-io)
Your own site
<a href="https://agentmods.dev/skills/synthetic-sciences/openscience/bun-file-io"><img src="https://agentmods.dev/badge/skills/synthetic-sciences/openscience/bun-file-io/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bun-file-io

Your own site · 80×15
<a href="https://agentmods.dev/skills/synthetic-sciences/openscience/bun-file-io"><img src="https://agentmods.dev/badge/skills/synthetic-sciences/openscience/bun-file-io.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 429 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00049 $0.00429
Opus 5.5 $0.00020 $0.00172
Sonnet 5.5 $0.00010 $0.00086
Haiku 4.5 $0.00005 $0.00043

Measured 1mo ago against content hash 73524c673971, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bun-file-io 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 1mo 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.

.openscience/skill/bun-file-io/SKILL.md · 40 lines

What it actually says

Use this when

  • Editing file I/O or scans in backend/cli (the OpenScience CLI package)
  • Handling directory operations or external tools

Bun file APIs (from Bun docs)

  • Bun.file(path) is lazy; call text, json, stream, arrayBuffer, bytes, exists to read.
  • Metadata: file.size, file.type, file.name.
  • Bun.write(dest, input) writes strings, buffers, Blobs, Responses, or files.
  • Bun.file(...).delete() deletes a file.
  • file.writer() returns a FileSink for incremental writes.
  • Bun.Glob + Array.fromAsync(glob.scan({ cwd, absolute, onlyFiles, dot })) for scans.
  • Use Bun.which to find a binary, then Bun.spawn to run it.
  • Bun.readableStreamToText/Bytes/JSON for stream output.

When to use node:fs

  • Use node:fs/promises for directories (mkdir, readdir, recursive operations).

Repo patterns

  • Prefer Bun APIs over Node fs for file access.
  • Check Bun.file(...).exists() before reading.
  • For binary/large files use arrayBuffer() and MIME checks via file.type.
  • Use Bun.Glob + Array.fromAsync for scans.
  • Decode tool stderr with Bun.readableStreamToText.
  • For large writes, use Bun.write(Bun.file(path), text).

Quick checklist

  • Use Bun APIs first.
  • Use path.join/path.resolve for paths.
  • Prefer promise .catch(...) over try/catch when possible.
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. 1mo ago First seen · 40 lines · 49 tokens per session scan A 73524c673971

Subscribe to this mod's changes

bun-file-io is a skill published in the GitHub repository synthetic-sciences/openscience (4,082 stars, last pushed yesterday), licensed Apache-2.0. It adds 49 tokens to every session and 429 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

knowledge-shared-api-and-runtime-schemas

Shared request and response definitions for the server and web app, with runtime checks for incoming data and cleaned JSON schemas for tools. TypeBox is the library used to describe these data shapes.

echoVic/blade-code · 149 tokens

knowledge-interaction-surfaces-hono-server-api-and-streaming

A codebase guide for the server API that connects web clients and automation tools to sessions, tasks, live event streams, terminals, and browser runtimes.

echoVic/blade-code · 156 tokens

knowledge-interaction-surfaces-cli-bootstrap-headless-and-print

A codebase guide for the command-line startup path, including interactive, non-interactive, print, and structured JSONL output modes.

echoVic/blade-code · 160 tokens

knowledge-model-and-provider-runtime

A codebase guide for choosing AI models and providers, sending requests, recovering from failures, and recording runtime information.

echoVic/blade-code · 152 tokens

knowledge-tool-contracts-and-registry

A common contract and registry for built-in tools, MCP tools, and agent-facing tools. It validates tool parameters, decides which tools are visible to a model, and stores session artifacts privately.

echoVic/blade-code · 156 tokens

langbot-dev

Develop, build, and debug the LangBot core backend and web frontend. Use when working inside the LangBot repository — backend (Python/Quart, src/langbot/pkg), the Vite/React web UI, HTTP API controllers/services, Alembic migrations, or the MCP server. Covers the dev environment (uv, pnpm), repo layout, the API auth…

langbot-app/LangBot · 136 tokens