From onebrain
Update OneBrain skills, config, and plugins from GitHub : never touches your notes or data
npx claudepluginhub kengio/onebrain --plugin onebrainThis skill uses the workspace's default tool permissions.
Check if `.claude/plugins/onebrain/` exists in the current vault directory.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Performs token-optimized structural code search using tree-sitter AST parsing to discover symbols, outline files, and unfold code without reading full files.
Check if .claude/plugins/onebrain/ exists in the current vault directory.
If it does NOT exist:
OneBrain is installed as a global plugin but hasn't been adopted into this vault yet. Run
/onboardingfirst to bundle OneBrain into your vault : after that,/updatewill work normally.
Do not proceed further.
Fetch the latest OneBrain system files from GitHub and apply them to this vault. Your notes, memory, and personal settings are never touched.
Tell the user what will and won't be updated:
WILL update (system files only):
.gitignore.claude/plugins/onebrain/ : all plugin files (skills, hooks, agents, INSTRUCTIONS.md).claude-plugin/ : local plugin marketplace registryWILL NOT touch (your data and preferences):
[agent_folder]/MEMORY.md : your identity and session contextvault.yml : your vault configuration.obsidian/ : all Obsidian settings.claude/settings.local.json : your local Claude settings.claude/onebrain.local.md : your local plugin configinstall.sh, install.ps1 : fresh-install only, not part of the vaultREADME.md, CONTRIBUTING.md, LICENSE, assets/ : repo-only filesAsk: "Proceed with update?" and wait for confirmation before continuing.
Detect the platform and run the appropriate script in dry-run mode:
Use the platform reported in your session context (e.g. Platform: darwin or Platform: win32) to choose the right script. If the platform is Windows, use PowerShell; otherwise use bash.
bash .claude/plugins/onebrain/skills/update/update.sh
powershell -File .claude/plugins/onebrain/skills/update/update.ps1
Note: The dry-run and apply passes each fetch files independently from GitHub. This is intentional : scripts are stateless and require no temp storage between runs. The window between passes is small enough that mid-run upstream changes are not a practical concern for a personal tool.
Parse the output and present a summary to the user:
Found: N modified, N new, N deleted, N unchanged. Modified: [list files marked with ~] New: [list files marked with +] Deleted: [list files marked with -]
Apply these updates?
If the output contains status: partial_failure or any lines starting with !, stop and report which files failed to fetch. Tell the user to re-run /update to retry.
Wait for confirmation before continuing.
Run the update script in apply mode (same platform detection as Step 2):
bash .claude/plugins/onebrain/skills/update/update.sh --apply
powershell -File .claude/plugins/onebrain/skills/update/update.ps1 -Apply
If the output contains status: partial_failure, report which files failed and advise re-running /update.
After applying updates, check for the old MEMORY.md location:
vault.yml to determine agent_folder (default: 05-agent)MEMORY.md exists at the vault root[agent_folder]/MEMORY.md existsCase A : Root MEMORY.md exists, agent folder MEMORY.md does not:
[agent_folder]/ does not exist, create it along with context/ and memory/ subfolders (each with a .gitkeep)MEMORY.md to [agent_folder]/MEMORY.md[agent_folder]/MEMORY.md. Can I delete the root copy?"MEMORY.md only after confirmationCase B : Both exist:
Found
MEMORY.mdat the vault root AND at[agent_folder]/MEMORY.md. The agent will use[agent_folder]/MEMORY.md. Please review and delete the root copy manually:MEMORY.md.
Case C : Only agent folder MEMORY.md exists: No action.
Case D : Neither exists: No action. User will need to run /onboarding.
Ensure [agent_folder]/MEMORY.md has correct frontmatter (skip if file doesn't exist):
Required fields:
---
tags: [agent-memory]
created: YYYY-MM-DD
updated: YYYY-MM-DD
---
--- with no closing ---): report and skipResolve [inbox] from vault.yml folders.inbox (default: 00-inbox) and [attachments] from vault.yml folders.attachments (default: attachments) : both were already read in Step 4b.
Ensure these folders exist (create with .gitkeep if missing, report only new ones):
| Folder | Introduced |
|---|---|
[inbox]/imports/ | v1.2.0 |
[attachments]/ | v1.2.0 |
[attachments]/pdf/ | v1.2.0 |
[attachments]/images/ | v1.2.0 |
[attachments]/video/ | v1.2.0 |
Also ensure vault.yml has these keys under folders: (add if missing, never touch qmd_collection):
| Key | Value | Introduced |
|---|---|---|
import_inbox | [inbox]/imports | v1.2.0 |
attachments | attachments | v1.2.0 |
When inserting missing keys: read the file, insert within the existing folders: block (not at end of file), write back the full file. If the folders: block is absent, report and skip.
Check .claude/settings.json and .claude/settings.local.json. For each that exists:
"onebrain@onebrain-local" → "onebrain@onebrain" in enabledPlugins"onebrain-local" → "onebrain" in extraKnownMarketplaces[file]."The @import line: @.claude/plugins/onebrain/INSTRUCTIONS.md
CLAUDE.md:
# OneBrain heading → replace the OneBrain block with @import line (preserve any user content above it)GEMINI.md and AGENTS.md:
Read vault.yml. If a checkpoint: top-level key is absent, append this block:
checkpoint:
messages: 15 # auto-checkpoint every N message exchanges
minutes: 30 # auto-checkpoint every N minutes (whichever comes first)
Rules:
vault.yml does not exist: skip silentlycheckpoint: config to vault.yml (defaults: 15 messages, 30 min)."The Stop hook must be registered in the vault's .claude/settings.json : it is not picked up from plugin hooks.json automatically. This step ensures it is present.
vault.yml)[vault_root]/.claude/plugins/onebrain/hooks/checkpoint-hook.sh.claude/settings.json:
{} (the write in step 7 will create it)hooks.Stop already contains a command referencing checkpoint-hook.sh stop. Set stop_added = false if already present, stop_added = true if added.hooks.Stop (create hooks key if missing), set stop_added = true:
{
"matcher": "",
"hooks": [{ "type": "command", "command": "bash \"[hook_path]\" stop" }]
}
hooks.PreCompact:
checkpoint-hook.sh precompact: remove that entry; set precompact_removed = truePreCompact array is now empty (or was already empty): remove the PreCompact key entirelystop_added OR precompact_removed: write the updated JSON back to .claude/settings.json, then report:
stop_added AND precompact_removed: "Registered Stop checkpoint hook and removed legacy PreCompact entry in .claude/settings.json. Note: paths are absolute : re-run /update if you move this vault."stop_added only: "Registered Stop checkpoint hook in .claude/settings.json. Note: paths are absolute : re-run /update if you move this vault."precompact_removed only (Stop was already present): "Removed legacy PreCompact checkpoint hook from .claude/settings.json."stop_added nor precompact_removed: skip silently (no output)Read vault.yml. If a timezone: top-level key is absent, insert it immediately after the method: line:
method: onebrain
timezone: Asia/Bangkok
Rules:
method:. If method: is absent, append as a top-level key before the folders: block.vault.yml does not exist: skip silentlytimezone: Asia/Bangkok to vault.yml. Edit the timezone: key in vault.yml if your local timezone is different."Show a final summary of everything updated and migrated. Then suggest:
Done. OneBrain has been updated.
Next steps:
- Run
/reload-pluginsto apply changes immediately in this session- Or start a new Claude Code session : changes are picked up automatically