bb AGENTS.md

A set of coding guidelines for the bb project. It covers naming, comments, data validation, types, contracts, and documentation.

In plain words
What is it for?
Use it when renaming concepts, designing types or routes, validating inputs, deciding where types belong, and updating documentation.
Why use it?
It gives contributors consistent rules for changing the code safely and keeping data boundaries clear. The input does not describe the project’s broader purpose.

Instructions file for CodexOpenCode

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/get-bb/bb/agents-md
Clone the repo
git clone --depth 1 https://github.com/get-bb/bb

Made for: Codex, OpenCode.

Per session 2,169 This file is loaded in full into every session.
When invoked 2,169 The same file — it is already loaded in full.
Security scan A 0 findings. 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.02169 $0.02169
Opus 5 $0.01085 $0.01085
Sonnet 5 $0.00434 $0.00434
Haiku 4.5 $0.00217 $0.00217

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

Security

Grade A, and why

bb AGENTS.md 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 yesterday.

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.

AGENTS.md · 82 lines

How it starts

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

Codebase Guidelines

Simplicity First

  • When renaming a domain concept, search project-wide for stale names in variables, files, query keys, constants, tests, and docs. TypeScript only catches type references.

Code Comments

  • Code comments are forbidden, except for semantic tool directives and Plugin SDK declaration comments.

Types And Contracts

  • Validate and parse data at system boundaries, then pass typed values internally.
  • Avoid unknown and as X casts inside the system. Use them only at genuinely unknowable boundaries such as freeform tool input, then narrow immediately.
  • Keep one-off types near the code that uses them. Move types to a shared package only for a real cross-package contract.
  • Optional contract fields are allowed only when omission has real semantic meaning. Do not use optional or nullable fields to hide defaults.
  • If a field has a default, fill it in once at the server boundary and pass the explicit value through internal routes, commands, and persisted events.
  • Accepted-but-ignored route or command fields are forbidden. Delete them or implement them end to end.
  • Add or update route and command documentation only when behavior is non-obvious.

Server And Daemon

  • The server owns product policy: defaults, instructions, manager behavior, tool lists, and thread behavior.
  • The host daemon owns host-local primitives, provider translation, runtime/session management, and workspace execution.
  • If the server needs host-local data, the daemon should return raw data and the server should assemble product behavior.
  • Do not move responsibility across the server/daemon boundary unless the current change requires it.
  • Always increment HOST_DAEMON_PROTOCOL_VERSION when a change can alter anything sent between the server and host daemon. This includes adding, removing, renaming, or changing the type, requiredness, default, or meaning of fields in session payloads, WebSocket messages, host RPC commands, or host RPC results. A shared TypeScript build passing is not evidence of wire compatibility: enrolled machines can still be running an older daemon. The version mismatch is what triggers their automatic update; without a bump, an old daemon may connect successfully and then enter an invalid-message reconnect loop. If compatibility with the previously shipped daemon has not been deliberately preserved and tested, bump the version.

Read the full file on GitHub · 82 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. yesterday First seen · 82 lines · 2,169 tokens per session scan A a4c316fd3689

Subscribe to this mod's changes

bb AGENTS.md is an instructions file published in the GitHub repository get-bb/bb (2,762 stars, last pushed yesterday), licensed MIT. It adds 2,169 tokens to every session, about $0.0108 per session on Opus 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.