brain-align

An interactive command that reviews a project's .brain documents alongside recent session notes, README files, and CLAUDE.md, then suggests updates. These documents store project decisions, pitfalls, and recurring patterns.

In plain words
What is it for?
Use it when starting work on an existing project, after a major change, or during a periodic review of decisions, gotchas, and coding patterns.
Why use it?
It helps keep project knowledge current after major changes or periods of work, so useful context is not lost in old sessions.

Command

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 commands/fiale-plus/fiale-claude-plugins/align
Clone the repo
git clone --depth 1 https://github.com/fiale-plus/fiale-claude-plugins
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 980 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00023 $0.00980
Opus 5 $0.00012 $0.00490
Sonnet 5 $0.00005 $0.00196
Haiku 4.5 $0.00002 $0.00098

Measured 2d ago against content hash 37d6f37b2c8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

brain-align scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/brain/config.json
plugins/brain/commands/align.md · 154 lines

How it starts

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

Interactively review and populate .brain/ knowledge docs for the current project directory. Useful after a big push, when starting on an existing project, or for periodic review.

Steps

1. Detect project root

pwd
git rev-parse --show-toplevel 2>/dev/null || echo "not-git"

Use git root if in a git repo, otherwise use current directory. Call this PROJECT_ROOT.

2. Read existing .brain/ docs

ls PROJECT_ROOT/.brain/ 2>/dev/null || echo "empty"
cat PROJECT_ROOT/.brain/DECISIONS.md 2>/dev/null
cat PROJECT_ROOT/.brain/GOTCHAS.md 2>/dev/null
cat PROJECT_ROOT/.brain/PATTERNS.md 2>/dev/null

3. Read recent session notes for this project

cat ~/.claude/brain/config.json

Get vault_path. Then read recent sessions:

ls VAULT_PATH/_sessions/ | sort | tail -14

Read the last 2 weeks of session notes that mention this project. Look for entries referencing the project name or path.

4. Read project context

cat PROJECT_ROOT/CLAUDE.md 2>/dev/null | head -100
cat PROJECT_ROOT/README.md 2>/dev/null | head -50

5. Analyze and suggest additions

Using your reasoning across session notes, existing .brain/ content, README, and CLAUDE.md, generate suggestions for each category:

DECISIONS.md additions — architectural choices that should be documented:

  • Technology choices with rationale
  • Design patterns chosen over alternatives
  • Tradeoffs explicitly made

GOTCHAS.md additions — blockers and solutions:

  • Environment-specific issues encountered
  • Non-obvious debugging solutions
  • Things that wasted significant time

PATTERNS.md additions — recurring conventions:

  • Naming conventions established
  • Code organization patterns
  • Workflow patterns specific to this project

Skip suggestions for things already documented. Focus on gaps.

6. Present suggestions interactively

For each suggestion, show:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[DECISIONS] — <title>
<content preview>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Add this? [y/n/e to edit]

Read the full file on GitHub · 154 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 · 154 lines · 23 tokens per session scan B 37d6f37b2c8e

Subscribe to this mod's changes

brain-align is a command published in the GitHub repository fiale-plus/fiale-claude-plugins (4 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 980 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.