Agent skill

Brain Merge

by Abilityai in Abilityai/cornelius

Compare and selectively merge Brain directories across any two agent instances.

MITAuto-check: notes

Install Brain Merge

skills CLI
$ npx skills add Abilityai/cornelius --skill brain-merge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Abilityai/cornelius brain-merge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Abilityai/cornelius.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/brain-merge .claude/skills/brain-merge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
brain-merge
GitHub stars
109
Used in
1 other repo
Token cost
~1.6k tokens
SKILL.md length
608 words
Files
1
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

Compare and selectively merge Brain directories across any two agent instances.

  • SKILL.md covers Purpose, Modes, State Dependencies and Process, plus 3 more sections
  • Calls python3, rsync and git

What it does

Brain Merge is an agent skill from Abilityai/cornelius. Compare and selectively merge Brain directories across any two agent instances. Supports diff (see what's unique where), pull (import from another brain), and learn (bidirectional exchange).

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: AI-powered second brain template for Claude Code + Obsidian. The licence is MIT.

Example prompts

  • “/brain-merge”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep, Agent

What it can do on your machine

Read from SKILL.md and the folder at commit fd5e9a4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep
    • Agent

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • rsync
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use rsync and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Brain Merge loads about 1.6k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 608 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Abilityai/cornelius at commit fd5e9a4, republished under its MIT licence (© Abilityai). 608 words, ~1,625 tokens.

Download SKILL.mdSave it as .claude/skills/brain-merge/SKILL.md (or your agent's skills folder).
name
brain-merge
description
Compare and selectively merge Brain directories across any two agent instances. Supports diff (see what's unique where), pull (import from another brain), and learn (bidirectional exchange).
allowed-tools
Read, Write, Edit, Bash, Glob, Grep, Agent
automation
gated
user-invocable
true

Brain Merge

Compare and selectively merge knowledge between any two Brain directories. Works across any agent instances - not tied to specific paths.

Purpose

Agent brains develop independently and accumulate unique insights. This playbook lets you see what each brain has that the other doesn't, and move knowledge between them safely.

Modes

  • diff - Compare two brains, see what's unique to each
  • pull - Import files from a source brain into a target brain
  • learn - Bidirectional exchange with approval at each direction

State Dependencies

SourceLocationReadWrite
Source brainUser-specified path✓-
Target brainUser-specified path (defaults to current)✓✓
FAISS index[agent-root]/resources/local-brain-search/data/-✓

Process

Step 0: Resolve inputs

Ask the user for:

  1. Source brain path - the brain to compare against or pull from
  2. Target brain path - the brain to compare or import into (default: current agent's ./Brain)
  3. Mode - diff, pull, or learn (infer from user's message if obvious)

If paths are ambiguous (user says "moltbook" or "the other one"), scan parent directories for Brain/ folders and present a pick list:

bash
find . -maxdepth 3 -name "Brain" -type d 2>/dev/null | sort

DIFF MODE

Goal: Show what each brain has that the other doesn't, grouped by folder.

Step 1: Inventory both brains
bash
SOURCE="[SOURCE_BRAIN_PATH]"
TARGET="[TARGET_BRAIN_PATH]"

find "$SOURCE" -name "*.md" | sed "s|$SOURCE/||" | sort > /tmp/brain_source.txt
find "$TARGET" -name "*.md" | sed "s|$TARGET/||" | sort > /tmp/brain_target.txt

echo "Source: $(wc -l < /tmp/brain_source.txt) files"
echo "Target: $(wc -l < /tmp/brain_target.txt) files"
Step 2: Generate diff lists
bash
comm -23 /tmp/brain_source.txt /tmp/brain_target.txt > /tmp/unique_to_source.txt
comm -13 /tmp/brain_source.txt /tmp/brain_target.txt > /tmp/unique_to_target.txt
comm -12 /tmp/brain_source.txt /tmp/brain_target.txt > /tmp/in_both.txt

echo "Unique to source: $(wc -l < /tmp/unique_to_source.txt)"
echo "Unique to target: $(wc -l < /tmp/unique_to_target.txt)"
echo "In both: $(wc -l < /tmp/in_both.txt)"
Step 3: Group by folder and present
bash
echo "=== UNIQUE TO SOURCE ==="
awk -F'/' '{print $1}' /tmp/unique_to_source.txt | sort | uniq -c | sort -rn

echo "=== UNIQUE TO TARGET ==="
awk -F'/' '{print $1}' /tmp/unique_to_target.txt | sort | uniq -c | sort -rn

For each folder, show a few sample filenames so the user gets a sense of what's there.

Present as a clean table. Note any folders that exist in one brain but not the other (structural differences).

Gate 1: Present report. Ask: "Want to pull any of this into your brain? Which folders or files?"


PULL MODE

Goal: Import specific files from source into target, safely.

Step 1: Run diff if not already done
Step 2: Clarify scope

If not specified, ask: "Which folders or files to pull? (e.g., 02-Permanent, AI Extracted Notes, all unique files, or specific filenames)"

Gate 2: Confirm scope before touching anything:

"About to copy [N] files from [source] → [target]. Files already in target will be SKIPPED. Proceed?"

Step 3: Execute copy
bash
rsync -av --ignore-existing \
  "[SOURCE]/[SELECTED_FOLDER]/" \
  "[TARGET]/[SELECTED_FOLDER]/"

For full unique-file pull:

bash
while IFS= read -r file; do
  dest="[TARGET]/$file"
  mkdir -p "$(dirname "$dest")"
  cp -n "[SOURCE]/$file" "$dest"
done < /tmp/unique_to_source.txt
Step 4: Refresh index in target
bash
cd [TARGET_AGENT_ROOT]
python3 resources/local-brain-search/build_index.py

Report total files copied, skipped, and confirm index refreshed.


LEARN MODE

Goal: Bidirectional exchange - each brain gets what the other has.

Step 1: Run diff (both directions)
Show full SKILL.md (245 more words)Show less
Step 2: Source → Target

Show what source has that target doesn't.

Gate 3: "Source has [N] unique files. Pull into target? (y/n/select folders)"

If approved, run pull source → target.

Step 3: Target → Source

Show what target has that source doesn't.

Gate 4: "Target has [M] unique files. Push into source? (y/n/select folders)"

If approved:

bash
rsync -av --ignore-existing \
  "[TARGET]/[SELECTED_FOLDER]/" \
  "[SOURCE]/[SELECTED_FOLDER]/"
Step 4: Refresh indexes in both agents
bash
cd [TARGET_AGENT_ROOT] && python3 resources/local-brain-search/build_index.py
cd [SOURCE_AGENT_ROOT] && python3 resources/local-brain-search/build_index.py

Report: files exchanged in each direction, both indexes refreshed.


Tips

  • Start with diff - understand what you're working with before moving anything
  • Safe by default - --ignore-existing / cp -n never overwrites existing files
  • Content conflicts - files with the same name but different content are flagged but not auto-resolved; manual review recommended
  • Structural differences - folders that exist in one brain but not the other are worth noting (may indicate the agent evolved differently)
  • Index refresh - always runs after file changes so FAISS stays current

Error Recovery

  • If copy fails mid-way: re-run - --ignore-existing makes it idempotent
  • If index build fails: run /refresh-index manually in that agent
  • If paths not found: re-run Step 0 discovery scan

Self-Improvement

After completing this skill's primary task, consider tactical improvements:

  • Review execution: Were there friction points, unclear steps, or inefficiencies?
  • Identify improvements: Could error handling, step ordering, or instructions be clearer?
  • Scope check: Only tactical/execution changes - NOT changes to core purpose or goals
  • Apply improvement (if identified):
    • Edit this SKILL.md with the specific improvement
    • Keep changes minimal and focused
  • Version control:
    • Stage: git add .claude/skills/brain-merge/SKILL.md
    • Commit: git commit -m "refactor(brain-merge): <brief improvement description>"

© Abilityai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/brain-merge of Abilityai/cornelius.

Open the folder on GitHubat commit fd5e9a4

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Abilityai/cornelius, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Brain Merge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Brain Merge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Brain Merge this skillAbilityai/cornelius1091 repos~1.6kAutomated safety check: NotesMIT
Mergeremotion-dev/remotion62k—~508Automated safety check: PassCustom licence
Mergewithastro/astro63k—~153Automated safety check: PassCustom licence
Second Brain Mergeundefined-ui/second-brain-os1k—~470Automated safety check: PassMIT
Merge Upsymfony/symfony31k—~4kAutomated safety check: PassMIT
Mergealirezarezvani/claude-skills28k1 repos~587Automated safety check: PassMIT

Similar skills

  • Merge

    remotion-dev/remotion

    Official

    Wait for a Remotion pull request to become mergeable, handle merge conflicts, distinguish genuine CI failures from flakes, rerun flaky checks through the flake skill, and merge the PR.

    62k GitHub stars~508 tokensUpdated today
    DevelopmentAuto-check passed
  • Merge

    withastro/astro

    Official

    Handle main-to-next merge tasks including conflict resolution, changeset cleanup, and CI fix-ups.

    63k GitHub stars~153 tokensUpdated today
    Auto-check passed
  • Second Brain Merge

    undefined-ui/second-brain-os

    Merge two pages that describe the same thing, preserving every distinct claim, redirecting inbound links, and recording the merge.

    1k GitHub stars~470 tokensUpdated yesterday
    Knowledge ManagementAuto-check passed
  • Merge Up

    symfony/symfony

    Cascade-merge maintained Symfony branches from oldest to newest (e.g.

    31k GitHub stars~4k tokensUpdated today
    DevelopmentAuto-check passed
  • Merge

    alirezarezvani/claude-skills

    Merge the winning agent's branch into base, archive losers, and clean up worktrees.

    28k GitHub starsUsed in 1 repo~587 tokens
    DevelopmentAuto-check passed
  • Merging PRs

    PostHog/posthog

    Official

    Merge a PR into master through the Trunk merge queue and babysit it until it lands.

    40k GitHub stars~4.1k tokensUpdated today
    Auto-check passed

More from Abilityai/cornelius

All 51 skills in this repo
  • Nano Banana Image Generator

    Abilityai/cornelius

    Generate images using Google's Nano Banana (Gemini 2.5 Flash Image).

    109 GitHub stars~1.2k tokensUpdated 16 days ago
    Auto-check: notes
  • Changelog Protocol

    Abilityai/cornelius

    Protocol for creating dated changelog files after significant agent sessions.

    109 GitHub stars~555 tokensUpdated 16 days ago
    Auto-check passed
  • Create Article

    Abilityai/cornelius

    Create long-form articles from knowledge base insights. An agent skill from Abilityai/cornelius.

    109 GitHub stars~2.1k tokensUpdated 16 days ago
    Auto-check: notes
  • Epistemic Classification

    Abilityai/cornelius

    Framework for distinguishing research findings from hypotheses and speculative synthesis.

    109 GitHub stars~1.5k tokensUpdated 16 days ago
    Auto-check passed
  • Get Youtube Transcript

    Abilityai/cornelius

    Extract the transcript from a YouTube video by URL or video ID.

    109 GitHub stars~525 tokensUpdated 16 days ago
    Auto-check: notes
  • Insight Capture Format

    Abilityai/cornelius

    Standard format for capturing and documenting insights in the knowledge base.

    109 GitHub stars~616 tokensUpdated 16 days ago
    Auto-check passed

Questions about Brain Merge

What does Brain Merge do?

Compare and selectively merge Brain directories across any two agent instances. Brain Merge is an agent skill from Abilityai/cornelius. Compare and selectively merge Brain directories across any two agent instances.

How do I install Brain Merge in Claude Code?

Run `npx skills add Abilityai/cornelius --skill brain-merge -a claude-code`. Or copy the skill folder (.claude/skills/brain-merge in Abilityai/cornelius) into .claude/skills/brain-merge in your project. Claude Code loads it when a task matches its description.

How do I install Brain Merge in Codex?

Run `npx skills add Abilityai/cornelius --skill brain-merge -a codex`. Or copy the skill folder (.claude/skills/brain-merge in Abilityai/cornelius) into .agents/skills/brain-merge in your project. Codex loads it when a task matches its description.

Can I use Brain Merge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Abilityai/cornelius --skill brain-merge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/brain-merge, .gemini/skills/brain-merge, .github/skills/brain-merge and .opencode/skills/brain-merge in your project.

What does Brain Merge need to run?

Going by SKILL.md and its folder, Brain Merge needs the command-line tools its instructions call (python3, rsync and git). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep, Agent.

Does Brain Merge access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Brain Merge safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Brain Merge use?

Brain Merge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Brain Merge use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Brain Merge?

Skills that share tags, products or a category with Brain Merge: Merge (remotion-dev/remotion, 62k stars), Merge (withastro/astro, 63k stars), Second Brain Merge (undefined-ui/second-brain-os, 1k stars) and Merge Up (symfony/symfony, 31k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Brain Merge?

Abilityai (a GitHub organization) maintains it in Abilityai/cornelius, which has 109 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on September 22, 2026.

Source: Abilityai/cornelius on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.