brain-ops

brain-ops is a skill for Claude Code from garrytan/gbrain. It costs 42 tokens per session (3,908 once invoked), scanned A, original, MIT.

The core operating procedure for a brain, a personal knowledge base: look up existing information, read and enrich it, then write changes with sources and links.

In plain words
What is it for?
Use it before interacting with brain pages, memory, entities, links, timelines, or other brain data.
Why use it?
It keeps the agent from creating isolated or unsupported notes. The procedure supports both reading and writing, with source attribution, related-page links, and durable memory where appropriate.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: built for gbrain.

Part of the gbrain-coding plugin — 21 skills shipped together

Good fit Use it before interacting with brain pages, memory, entities, links, timelines, or other brain data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/garrytan/gbrain/brain-ops
About the project

GBrain is a memory and retrieval layer for AI agents that searches, connects, and synthesizes information from stored sources. It is used to give coding agents and autonomous agents access to knowledge beyond their current code, including shared company information with access controls. The catalogue add-ons help agents operate GBrain and connect it to agent workflows.

garrytan/gbrain · 31,034 stars · on GitHub

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.

Any agent
npx skills add garrytan/gbrain --skill brain-ops
Clone the repo
git clone --depth 1 https://github.com/garrytan/gbrain

Made for: Claude Code.

Or install gbrain-coding, the plugin that ships this one along with the rest of its 21 skills.

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 brain-ops

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/garrytan/gbrain/brain-ops"><img src="https://agentmods.dev/badge/skills/garrytan/gbrain/brain-ops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,908 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 24 Apr 2026
  • Snyk pass 24 Apr 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 193
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00042 $0.03908
Opus 5.5 $0.00017 $0.01563
Sonnet 5.5 $0.00008 $0.00782
Haiku 4.5 $0.00004 $0.00391

Measured 4d ago against content hash 02aac0baa4ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

brain-ops 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 4d 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.

plugin-variants/gbrain-coding/skills/brain-ops/SKILL.md · 284 lines

How it starts

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

Brain Operations — The Ambient Context Layer

Recall relevant context before responding. Save explicit requests with provenance; automatic capture is off until the user opts in. Reading this skill does not enable capture, delegation, or paid enrichment. A chat-only instruction suppresses writes for that turn, including when standing capture is enabled.

Convention: See skills/conventions/brain-first.md for the 5-step lookup protocol. Convention: See skills/conventions/quality.md for citation and back-link rules.

Memory verbs (MEMORY_VERBS v1, gbrain ≥ 0.43). Over MCP, prefer the five core memory verbs for the read/write cycle: remember(fact, provenance, ttl?) to save a single durable fact (mandatory provenance; dedupes + supersedes), recall(query | entity, budget_tokens) to read it back budget-packed, entity(name) for a zero-LLM card, synthesize(question) for the expensive cross-page answer, forget(id) to withdraw active memory (history, source material, and backups may remain). context_pack and delta complete the seven-verb surface. Use remember instead of extract_facts when you already have ONE formed fact; put_page / add_link / add_timeline_entry stay the page/graph write path. Fall back to the classic ops when the verbs aren't on the surface. Contract: docs/protocol/MEMORY_VERBS_v1.md.

Tight-budget page questions: explicitly use recall({query: "zebra telescope", budget_tokens: 75, budget_policy: "query_first"}) so ranked page evidence packs before recent facts. CLI: gbrain recall --query 'zebra telescope' --budget-tokens 75 --budget-policy query_first --json. Keep entity-first, event/session-filtered and fact-focused questions on their existing facts-first route; do not change context_pack. Costs are character-based estimates, and an oversized first item is dropped without skipping or truncation. Read budget_packing before interpreting an empty result as missing memory. See skills/query/SKILL.md for the MCP request and caller example. Guidance is not native-harness activation: adoption remains unverified until a fresh conversation is observed making the opted-in call.

Choose a readback path that can see the intended visibility. Trusted local CLI callers can recall and withdraw private facts. Every MCP caller, including stdio, and a thin CLI connected to MCP currently have world-only fact recall and withdrawal. A request to remember does not authorize making real private information world-visible. Use a trusted local write/readback path for private memory when available. If only remote access is available, a successful private write receipt confirms storage, but private recall remains unverified; explain that limit and the trusted local path needed for private readback or withdrawal. Do not widen visibility or request broader OAuth scopes merely to make verification pass. For an MCP connection test, use only a harmless synthetic visibility: "world" fixture with the user's test authorization, retain its ID, and withdraw it afterward.

<REDACTED:pattern> in a result (for example <REDACTED:url_credentials> or <REDACTED:high_entropy_assignment>) means the brain holds a credential-shaped value there and withheld it from this response; the stored page is unchanged. Tell the user which kind of value was withheld and that it is readable on the brain host. Do not retry other operations to recover it, and do not echo a guess. A credential the user asked you to remember is withheld from remote recall by design: every MCP caller, including stdio, and a thin CLI connected to MCP is remote, so only gbrain recall run on the brain host shows it as written. Docs: docs/guides/write-refusals.md#secret-scan-refusals-and-redaction.

Keyless brains: when extract_facts returns skipped: extraction_unavailable, YOU are the extractor — pull the facts from the turn yourself and write each one via remember with kind set (event | preference | commitment | belief | fact — those five are the frozen protocol enum; the idea kind the extractor and DB carry is NOT one of them) and the visibility the envelope's agent_action names (default private — pin it; remember defaults to world), or author a ## Facts fence on the entity page. A skipped: extraction_failed envelope (server-side extractor errored on this turn; reason names why) invites the same manual remember fallback for that turn — automatic extraction stays on for future writes.

Read the full file on GitHub · 284 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. 4d ago Changed 02aac0baa4ae
  2. 9d ago Changed · +1 lines 430613b14606
  3. 12d ago Changed · -10 lines 1606f1557668
  4. 13d ago Changed · +4 lines 097eb6a81860
  5. 14d ago Changed · +1 lines 5003fe4d02c4
  6. 15d ago Changed 59b1a1725cdb
  7. 16d ago Changed · +19 lines 01707dbb36bd
  8. 18d ago Changed · +11 lines 6586d82a135f
  9. 20d ago Changed · +6 lines 075666e81df0
  10. 25d ago First seen · 252 lines · 42 tokens per session scan A 566dcf7f12f1

Subscribe to this mod's changes

brain-ops is a skill published in the GitHub repository garrytan/gbrain (31,034 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 3,908 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens

forget

Remove a personal fact, preference, relationship detail, topic, or prior event from Muse's active memory and stop existing copies or automations from bringing it back. Use for explicit requests such as 'forget that', 'don't remember this about me', or 'remove that from your memory'. Do not use when 'forget it' merely…

asgeirtj/system_prompts_leaks · 74 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

establishing-project-context

Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.

GanyuanRan/Aegis · 45 tokens