bunwv CLAUDE.md

bunwv CLAUDE.md is an instructions file for coding agents from NatiCha/bunwv. It costs 2,125 tokens per session, scanned B, original, MIT.

Project instructions for bunwv, a command-line tool that controls a browser window through Bun.WebView. It uses a background process and separate named sessions.

In plain words
What is it for?
Use them when developing or testing bunwv commands, its browser daemon, session handling, Unix-socket communication, or automatic idle shutdown.
Why use it?
They explain the project’s Bun-only setup, file structure, commands, and how the command-line tool communicates with the browser process.

Instructions file

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 instructions/naticha/bunwv/claude-md
Clone the repo
git clone --depth 1 https://github.com/NatiCha/bunwv

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 bunwv CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/naticha/bunwv/claude-md.svg)](https://agentmods.dev/instructions/naticha/bunwv/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/naticha/bunwv/claude-md"><img src="https://agentmods.dev/badge/instructions/naticha/bunwv/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,125 This file is loaded in full into every session.
When invoked 2,125 The same file — it is already loaded in full.
Security scan B 1 finding. 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.02125 $0.02125
Opus 5 $0.01063 $0.01063
Sonnet 5 $0.00425 $0.00425
Haiku 4.5 $0.00213 $0.00213

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

Security

Grade B, and why

bunwv CLAUDE.md scanned grade B 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 5d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Socket + PID files `chmod 0600` on daemon start — other local users can't connect to this session
CLAUDE.md · 113 lines

How it starts

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

CLAUDE.md

This is bunwv — a headless browser automation CLI built on Bun.WebView (Bun v1.3.12+). Cross-platform: WebKit on macOS (default), Chrome on Linux/Windows (auto-detected).

Project Structure

bunwv.ts          # CLI entry point (shebang, arg parsing, commands)
lib/daemon.ts     # WebView daemon (Bun.serve on Unix socket, all routes)
skills/bunwv/     # Claude Code skill file (SKILL.md)
.claude-plugin/   # Marketplace plugin config
docs/             # Bun.WebView API reference notes

Development

bun bunwv.ts help                    # run locally during dev
bun bunwv.ts start                   # test the daemon
bun bunwv.ts close                   # stop it

Default to Bun for everything — no Node, no npm scripts, no external dependencies.

Architecture

  • CLI (bunwv.ts) parses args into flags/positional, sends HTTP requests to the daemon via Unix socket
  • Daemon (lib/daemon.ts) owns a Bun.WebView instance, exposes all WebView methods as HTTP routes on /tmp/bunwv-<session>.sock
  • Sessions are isolated by name — each gets its own socket, PID file, and WebView instance
  • Auto-shutdown after 30min idle (configurable via --idle-timeout)

Design principles (agent-first)

bunwv is designed for AI coding agents driving it via discrete tool calls. Humans are a secondary user. When the two conflict, agent UX wins.

  • Statelessness over streams. Every command is one request, one response, exit. No long-lived connections, no background processes for the agent to manage. "Tail" patterns use snapshot + cursor (--since <seq>), never streaming.
  • Token efficiency in the happy path. Successful verbs print only what's needed to continue. click, type, navigate, press, scroll, resize, back/forward/reload: empty stdout, exit 0. Don't spend tokens confirming success.
  • Structure only where it earns its tokens. JSON is ~30–50% heavier than prose for small outputs. Use plain text for simple success; use JSON for (a) errors, (b) genuinely structured data (events, console buffer, multi-field status under --json), (c) anywhere the agent must distinguish types — evaluate prints JSON-literal values so strings keep their quotes and numbers don't.
  • Reliability on the unhappy path. Errors are always JSON on stderr with nonzero exit. Exit codes are stable and documented. Agents branch on exit code, not on stderr parsing. (0 ok, 1 generic, 2 usage, 3 timeout, 4 element-not-found, 5 daemon-unreachable.)
  • Error-level console auto-surfaces; everything else is pull. If console.error or console.warn fires during a verb, the daemon attaches X-Console-Errors to the HTTP response and the CLI forwards it to process stderr as {console:[…]}. Normal logs, CDP events, and navigation events stay in ring buffers, fetched on demand via bunwv console --since / bunwv events --since.
  • File paths for binary outputs. Screenshots default to a file path on disk; the agent's file-reading tools handle the image. --encoding base64 and --out - (stdout) exist but are not the default.
  • --json for opt-in uniformity. Agents that prefer one shape over terseness can force an envelope {ok, data?, error?, exitCode} on any command.
  • 1:1 with Bun.WebView. Every capability of the Bun.WebView type is reachable from the CLI. No JS-API-only escape hatches.

Read the full file on GitHub · 113 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. 5d ago First seen · 113 lines · 2,125 tokens per session scan B 5be5a8ad1d6f

Subscribe to this mod's changes

bunwv CLAUDE.md is an instructions file published in the GitHub repository NatiCha/bunwv (213 stars, last pushed 3mo ago), licensed MIT. It adds 2,125 tokens to every session, about $0.0106 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.