brain-update
Skill0 starsChanged 57 days agoMITView on GitHub
Summarise the current chat, cowork or code session and update the project's CLAUDE.md file(s) - add new durable knowledge, revise changed facts, remove superseded ones. Use when the user says "brain update", "update CLAUDE.md", "save this session to memory", "wrap up the session", or asks to sync project memory. Handles folders with multiple CLAUDE.md files.
- Reads credentials
In this repositoryOne other file it gives its agents.
- your-skill-nameSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Run from the working folder:
- Distinctive: line 21
Always re-read each candidate from disk.
- Distinctive: line 22
No file access (plain chat, no folder)?
- Distinctive: line 27
One file: use it.
- Distinctive: line 28
Multiple files: ask once with AskUserQuestion, options:
- Distinctive: line 31
Interview: - ask short questions (max 4 per round) about where each uncertain fact belongs
- Distinctive: line 62
Delete only when the session clearly shows the old statement is no longer true.
- Distinctive: line 63
Do not delete user-written rules or instructions unless the user contradicted them in this session.
- Very specific: line 70
If the folder is not a git repo, copy each target to .brain-backups/<name>-<YYYYMMDD-HHMM>.md first.
- Distinctive: line 72
Use absolute dates (e.g. 2026-10-05), never "today" or "last week".
- Distinctive: line 73
Keep each file lean. If one exceeds about 200 lines, say so in the report and suggest splitting by folder rather than trimming facts …
- Very specific: line 74
Update or add a single line near the top: Last brain-update: YYYY-MM-DD.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
brain-update
Keeps a project's CLAUDE.md files (the project's "brain") accurate after each session. Plain-English purpose: read what happened, compare it with what the brain already says, then add what is new, fix what changed, delete what is no longer true.
Work autonomously. Only stop to ask when a step below says so.
Step 1 - Find the brain files
Run from the working folder:
find . \( -iname "CLAUDE.md" -o -iname "CLAUDE.local.md" \) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/.brain-backups/*"- Ignore
~/.claude/CLAUDE.md(global) unless the user explicitly asks to update it. - Always re-read each candidate from disk. The copy loaded into the session may be stale.
- No file access (plain chat, no folder)? Skip to Step 7 (paste-ready output).
- Zero files found? Offer to create
CLAUDE.mdin the working folder using the template in Step 6, then continue.
Step 2 - Choose target file(s)
- One file: use it.
- Multiple files: ask once with AskUserQuestion, options:
- Update one only - then ask which (list paths, mark the best match by session content as recommended)
- Update all - route each fact to the most relevant file (Step 4)
- Interview - ask short questions (max 4 per round) about where each uncertain fact belongs
- Unattended or no way to ask: default to "Update all" with routing, and state that choice at the top of the report.
Step 3 - Extract session knowledge
Scan the whole session. Keep only durable items:
- Decisions and the reason behind them
- Architecture, structure, file locations, naming conventions
- Commands, tools, versions, configuration that work
- Verified failures / dead ends (what was tried, why it failed) so they are never repeated
- Current status and open items / next steps
- User preferences about how to work on this project
Discard: chit-chat, one-off debugging noise, unverified guesses, anything already obvious from the code.
Never write secrets (API keys, passwords, tokens, private keys). Record only where they live (e.g. "key stored in .env as SUPABASE_KEY"). Flag personal or commercially sensitive details for the user instead of writing them.
Step 4 - Reconcile and route
For each extracted item compare against the target file(s) and label it:
| Label | Action |
| NEW | Add under the best-fitting heading |
| CHANGED | Rewrite the existing line in place (do not keep both versions) |
| SUPERSEDED | Delete the old line |
| DUPLICATE | Skip |
| UNSURE | Keep the existing line, add to the report as a flag |
Removal rules:
- Delete only when the session clearly shows the old statement is no longer true.
- Do not delete user-written rules or instructions unless the user contradicted them in this session.
- Completed items under "Next steps" are removed or moved to a one-line status note.
Routing across multiple files: put each fact in the file whose folder it concerns. Shared, project-wide facts go in the root file. Child files hold only what is specific to their folder. Never duplicate a fact across files; link by path instead.
Step 5 - Write safely
- If the folder is not a git repo, copy each target to
.brain-backups/<name>-<YYYYMMDD-HHMM>.mdfirst. In a git repo, skip the backup (git is the undo). - Edit in place with the Edit tool. Preserve existing headings, order and tone; do not reformat untouched sections.
- Use absolute dates (e.g. 2026-10-05), never "today" or "last week".
- Keep each file lean. If one exceeds about 200 lines, say so in the report and suggest splitting by folder rather than trimming facts silently.
- Update or add a single line near the top:
Last brain-update: YYYY-MM-DD.
Step 6 - Template for a new CLAUDE.md
# <Project name>
Last brain-update: <date>
## Purpose
## Structure and key files
## Conventions and decisions
## Commands and setup
## Known dead ends (do not retry)
## Current status
## Next stepsStep 7 - Report (and chat-only fallback)
Report briefly, per file: Added / Changed / Removed counts with one-line items, then any UNSURE flags and any sensitive items left out. No recap of the whole session.
In plain chat with no file access, output the proposed additions, changes and deletions as a single paste-ready block per intended file (headed with the suggested path), and offer to apply it once a folder is connected.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

