reflect-local

reflect-local is a skill for Claude Code from sysangel/brain-mcp. It costs 78 tokens per session (2,507 once invoked), scanned A, a copy of reflect, MIT.

A local memory-consolidation process that reviews recent sessions and turns important information into files stored in a Git repository and indexed in SQLite. SQLite is a small database used here as a searchable index.

In plain words
What is it for?
Use it to review sessions, update memory files, compact the local store, propose skills, and commit the resulting changes.
Why use it?
It keeps durable memory under local version control and refreshes the search index, rather than relying on a hosted memory service.

Skill for Claude Code

Written for Claude Code: SessionStart hook event.

Good fit Use it to review sessions, update memory files, compact the local store, propose skills, and commit the resulting changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sysangel/brain-mcp/reflect-local
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-local
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-local

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sysangel/brain-mcp/reflect-local"><img src="https://agentmods.dev/badge/skills/sysangel/brain-mcp/reflect-local.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,507 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 95% copy Near-identical to another mod 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.00078 $0.02507
Opus 5.5 $0.00031 $0.01003
Sonnet 5.5 $0.00016 $0.00501
Haiku 4.5 $0.00008 $0.00251

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

Security

Grade A, and why

reflect-local 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.

Origin

This is a copy

95% identical to reflect — 194 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/reflect-local/SKILL.md · 167 lines

How it starts

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

reflect-local

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 · 167 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 · 167 lines · 78 tokens per session scan A cf95fb9fe03e

Subscribe to this mod's changes

reflect-local is a skill published in the GitHub repository sysangel/brain-mcp (3 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 2,507 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 95% identical to reflect, differing in 194 lines, and is treated as a copy.

Related

reflect-local compared with skills from other repositories

reflect-local next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
reflect-localsysangel/brain-mcpSkill31mo agoMITA78Claude Code
memory-informed-longitudinal-workmajor7apps/pensyveSkill101todayApache-2.0A52Claude Code
mention-workflowmajor7apps/pensyveSkill101todayApache-2.0A45Claude Code, Codex
memory-reviewmajor7apps/pensyveSkill101todayApache-2.0A33Claude Code, Codex
context-loadermajor7apps/pensyveSkill101todayApache-2.0A35Claude Code, Codex
session-memorymajor7apps/pensyveSkill101todayApache-2.0A44Claude Code, Codex
memory-informed-refactormajor7apps/pensyveSkill101todayApache-2.0A42Claude Code, Codex