brain-ops

brain-ops is a skill for Claude Code, Codex from timurgaleev/memex. It costs 42 tokens per session (1,556 once invoked), scanned A, original, MIT.

The core operating rules for a personal knowledge base: look up existing information, enrich it, write updates, cite sources, and maintain links between related pages. It is meant to be read before using the knowledge base.

In plain words
What is it for?
Use it whenever you research or update a person, company, topic, or other knowledge-base entry. It guides the read-enrich-write cycle and the required source and backlink handling.
Why use it?
It reduces duplicate work and unsupported claims by checking existing context first and recording where new facts came from. It also keeps entity pages connected to the pages that mention them.

Skill for Claude CodeCodex

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 skills/timurgaleev/memex/brain-ops
Any agent
npx skills add timurgaleev/memex --skill brain-ops
Clone the repo
git clone --depth 1 https://github.com/timurgaleev/memex

Made for: Claude Code, Codex.

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/timurgaleev/memex/brain-ops.svg)](https://agentmods.dev/skills/timurgaleev/memex/brain-ops)
Your own site
<a href="https://agentmods.dev/skills/timurgaleev/memex/brain-ops"><img src="https://agentmods.dev/badge/skills/timurgaleev/memex/brain-ops.svg" alt="Measured on agentmods" 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 1,556 The whole file, excluding the scripts and references it only reads on demand.
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.00042 $0.01556
Opus 5 $0.00021 $0.00778
Sonnet 5 $0.00008 $0.00311
Haiku 4.5 $0.00004 $0.00156

Measured 3d ago against content hash dbccb3b169af, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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.

deploy/skills/brain-ops/SKILL.md · 172 lines

How it starts

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

Brain Operations — The Ambient Context Layer

The brain is not an archive. It is a live context membrane that every interaction flows through in both directions.

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

Contract

This skill guarantees:

  • Brain is checked BEFORE any external API call (brain-first lookup)
  • Every inbound signal triggers the READ → ENRICH → WRITE loop
  • 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: Back-Linking (MANDATORY)

Every mention of a person or company with a brain page MUST create a back-link FROM that entity's page TO the page mentioning them. An unlinked mention is a broken brain. See conventions/quality.md for format.

Phases

Phase 1: Brain-First Lookup (MANDATORY)

Before using ANY external API to research a person, company, or topic:

  1. search "name" — hybrid retrieval (no expand knob; expansion is off in the default mode bundles)
  2. query "natural question about name" — same retrieval with broader controls; escalate here with expand: true when the question is conceptual and step 1 came back thin
  3. page_get <slug> — if you know the slug, read the full page
  4. Check backlinks: who references this entity?
  5. Check entity_timeline: recent events involving this entity

The brain almost always has something. External APIs fill gaps, not start from scratch.

Phase 2: On Every Inbound Signal (READ → ENRICH → WRITE)

Every message, meeting, email, or conversation that references a person or company:

  1. Detect entities — people, companies, deals mentioned
  2. Load brain pages — read existing pages for context before responding
  3. Identify new information — what does this signal tell us that the page doesn't know?
  4. Write it back — update the brain page with new info + timeline entry + source citation
  5. Create if missing — if notable and no page exists, create via enrich skill

Read the full file on GitHub · 172 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. 3d ago First seen · 172 lines · 42 tokens per session scan A dbccb3b169af

Subscribe to this mod's changes

brain-ops is a skill published in the GitHub repository timurgaleev/memex (8 stars, last pushed 9d ago), licensed MIT. It adds 42 tokens to every session and 1,556 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

kb

Operate a hraness/kb local-first Markdown knowledge base for coding-agent memory. Use when a user asks to search or query a KB or Obsidian vault; load repository context, plans, decisions, concepts, backlinks, semantic search, or Git provenance; save, clip, scrape, or archive a URL, article, social thread, signed-in…

hraness/kb · 133 tokens

grounded-knowledge-workflow

Use Grounded Knowledge Engine to select an isolated workspace, answer from local evidence, resume an explicitly identified project, create an explicit project checkpoint, and retain durable knowledge. Trigger when a user asks about their documents, workspace or client context, previous research, project state…

dimosgit/grounded-knowledge-engine · 91 tokens

weasley-deepmind

AI 에이전트가 weasley-deepmind 기억 서버를 최대 효율로 활용하기 위한 기술 레퍼런스.

potatohoney-p/weasley-deepmind · 0 tokens

knowledge-capture-policy

Decide when high-value work should become a Joplin pending capture draft through joplin-llm-wiki MCP tools, without bypassing user confirmation.

gcake119/joplin-llm-wiki · 38 tokens

gbrain-ingest

Ingest meetings, articles, docs, and conversations into the brain. Updates existing pages with new info, creates pages for new entities, maintains cross-references.

imphillip/gbrain-openclaw · 37 tokens

gbrain-query

Answer questions from the brain using FTS5 + semantic search + structured queries. Synthesizes across multiple pages with citations.

imphillip/gbrain-openclaw · 29 tokens