Agent skill

Bun File Io

by secondsky in secondsky/claude-skills

A skill your agent uses for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata.

MITAuto-check passed

Install Bun File Io

skills CLI
$ npx skills add secondsky/claude-skills --skill bun-file-io -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills bun-file-io --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/bun/skills/bun-file-io .claude/skills/bun-file-io && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bun-file-io
GitHub stars
227
Token cost
~1.9k tokens
SKILL.md length
107 words
Files
1
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata.

  • Bun file I/O: Bun.file
  • SKILL.md covers Reading Files, Writing Files, Streaming and Directory Operations, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Bun File Io is an agent skill from secondsky/claude-skills. Use for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Bun file I/O: Bun.file

Example prompts

  • “/bun-file-io”

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bun File Io loads about 1.9k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 107 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~25
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 107 words, ~1,933 tokens.

Download SKILL.mdSave it as .claude/skills/bun-file-io/SKILL.md (or your agent's skills folder).
name
bun-file-io
description
Use for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata.
metadata.version
1.0.0
license
MIT

Bun File I/O

Bun provides fast, optimized file operations via Bun.file() and Bun.write().

Reading Files

Bun.file()
typescript
// Create file reference (lazy, doesn't read yet)
const file = Bun.file("./data.txt");

// File properties
console.log(file.size);        // Size in bytes
console.log(file.type);        // MIME type
console.log(file.name);        // File path
console.log(await file.exists()); // Boolean

// Read content
const text = await file.text();
const json = await file.json();
const buffer = await file.arrayBuffer();
const bytes = await file.bytes();   // Uint8Array
const stream = file.stream();       // ReadableStream
Read Specific Types
typescript
// JSON file
const config = await Bun.file("config.json").json();

// Text file
const content = await Bun.file("readme.md").text();

// Binary file
const binary = await Bun.file("image.png").arrayBuffer();

// With import attributes
import data from "./data.json" with { type: "json" };
import text from "./content.txt" with { type: "text" };

Writing Files

Bun.write()
typescript
// Write string
await Bun.write("./output.txt", "Hello World");

// Write JSON
await Bun.write("./data.json", JSON.stringify({ key: "value" }, null, 2));

// Write binary
await Bun.write("./output.bin", new Uint8Array([1, 2, 3]));

// Write from Response
const response = await fetch("https://example.com/image.png");
await Bun.write("./image.png", response);

// Write from another file (efficient copy)
await Bun.write("./copy.txt", Bun.file("./original.txt"));

// Write with options
await Bun.write("./file.txt", "content", {
  mode: 0o644,  // Unix permissions
});
Appending
typescript
// Using Bun.file writer
const file = Bun.file("./log.txt");
const writer = file.writer();

writer.write("Line 1\n");
writer.write("Line 2\n");
await writer.flush();
writer.end();

// Or use node:fs
import { appendFile } from "node:fs/promises";
await appendFile("./log.txt", "New line\n");

Streaming

Read Stream
typescript
const file = Bun.file("./large-file.txt");
const stream = file.stream();

const reader = stream.getReader();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  // Process chunk (Uint8Array)
  console.log(value);
}
Write Stream
typescript
const file = Bun.file("./output.txt");
const writer = file.writer();

for await (const chunk of dataSource) {
  writer.write(chunk);
}

await writer.end();
Pipe Streams
typescript
// File to file
const input = Bun.file("./input.txt");
const output = Bun.file("./output.txt");
await Bun.write(output, input);

// HTTP response to file
const response = await fetch(url);
await Bun.write("./download.zip", response);

// Process stream
const file = Bun.file("./data.txt");
const stream = file.stream();

const transformed = stream.pipeThrough(
  new TransformStream({
    transform(chunk, controller) {
      // Process chunk
      controller.enqueue(chunk.toUpperCase());
    },
  })
);

Directory Operations

typescript
import { readdir, mkdir, rmdir, stat } from "node:fs/promises";
import { existsSync, mkdirSync } from "node:fs";

// List directory
const files = await readdir("./src");
const filesWithTypes = await readdir("./src", { withFileTypes: true });

for (const entry of filesWithTypes) {
  if (entry.isDirectory()) {
    console.log(`Dir: ${entry.name}`);
  } else if (entry.isFile()) {
    console.log(`File: ${entry.name}`);
  }
}

// Create directory
await mkdir("./new-dir", { recursive: true });

// Remove directory
await rmdir("./old-dir", { recursive: true });

// Check if exists
const exists = existsSync("./path");

Glob Patterns

typescript
// Using Bun.Glob
const glob = new Bun.Glob("**/*.ts");

// Scan directory
for await (const file of glob.scan({ cwd: "./src" })) {
  console.log(file); // Relative paths
}

// Get all matches
const files = await Array.fromAsync(glob.scan("./src"));

// With options
const glob2 = new Bun.Glob("**/*.{ts,tsx}");
for await (const file of glob2.scan({
  cwd: "./src",
  dot: true,           // Include dotfiles
  absolute: true,      // Return absolute paths
  onlyFiles: true,     // Only files, not directories
})) {
  console.log(file);
}

// Test if path matches
const pattern = new Bun.Glob("*.ts");
pattern.match("file.ts");    // true
pattern.match("file.js");    // false

File Metadata

typescript
import { stat, lstat } from "node:fs/promises";

const stats = await stat("./file.txt");

console.log(stats.size);          // Size in bytes
console.log(stats.isFile());      // Is regular file
console.log(stats.isDirectory()); // Is directory
console.log(stats.isSymbolicLink()); // Is symlink
console.log(stats.mtime);         // Modified time
console.log(stats.ctime);         // Changed time
console.log(stats.atime);         // Access time
console.log(stats.mode);          // Permissions

Path Operations

typescript
import { join, dirname, basename, extname, resolve } from "node:path";

const filePath = "/home/user/project/src/index.ts";

join("a", "b", "c");           // "a/b/c"
dirname(filePath);             // "/home/user/project/src"
basename(filePath);            // "index.ts"
basename(filePath, ".ts");     // "index"
extname(filePath);             // ".ts"
resolve("./relative");         // Absolute path

// Bun-specific
import.meta.dir;   // Directory of current file
import.meta.file;  // Filename
import.meta.path;  // Full path

Common Patterns

Read JSON Config
typescript
async function loadConfig<T>(path: string): Promise<T> {
  const file = Bun.file(path);
  if (!(await file.exists())) {
    throw new Error(`Config not found: ${path}`);
  }
  return file.json();
}

const config = await loadConfig<AppConfig>("./config.json");
Copy Directory
typescript
import { readdir, mkdir, stat } from "node:fs/promises";
import { join } from "node:path";

async function copyDir(src: string, dest: string) {
  await mkdir(dest, { recursive: true });

  for (const entry of await readdir(src, { withFileTypes: true })) {
    const srcPath = join(src, entry.name);
    const destPath = join(dest, entry.name);

    if (entry.isDirectory()) {
      await copyDir(srcPath, destPath);
    } else {
      await Bun.write(destPath, Bun.file(srcPath));
    }
  }
}
Watch Files
typescript
import { watch } from "node:fs";

watch("./src", { recursive: true }, (event, filename) => {
  console.log(`${event}: ${filename}`);
});

// Or with Bun's built-in (faster)
const watcher = Bun.spawn(["bun", "--watch", "src/index.ts"]);
Temp Files
typescript
import { mkdtemp } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";

// Create temp directory
const tempDir = await mkdtemp(join(tmpdir(), "app-"));
console.log(tempDir); // /tmp/app-xxxxx

// Write temp file
const tempFile = join(tempDir, "data.txt");
await Bun.write(tempFile, "temporary data");

Common Errors

ErrorCauseFix
ENOENTFile not foundCheck path, use exists()
EACCESPermission deniedCheck file permissions
EISDIRIs a directoryUse readdir() for directories
EEXISTAlready existsUse recursive: true for mkdir

When to Load References

Load references/streams-advanced.md when:

  • Transform streams
  • Compression streams
  • Binary protocols

Load references/performance.md when:

  • Large file handling
  • Memory optimization
  • Concurrent operations

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/bun/skills/bun-file-io of secondsky/claude-skills.

Open the folder on GitHubat commit 8837836

Compare with similar skills

Bun File Io next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bun File Io compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bun File Io this skillsecondsky/claude-skills227—~1.9kAutomated safety check: PassMIT
Bun Runtimeaffaan-m/ECC275k1 repos~443Automated safety check: NotesMIT
Monitor Streamruvnet/ruflo74k—~188Automated safety check: PassMIT
Streaming HTMLthedaviddias/Front-End-Checklist74k—~553Automated safety check: PassMIT
Directory Submissionscoreyhaines31/marketingskills54k2 repos~6.3kAutomated safety check: PassMIT
Bun Runtimeaffaan-m/ECC275k—~428Automated safety check: NotesMIT

Similar skills

  • Bun Runtime

    affaan-m/ECC

    Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。

    275k GitHub starsUsed in 1 repo~443 tokens
    Auto-check: notes
  • Monitor Stream

    ruvnet/ruflo

    Stream live swarm events using the Monitor tool for real-time observability

    74k GitHub stars~188 tokensUpdated today
    DevOps & CloudAuto-check passed
  • Streaming HTML

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing server-side rendering setup, Next.js App Router pages, or Node.js HTTP handlers to verify that HTML is streamed incrementally rather than buffered until…

    74k GitHub stars~553 tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Directory Submissions

    coreyhaines31/marketingskills

    When the user wants to submit their product to startup, SaaS, AI, agent, MCP, no-code, or review directories for backlinks, domain rating, and discovery.

    54k GitHub starsUsed in 2 repos~6.3k tokens
    Marketing & SEOAuto-check passed
  • Bun Runtime

    affaan-m/ECC

    ランタイムとしてのBun、パッケージマネージャー、バンドラー、テストランナー。Bun対Nodeを選択する場合、移行メモ、Vercelサポート。

    275k GitHub stars~428 tokensUpdated 3 days ago
    Auto-check: notes
  • Streaming

    alsk1992/CloddsBot

    Response streaming configuration and real-time output. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 1 repo~810 tokens
    Backend & APIsAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 10 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 10 days ago
    Auto-check passed

Questions about Bun File Io

What does Bun File Io do?

A skill your agent uses for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata. Bun File Io is an agent skill from secondsky/claude-skills.write, streams, directories, glob patterns, metadata.

When should I use Bun File Io?

Bun File Io fits situations like: bun file I/O: Bun.file.

How do I install Bun File Io in Claude Code?

Run `npx skills add secondsky/claude-skills --skill bun-file-io -a claude-code`. Or copy the skill folder (plugins/bun/skills/bun-file-io in secondsky/claude-skills) into .claude/skills/bun-file-io in your project. Claude Code loads it when a task matches its description.

How do I install Bun File Io in Codex?

Run `npx skills add secondsky/claude-skills --skill bun-file-io -a codex`. Or copy the skill folder (plugins/bun/skills/bun-file-io in secondsky/claude-skills) into .agents/skills/bun-file-io in your project. Codex loads it when a task matches its description.

Can I use Bun File Io in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill bun-file-io -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bun-file-io, .gemini/skills/bun-file-io, .github/skills/bun-file-io and .opencode/skills/bun-file-io in your project.

What does Bun File Io need to run?

SKILL.md names no scripts, command-line tools or credentials: Bun File Io is instructions for the agent only.

Does Bun File Io access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bun File Io safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bun File Io use?

Bun File Io is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bun File Io use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bun File Io?

Skills that share tags, products or a category with Bun File Io: Bun Runtime (affaan-m/ECC, 275k stars), Monitor Stream (ruvnet/ruflo, 74k stars), Streaming HTML (thedaviddias/Front-End-Checklist, 74k stars) and Directory Submissions (coreyhaines31/marketingskills, 54k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bun File Io?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.