bun-shell

bun-shell is a skill for Claude Code from secondsky/claude-skills. It costs 29 tokens per session (1,884 once invoked), scanned A, original, MIT.

A guide to running shell commands from Bun programs using JavaScript. It covers command output, pipes, variables, subprocesses, and errors.

In plain words
What is it for?
Use it to run commands, read their output, chain commands with pipes, expand file lists, and start or manage subprocesses.
Why use it?
It avoids switching between a JavaScript program and separate shell scripts for command-line work. It also shows how to handle failed commands and safely pass values into them.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is await $`rsync -avz ./dist/ server:/app/`;.

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

not rated 257repo +3 2d ago A scan Socket: passSnyk: passSkillSpector: pass 29 tokens original MIT

Good fit Use it to run commands, read their output, chain commands with pipes, expand file lists, and start or manage subprocesses.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/bun-shell/github.svg)](https://agentmods.dev/skills/secondsky/claude-skills/bun-shell)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/bun-shell"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/bun-shell/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-shell

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/bun-shell"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/bun-shell.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,884 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 4 Apr 2026
  • Snyk pass 4 Apr 2026
  • 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.00029 $0.01884
Opus 5.5 $0.00012 $0.00754
Sonnet 5.5 $0.00006 $0.00377
Haiku 4.5 $0.00003 $0.00188

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

Security

Grade A, and why

bun-shell 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 3mo 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.

## Bun.spawnSync
plugins/bun/skills/bun-shell/SKILL.md · 394 lines

How it starts

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

Bun Shell

Bun provides powerful shell scripting capabilities with template literals and spawn APIs.

Bun.$ (Shell Template)

Basic Usage

import { $ } from "bun";

// Run command
await $`echo "Hello World"`;

// Get output
const result = await $`ls -la`.text();
console.log(result);

// JSON output
const pkg = await $`cat package.json`.json();
console.log(pkg.name);

Variable Interpolation

import { $ } from "bun";

const name = "world";
const dir = "./src";

// Safe interpolation (escaped)
await $`echo "Hello ${name}"`;
await $`ls ${dir}`;

// Array expansion
const files = ["a.txt", "b.txt", "c.txt"];
await $`touch ${files}`;

Piping

import { $ } from "bun";

// Pipe commands
const result = await $`cat file.txt | grep "pattern" | wc -l`.text();

// Chain with JavaScript
const files = await $`ls -la`.text();
const lines = files.split("\n").filter(line => line.includes(".ts"));

Error Handling

import { $ } from "bun";

// Throws on non-zero exit
try {
  await $`exit 1`;
} catch (err) {
  console.log(err.exitCode); // 1
  console.log(err.stderr);
}

// Quiet mode (no throw)
const result = await $`exit 1`.quiet();
console.log(result.exitCode); // 1

// Check exit code
const { exitCode } = await $`grep pattern file.txt`.quiet();
if (exitCode !== 0) {
  console.log("Pattern not found");
}

Output Types

import { $ } from "bun";

// Text
const text = await $`echo hello`.text();

// JSON
const json = await $`cat data.json`.json();

// Lines
const lines = await $`ls`.lines();

// Blob
const blob = await $`cat image.png`.blob();

// ArrayBuffer
const buffer = await $`cat binary.dat`.arrayBuffer();

Environment Variables

import { $ } from "bun";

// Set env for command
await $`echo $MY_VAR`.env({ MY_VAR: "value" });

// Access current env
$.env.MY_VAR = "value";
await $`echo $MY_VAR`;

// Clear env
await $`env`.env({});

Working Directory

Read the full file on GitHub · 394 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. 3mo ago First seen · 394 lines · 29 tokens per session scan A 3e87a7079112

Subscribe to this mod's changes

bun-shell is a skill published in the GitHub repository secondsky/claude-skills (257 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 1,884 once invoked, about $0.0001 per session on Opus 5.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-09-03.

Related

bun-shell compared with skills from other repositories

bun-shell next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bun-shellsecondsky/claude-skillsSkill2572d agoMITA29Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102kyesterdayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill331k4d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code