agentleFS
dting007dting007/claude-skills/skills/brain-update/SKILL.md

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

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
  1. Distinctive:

    Run from the working folder:

    line 14
  2. Distinctive:

    Always re-read each candidate from disk.

    line 21
  3. Distinctive:

    No file access (plain chat, no folder)?

    line 22
  4. Distinctive:

    One file: use it.

    line 27
  5. Distinctive:

    Multiple files: ask once with AskUserQuestion, options:

    line 28
  6. Distinctive:

    Interview: - ask short questions (max 4 per round) about where each uncertain fact belongs

    line 31
  7. Distinctive:

    Delete only when the session clearly shows the old statement is no longer true.

    line 62
  8. Distinctive:

    Do not delete user-written rules or instructions unless the user contradicted them in this session.

    line 63
  9. Very specific:

    If the folder is not a git repo, copy each target to .brain-backups/<name>-<YYYYMMDD-HHMM>.md first.

    line 70
  10. Distinctive:

    Use absolute dates (e.g. 2026-10-05), never "today" or "last week".

    line 72
  11. Distinctive:

    Keep each file lean. If one exceeds about 200 lines, say so in the report and suggest splitting by folder rather than trimming facts …

    line 73
  12. Very specific:

    Update or add a single line near the top: Last brain-update: YYYY-MM-DD.

    line 74

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.md in 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:
    1. Update one only - then ask which (list paths, mark the best match by session content as recommended)
    2. Update all - route each fact to the most relevant file (Step 4)
    3. 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:

LabelAction
NEWAdd under the best-fitting heading
CHANGEDRewrite the existing line in place (do not keep both versions)
SUPERSEDEDDelete the old line
DUPLICATESkip
UNSUREKeep 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

  1. If the folder is not a git repo, copy each target to .brain-backups/<name>-<YYYYMMDD-HHMM>.md first. In a git repo, skip the backup (git is the undo).
  2. Edit in place with the Edit tool. Preserve existing headings, order and tone; do not reformat untouched sections.
  3. Use absolute dates (e.g. 2026-10-05), never "today" or "last week".
  4. 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.
  5. 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 steps

Step 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.