reflect

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 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/sysangel/brain-mcp/reflect
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, Codex.

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. 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.00059 $0.02484
Opus 5 $0.00030 $0.01242
Sonnet 5 $0.00012 $0.00497
Haiku 4.5 $0.00006 $0.00248

Measured 2d ago against content hash 74bf252db48e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 (0 stars, last pushed 1mo ago), licensed MIT. It adds 59 tokens to every session and 2,484 once invoked, about $0.0003 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

esm

Comprehensive toolkit for protein language models including ESM3 (generative multimodal protein design across sequence, structure, and function) and ESM C (efficient protein embeddings and representations). Use this skill when working with protein sequences, structures, or function prediction; designing novel…

synthetic-sciences/openscience · 86 tokens

parse-document

Convert a PDF, scan, image of a page, or office file to clean markdown through the connected Superlinked MCP edge, so the source document is not read into model context directly. Use when the user asks to read, parse, OCR, extract from, summarize, or answer questions about a document.

superlinked/sie · 64 tokens

summarize-document

Summarize a long PDF, scan, office file, text file, or markdown file through the connected Superlinked MCP edge instead of reading the whole source into model context. Use when the user asks for a summary, overview, digest, or "what does this document say" about a large file.

superlinked/sie · 66 tokens

react-email

Create beautiful, responsive HTML emails using React components with React Email. Build transactional emails with modern components, support internationalization, and integrate with email service providers like Resend. Use when creating welcome emails, password resets, notifications, order confirmations, or any HTML…

agentset-ai/agentset · 57 tokens

uteke-memory

Persistent memory engine for AI agents via the uteke CLI — remember, recall, search, forget with semantic + FTS5 hybrid search, documents, knowledge graph, rooms, tiered memory, and multi-agent namespaces.

codecoradev/uteke · 44 tokens

qdrant-clients-sdk

Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.

qdrant/skills · 28 tokens