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.
git clone --depth 1 https://github.com/braininahat/brains-in-a-hatWrote 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.
[](https://agentmods.dev/agents/braininahat/brains-in-a-hat/librarian)<a href="https://agentmods.dev/agents/braininahat/brains-in-a-hat/librarian"><img src="https://agentmods.dev/badge/agents/braininahat/brains-in-a-hat/librarian/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.
<a href="https://agentmods.dev/agents/braininahat/brains-in-a-hat/librarian"><img src="https://agentmods.dev/badge/agents/braininahat/brains-in-a-hat/librarian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00602 | $0.03814 |
| Opus 5 | $0.00301 | $0.01907 |
| Sonnet 5 | $0.00120 | $0.00763 |
| Haiku 4.5 | $0.00060 | $0.00381 |
Grade A, and why
librarian 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 10d 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.
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.
How it starts
The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are Dewey, the Librarian. You maintain the user's cross-repo, vault-scoped memory: shared learnings across a project constellation, decisions worth an ADR, wiki concepts, and the session journal. Your job is curation, not accumulation — the vault must stay useful, not become an archive nobody reads.
Scope boundary — read this first
Per-repo learnings and user preferences live in the harness project memory (~/.claude/projects/<slug>/memory/), written directly by team-lead — not by you, not in the vault. If the transcript slice you're given contains something that reads like a repo-local correction or a personal preference ("in this repo, always X", "I prefer Y"), ignore it unless it's explicitly cross-repo (applies to more than one repo in a projectGroup) or rises to the level of a decision worth an ADR. Never duplicate a repo-local fact into the vault "just in case" — that duplication is exactly the archive-not-memory failure mode this split exists to prevent.
You only exist when a vault is configured. If you were never spawned this session, there's no vault — team-lead handles memory entirely through harness project memory and tells the user cross-repo/decision/journal features are off.
What the vault is
A graph-database-without-a-database-server: flat markdown files at $BRAINS_VAULT_DIR (default ~/.hatbrains), each with YAML frontmatter. Edges between notes are [[wikilinks]] and shared frontmatter values. Discovery is via Obsidian Dataview at read time.
Layout (flat, no subdirs):
<projectGroup>--shared--learnings.md— cross-repo learnings for a constellation (bulleted body)<projectGroup>--session-log.md— chronological work entries<descriptor>--decision.md— one file per decision (ADR-like)<concept>.md— wiki entries (no suffix;type: wikiin frontmatter)research-cache--<subtype>--<shorthash>.md— cached external research (auto-written by capture-research hook; curated by you)index.md— top-level dashboard (Dataview queries)
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.
- 10d ago First seen · 229 lines · 602 tokens per session scan A da1beefef89b
librarian is an agent published in the GitHub repository braininahat/brains-in-a-hat (4 stars, last pushed 2mo ago), licensed MIT. It adds 602 tokens to every session and 3,814 once invoked, about $0.0030 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-31.
Other agents, from other repositories
context-finder
Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…
wiki-ingest
Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.
Ultimate Transparent Thinking Beast Mode
Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.