brain-ops

brain-ops is a skill for Claude Code from garrytan/gbrain. It costs 42 tokens per session (2,150 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 · 33,897 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 2,150 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.02150
Opus 5.5 $0.00017 $0.00860
Sonnet 5.5 $0.00008 $0.00430
Haiku 4.5 $0.00004 $0.00215

Measured today against content hash 8f0001584240, 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 today.

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 · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 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 lookup chain and copyable retrieval filters. Convention: See skills/conventions/quality.md for citation and back-link rules.

Contract

This skill guarantees:

  • Brain is checked BEFORE any external API call (brain-first lookup)
  • Explicit save requests and opted-in inbound signals trigger the READ → WRITE loop; enrichment requires its separately configured authority
  • Every outbound response checks brain for relevant context
  • Source attribution on every fact written (inline [Source: ...] citations)
  • User's direct statements are highest-authority data
  • Back-links maintained on every brain write (Iron Law)

Iron Law: every mention of a person or company with a brain page gets a back-link FROM that entity's page TO the page mentioning them.

Read

Before any external lookup of a person, company or topic:

  1. gbrain entity "<name>" — one call for a known entity: description, aliases, open threads, recent events, edges. Near-misses return suggestions.
  2. gbrain search "name" for exact tokens; gbrain query "question" for concepts (a nonzero search count is not proof of completeness).
  3. gbrain get <slug>, gbrain backlinks <slug>, gbrain timeline <slug>.
  4. gbrain think "<question>" only for paid multi-page synthesis ("what changed since Q1"); query is enough to find a page.

External APIs fill gaps; they never start the lookup. Answer from the brain page when one exists, and cite it.

Count with gbrain, not ls. Corpora nest (meetings/YYYY/MM/ beside a flat layer), so a shallow ls dir/*.md undercounts. Use gbrain sources list, gbrain list --type <t>, or find <dir> -name '*.md' | wc -l.

Read the full file on GitHub · 168 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. today Changed 8f0001584240
  2. yesterday Changed 93b2278a9460
  3. 4d ago Changed · +1 lines 71d904bbe611
  4. 9d ago Changed · +1 lines 1fe9f53f7a77
  5. 11d ago Changed · -1 lines 0cfffb6413cc
  6. 21d ago Changed · -123 lines 104c441c23c1
  7. 22d ago Changed · +1 lines 7276401a8cc7
  8. 23d ago Changed · +1 lines 09d09dff1997
  9. 25d ago Changed · +1 lines a46c1ecd77bf
  10. 1mo ago First seen · 287 lines · 42 tokens per session scan A 7ad1f1bb8bf8

Subscribe to this mod's changes

brain-ops is a skill published in the GitHub repository garrytan/gbrain (33,897 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 2,150 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

brain-ops compared with skills from other repositories

brain-ops next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
brain-opsgarrytan/gbrainSkill34ktodayMITA42Claude Code
knowledge-ingestopenclaw/openclawSkill396ktodayMITA80Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70ktodayApache-2.0A217Claude Code, Codex
forgetasgeirtj/system_prompts_leaksSkill74ktodayCC0-1.0A0Claude Code, Codex
Cortexdanielmiessler/LifeOSSkill21k16d agoMITA184Claude Code
ha-data-storesshiwenwen/hope-agentSkill1.9kyesterdayMITA115Claude Code, Codex
memoryopensquilla/opensquillaSkill7.2k9d agoApache-2.0A44Claude Code, Codex