~ / rigs / xy-claude / brain-core

xy-claude/brain-core

A memory for your Claude Code agent that survives the session. One local MCP, five tools, a markdown vault you own, an eval that proves recall.

↗ GitHub ★ 0 MIT updated 5d ago project Claude Code
field: AI / ML
share on X
ARCHETYPE
Automator
Hooks on every lifecycle event: format, lint, notify, log.
CONTEXT TAX · EVERY TURN
up to ~5.2k tokens
Claude Code loads MCP tools on demand, so the real cost is usually lower.
Moderate · median rig: 2.3k · breakdown
GUARDRAILS
3/5
Blocks destructive commands · Pre-tool screening hook · No YOLO mode · details
Quality 52/100 Guardrails v2

Copy this rig

# review before running: this installs third-party code
$ claude mcp add brain -- brain serve .
$ npx degit xy-claude/brain-core/src/brain_core/templates/agent/.claude ./rig-brain-core  # inspect, then merge into .claude/

MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.

$ claude mcp add brain -- brain serve .
$ npx degit xy-claude/brain-core/src/brain_core/templates/agent/.claude/skills/brain-check .claude/skills/brain-check
$ npx degit xy-claude/brain-core/src/brain_core/templates/agent/.claude/skills/distill .claude/skills/distill
$ npx degit xy-claude/brain-core/src/brain_core/templates/agent/.claude/skills/session-end .claude/skills/session-end

Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-dangerous-bash.sh\""
          }
        ]
      }
    ]
  }
}

MCP servers (2)

serversourceest. tokens
brain binary 2.5k
hindsight local / custom · remote 2.5k

Skills (3)

Hooks (5)

eventmatcherruns
PreToolUseBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/block-dangerous-bash.sh"
PostToolUseFailureBashbrain recall --hook --path "$CLAUDE_PROJECT_DIR" 2>/dev/null || true
Stop*brain capture --path "$CLAUDE_PROJECT_DIR" 2>/dev/null || true
PreCompact*brain capture --path "$CLAUDE_PROJECT_DIR" 2>/dev/null || true
SessionStart*brain brief --hook --path "$CLAUDE_PROJECT_DIR" 2>/dev/null || command -v brain >/dev/null || echo 'brain-core: the brain command is not on PATH in this session, so its hooks (brief, capture, recall) are not running. Tell the user. Fix: run

Similar rigs

copied ✓