ClipBrain AGENTS.md

A set of instructions for coding agents working on ClipBrain, a Chrome extension and local Bun server that captures web pages, email threads, videos, PDFs, and Kindle highlights into a personal knowledge base.

In plain words
What is it for?
Use it when modifying ClipBrain's server, browser extension, capture tools, diagnostics, knowledge-base sync, or cleanup workflows.
Why use it?
It gives an agent the project's structure, runtime details, operating rules, and security boundaries. This reduces guesswork and helps the agent avoid unsafe or incorrect changes.

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

Made for: Codex, OpenCode.

Per session 1,011 This file is loaded in full into every session.
When invoked 1,011 The same file — it is already loaded in full.
Security scan A 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.01011 $0.01011
Opus 5 $0.00505 $0.00505
Sonnet 5 $0.00202 $0.00202
Haiku 4.5 $0.00101 $0.00101

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

Security

Grade A, and why

ClipBrain AGENTS.md 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS http://127.0.0.1:19285/health
AGENTS.md · 89 lines

How it starts

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

ClipBrain Agent Instructions

This file is for Codex and other coding agents working in this repo. Claude Code can use CLAUDE.md; keep this file shorter and focused on operational rules.

Project Shape

ClipBrain is a Chrome extension plus a local Bun HTTP server. The extension captures web pages, Kindle highlights, Gmail threads, YouTube transcripts, and PDFs. The server writes captures to the user's local knowledge base through the installed gbrain CLI and optionally syncs markdown to Obsidian.

Important files:

  • server.ts: local HTTP API, dashboard routes, capture handling, diagnostics
  • clipbrain-mcp.ts: ClipBrain-specific MCP tools that call the local server
  • backfill.ts: controlled Knowledge Compiler backfill for legacy captures
  • corpus-report.ts: read-only corpus quality report for junk/duplicate audit
  • cleanup-plan.ts: read-only cleanup recommendations; never deletes or writes
  • cleanup-apply.ts: explicit approval-gated cleanup executor with backups/logs
  • gbrain-list.ts: shared robust gbrain list scanner used by server, corpus, and cleanup flows
  • doctor.ts: first-run diagnostics for launch readiness and local setup issues
  • twitter-agent.ts: draft-only building-in-public generator; never posts to X
  • service-worker.js: MV3 background worker, capture dispatch, offline queue
  • content-script.js, kindle-content-script.js, gmail-content-script.js: page extractors
  • post-process.ts: optional OpenAI enrichment after a capture is saved
  • dashboard.html, popup.html, popup.js: local UI surfaces
  • setup.sh, setup-mcp.sh: local install and MCP configuration
  • test/: Bun tests for server and post-processing behavior

Runtime Facts

  • Use Bun. Primary checks are bun run doctor, bun test, bun audit, and shell syntax checks for setup scripts.
  • The server binds to 127.0.0.1:19285 by default. It can be overridden with --host, --port, GBRAIN_CAPTURE_HOST, and GBRAIN_CAPTURE_PORT.
  • MCP setup registers both gbrain (gbrain serve) and clipbrain (bun clipbrain-mcp.ts). Keep gbrain for broad brain tools; use clipbrain for ClipBrain-specific agent handoffs such as context_pack.
  • Do not reintroduce a vendored gbrain dependency or local ./bin/gbrain build path. The app should use GBRAIN_BIN when set, then gbrain from PATH.
  • package-lock.json is intentionally absent. This repo uses bun.lock.
  • Runtime data files such as .captures.jsonl, .highlight-count, .highlight-counts.json, .clipbrain.json, .cleanup-actions.jsonl, and .cleanup-backups/ must stay out of commits. Tests should use CLIPBRAIN_DATA_DIR for isolated state.
  • Use bun run backfill --limit N for a dry-run before applying compiler upgrades with bun run backfill --apply --limit N.
  • Use bun run corpus to inspect likely junk, duplicate titles, and pending compiler upgrades. It is read-only.
  • Use bun run cleanup-plan to turn the corpus audit into a read-only keep/delete/merge/title-fix proposal before any manual cleanup.
  • Use bun run cleanup-apply for a dry-run of executable cleanup operations. Never run it with --execute unless the user has approved exact --approve action:slug tokens.

Read the full file on GitHub · 89 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. 2d ago First seen · 89 lines · 1,011 tokens per session scan A f5a2a3e0c350

Subscribe to this mod's changes

ClipBrain AGENTS.md is an instructions file published in the GitHub repository agentpilled/ClipBrain (24 stars, last pushed 2mo ago), licensed MIT. It adds 1,011 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.