Read/write brain files in .flux/brain/. Use for any task that persists knowledge — reflection, planning, or direct edits. Handles the "Remember" flow: classifies content as CLAUDE.md (short rules for every session) or .flux/brain/ (deeper context), asks user to confirm, then writes. Triggers: brain/ modifications, "add to brain", "remember X", "don't forget X", "keep in mind X", "from now on X", "note that X".
From fluxnpx claudepluginhub nairon-ai/flux --plugin fluxThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Persistent memory across sessions. Brain files live in .flux/brain/.
Adapted from brainmaxxing by @poteto.
The brain is the foundation of the entire workflow — every agent, skill, and session reads it. Low-quality or speculative content degrades everything downstream. Before adding anything, ask: "Does this genuinely improve how the system operates?" If the answer isn't a clear yes, don't write it.
When the user says "remember X", "don't forget X", "keep in mind X", or similar — first decide whether it belongs in CLAUDE.md or the brain vault, then ask the user to confirm.
Before routing, check if an external memory MCP is configured:
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}}"
[ ! -d "$PLUGIN_ROOT/scripts" ] && PLUGIN_ROOT=$(ls -td ~/.claude/plugins/cache/nairon-flux/flux/*/ 2>/dev/null | head -1)
FLUXCTL="${PLUGIN_ROOT}/scripts/fluxctl"
EXTERNAL_MEMORY_PROVIDER=$($FLUXCTL config get externalMemory.provider --json 2>/dev/null | jq -r '.value // empty')
EXTERNAL_MEMORY_TOOL=$($FLUXCTL config get externalMemory.tool --json 2>/dev/null | jq -r '.value // empty')
If EXTERNAL_MEMORY_PROVIDER is set, a third destination is available (see Step 2 below).
Use this heuristic to pre-select the right destination:
| Goes in CLAUDE.md | Goes in .flux/brain/ | Goes in external memory |
|---|---|---|
| Short, actionable rules the agent needs every session | Deeper knowledge, context, or rationale | Personal preferences that span repos |
Commands and how to run them ("use pnpm test", "run make build") | Why a decision was made ("we chose Supabase because...") | Cross-project patterns ("I prefer single PRs for refactors") |
Hard constraints ("never import from legacy/", "always use TypeScript") | Business context ("Sarah is the PM", "we have 500 users") | Personal tool preferences ("I use Vim keybindings everywhere") |
| Code style rules ("use camelCase for APIs", "4-space indent") | Pitfalls and lessons learned ("migration script doesn't handle NULLs") | Learning notes not tied to this repo |
| Things that affect every task regardless of domain | Things that are relevant only in certain contexts | Things that are relevant across multiple repos |
Rule of thumb: If the agent would need this to avoid a mistake on any task in the project, it's CLAUDE.md. If it's context that helps make better decisions in specific situations, it's brain. If it's personal knowledge that helps across all your projects, it's external memory.
Note: The external memory column only applies when externalMemory.provider is configured. If not set, route between CLAUDE.md and brain as before.
Use AskUserQuestion with the pre-selected option first.
If EXTERNAL_MEMORY_PROVIDER is NOT set (default — two options):
{
"questions": [{
"question": "Where should I store this?",
"header": "Remember",
"multiSelect": false,
"options": [
{
"label": "CLAUDE.md — agent reads every session",
"description": "Short, actionable rules and constraints (e.g., 'always use pnpm', 'never import from legacy/'). The agent sees this at the start of every conversation."
},
{
"label": "Brain vault — deeper context",
"description": "Decisions, business context, principles, pitfalls. Read by specific skills when relevant, not loaded every session."
}
]
}]
}
If EXTERNAL_MEMORY_PROVIDER IS set (three options — add external memory):
{
"questions": [{
"question": "Where should I store this?",
"header": "Remember",
"multiSelect": false,
"options": [
{
"label": "CLAUDE.md — agent reads every session",
"description": "Short, actionable rules and constraints (e.g., 'always use pnpm', 'never import from legacy/'). The agent sees this at the start of every conversation."
},
{
"label": "Brain vault — repo-specific context",
"description": "Decisions, business context, principles, pitfalls for THIS repo. Git-tracked, shared with team."
},
{
"label": "{EXTERNAL_MEMORY_PROVIDER} — cross-project, personal",
"description": "Personal knowledge that spans repos. Not git-tracked. Use for preferences, patterns, and learnings that apply everywhere."
}
]
}]
}
Replace {EXTERNAL_MEMORY_PROVIDER} with the actual provider name (e.g., "Supermemory", "Mem0").
<!-- BEGIN FLUX --> section, add it inside that section under the right heading<important if="..."> block already exists. If so, add the rule inside it. If the CLAUDE.md is long (>50 lines) and no matching block exists, create one. Examples:
createTestApp() helper" → add inside <important if="you are writing or modifying tests"><important if="you are writing API routes or server actions">Ask which category:
{
"questions": [{
"question": "Which brain category?",
"header": "Category",
"multiSelect": false,
"options": [
{
"label": "Convention",
"description": "Project-specific pattern or rule. Stored in .flux/brain/conventions/"
},
{
"label": "Decision",
"description": "Architectural decision with rationale. Stored in .flux/brain/decisions/"
},
{
"label": "Principle",
"description": "Engineering principle that applies broadly. Stored in .flux/brain/principles/"
},
{
"label": "Business context",
"description": "Product, team, or stakeholder context. Stored in .flux/brain/business/"
},
{
"label": "Pitfall",
"description": "Something that went wrong or could go wrong. Stored in .flux/brain/pitfalls/"
}
]
}]
}
Then:
.flux/brain/conventions/always-use-pnpm.md).flux/brain/pitfalls/frontend/, .flux/brain/pitfalls/api/).flux/brain/index.md to include a link to the new fileNotes are prunable — /flux:meditate audits and removes stale ones. Store freely.
When the user chooses the external memory option, use the provider's MCP tool to store the knowledge. Do NOT write to .flux/brain/ or CLAUDE.md.
EXTERNAL_MEMORY_TOOL. Example for Supermemory:
search_supermemory_memory_api_for to first check if a similar memory already existsImportant: Never silently write to external memory. The user explicitly chose this destination in Step 2. If the MCP tool call fails (provider down, auth expired), fall back to brain vault and tell the user why.
Read .flux/brain/index.md first. Then read the relevant entrypoint for your topic:
.flux/brain/principles.md for principle updatesFor directories without a dedicated index file yet, scan nearby files directly and edit an existing note when possible.
.flux/brain/
├── index.md <- root entry point, links to everything
├── principles.md <- index for principles/
├── principles/ <- engineering and design principles
├── pitfalls/ <- auto-captured from review iterations, organized by area
│ ├── frontend/ <- e.g., missing-error-states.md
│ ├── security/ <- e.g., greptile-auth-gap.md
│ └── async/ <- e.g., consensus-race-condition.md
├── conventions/ <- project-specific patterns and rules
├── decisions/ <- architectural decisions with rationale
├── business/ <- product stage, team, stakeholders, glossary
│ ├── context.md <- product stage, team structure, key context
│ ├── glossary.md <- ubiquitous language — domain-specific terms
│ └── team.md <- names, roles, responsibilities
├── codebase/ <- project-specific knowledge and gotchas
└── plans/ <- feature plans (linked from .flux/ epics)
Rules:
.flux/brain/codebase/deploy-gotchas.md, not a mega-file..flux/brain/index.md, .flux/brain/principles.md..flux/brain/index.md is the root. Every brain file must be reachable from it.worktree-gotchas.md.Format: [[section/file-name]]. Resolution order: same directory, then relative path, then vault root. Heading anchors ([[file#heading]]) are stripped during resolution.
# Title. No Obsidian frontmatter.Update .flux/brain/index.md for any files you added or removed. Also update the relevant entrypoint when applicable. Keep indexes link-only and scannable.
Note: The auto-index hook will also update .flux/brain/index.md automatically when brain files change.
Ask: "Would I include this in a prompt for a different task?"
.flux/brain/. It's durable knowledge..flux/brain/. Brain files must survive reuse across future sessions..flux/brain/index.md is effectively lost.