reflect

reflect is a skill for Claude Code from sysangel/brain-mcp. It costs 59 tokens per session (2,484 once invoked), scanned A, original, MIT.

A memory-consolidation workflow for a personal knowledge store whose source of truth is Markdown files. It reviews recent sessions, extracts lasting facts, refreshes the search index, compacts the store, suggests skills, and commits changes.

In plain words
What is it for?
Useful for nightly or on-demand memory reflection, reviewing important recent work, distilling facts, and maintaining the brain repository.
Why use it?
It turns scattered session history into durable, searchable notes and keeps the derived index up to date.

Skill for Claude Code

Written for Claude Code: SessionStart hook event.

Good fit Useful for nightly or on-demand memory reflection, reviewing important recent work, distilling facts, and maintaining the brain repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sysangel/brain-mcp/reflect
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 sysangel/brain-mcp --skill reflect
Clone the repo
git clone --depth 1 https://github.com/sysangel/brain-mcp

Made for: Claude Code.

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 reflect

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sysangel/brain-mcp/reflect"><img src="https://agentmods.dev/badge/skills/sysangel/brain-mcp/reflect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,484 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.
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.00059 $0.02484
Opus 5.5 $0.00024 $0.00994
Sonnet 5.5 $0.00012 $0.00497
Haiku 4.5 $0.00006 $0.00248

Measured 1mo ago against content hash 74bf252db48e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

reflect 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 1mo 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.

skills/reflect/SKILL.md · 166 lines

How it starts

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

reflect

You are running the brain's consolidation pass. The brain lives at ~/src/brain: memories/ is the declarative store (markdown, git = source of truth), cache/brain.db is a disposable derived index. Work directly; be economical — in headless mode nobody is watching, so never ask questions and never wait.

Steps

  1. Sync, then refresh the index. First, best-effort pull: uv --directory ~/src/brain run brain-sync pull — on failure (offline, no remote, or a cache/sync-conflict flag) note it in the report and continue; it never blocks the pass. Then uv --directory ~/src/brain run brain-ingest (incremental; near-instant when nothing changed).

  2. Find the review window. Read ~/src/brain/cache/last-reflect (ISO timestamp). Missing file → default to the last 48 hours.

  3. Pull the time slice. Query the index directly for episodes since then: sqlite3 ~/src/brain/cache/brain.db "SELECT ts, session_id, cwd, substr(text,1,600) FROM episodes WHERE ts > '<last>' AND is_sidechain = 0 ORDER BY ts". Read full exchanges only where the slice looks consequential (decisions, corrections, new facts) — not routine tool chatter.

  4. Write session digests. Find digest-worthy sessions from the index with exactly this query — the strftime format string is load-bearing (episode ts is ISO-8601 with a T separator, so a bare datetime('now'), which uses a space, would break the lexical -1h comparison and let live sessions through). Do not improvise it:

    SELECT session_id, count(*) AS n, sum(length(text)) AS chars,
           substr(min(ts),1,7) AS ym, substr(min(ts),1,10) AS day, cwd
    FROM episodes
    WHERE is_sidechain = 0
    GROUP BY session_id
    HAVING (n >= 3 OR chars >= 15000)
       AND max(ts) < strftime('%Y-%m-%dT%H:%M:%S', 'now', '-1 hour')
    ORDER BY max(ts) DESC;
    

    Privacy denylist: drop any candidate whose cwd contains a substring listed in BRAIN_DIGEST_EXCLUDE (config env var; e.g. personal-finance projects) — those are never digested and never written to summaries/. For each remaining session, skip it if ~/src/brain/summaries/*/<session_id>.md already exists — unless its current episode count (n) is at least double the episodes: value in that file's frontmatter (a resumed session), in which case rewrite the digest in place at that exact glob-matched path — never recompute the YYYY-MM directory on a rewrite, or an old-month copy would survive and double-index the session. Take at most 5 per night, newest first; leftovers wait for the next night. For each selected session, read its episodes from the index (SELECT ts, substr(text,1,2500) FROM episodes WHERE session_id = '<id>' AND is_sidechain = 0 ORDER BY ts; pull more of an episode only when the slice is clearly consequential) and write summaries/YYYY-MM/<session_id>.md (new digests only — YYYY-MM from the first episode's ts); frontmatter session_id, date, project (basename of cwd), cwd, host (hostname -s), episodes (count), description (one line, ≤150 chars); body ≤ ~1,800 chars: what happened, decisions, facts learned, files touched, outcome. Same bar as memories: never secrets/credentials, no transcript quotes longer than a sentence.

Read the full file on GitHub · 166 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. 1mo ago First seen · 166 lines · 59 tokens per session scan A 74bf252db48e

Subscribe to this mod's changes

reflect is a skill published in the GitHub repository sysangel/brain-mcp (1 stars, last pushed 4d ago), licensed MIT. It adds 59 tokens to every session and 2,484 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-31.

Related

Other skills, from other repositories

memory-triage

Persistent long-term memory protocol powered by mem0. Evaluate conversations for durable facts worth storing via memoryadd. Handles identity, preferences, decisions, configurations, rules, projects, and relationships. Loaded by the openclaw-mem0 plugin when skills mode is active.

mem0ai/mem0 · 58 tokens

mem0

Mem0 Platform SDK for adding persistent memory to AI applications. TRIGGER when: user mentions "mem0", "MemoryClient", "memory layer", "remember user preferences", "persistent context", "personalization", or needs to add long-term memory to chatbots, agents, or AI apps. Covers Python SDK (mem0ai), TypeScript SDK…

mem0ai/mem0 · 181 tokens

mem0-cli

Mem0 CLI -- the command-line interface for mem0 memory operations. TRIGGER when: user mentions "mem0 cli", "mem0 command line", "@mem0/cli", "mem0-cli", "pip install mem0-cli", "npm install -g @mem0/cli", or is running mem0 commands in a terminal/shell (mem0 add, mem0 search, mem0 list, mem0 get, mem0 init, mem0…

mem0ai/mem0 · 177 tokens

mem0-vercel-ai-sdk

Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…

mem0ai/mem0 · 146 tokens

mem0-status

Diagnoses mem0 connectivity, API key validity, and memory read/write functionality. Use when memory operations fail, searches return empty, addmemory errors occur, or to verify the plugin is working correctly.

mem0ai/mem0 · 44 tokens

mem0-tour

Browses all stored memories grouped by category with full content display. Use when reviewing all project memories, exploring stored knowledge, onboarding to a project, or getting an overview of captured decisions, conventions, and learnings.

mem0ai/mem0 · 47 tokens