Brain Init logo

Brain Init

Community
toroleapinc
brain-init

Initialize brain sync network. Creates a Git remote for your brain and exports your current Claude Code state.

Overview

Publishertoroleapinc
Repositoryclaude-brain
Skill namebrain-init
Stars
92
Forks
23
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by toroleapinc on GitHub. Read the source before you install it.

Installation

Install the Brain Init AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/toroleapinc/claude-brain/tree/main/skills/brain-init
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/toroleapinc/claude-brain.git /tmp/claude-brain
mkdir -p .claude/skills
cp -r /tmp/claude-brain/skills/brain-init .claude/skills/brain-init
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Brain Init in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Brain Init on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Brain Init is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

The user wants to initialize their Claude Brain sync network.

Parse arguments:

  • If arguments contain "--encrypt", enable encryption
  • The first non-flag argument is the Git remote URL

Arguments provided: $ARGUMENTS

Steps

  1. First, check dependencies by running:

    "${CLAUDE_PLUGIN_ROOT}/scripts/common.sh" && echo "OK"

    If jq and git are missing, tell the user what to install.

  2. Validate the remote URL for security:

    bash
    source "${CLAUDE_PLUGIN_ROOT}/scripts/common.sh"
    validate_remote_url "$ARGUMENTS"

    If the URL is detected as pointing to a PUBLIC repository, STOP and warn the user:

    • "WARNING: This repository appears to be PUBLIC. Your brain data (memory, skills, settings, and potentially sensitive information) will be visible to anyone."
    • "Please use a PRIVATE repository."
    • Ask the user if they want to continue anyway.
  3. Show the user their current brain inventory by running:

    bash "${CLAUDE_PLUGIN_ROOT}/scripts/status.sh"
  4. IMPORTANT: Show the user a security notice before proceeding: Tell the user:

    • "Brain sync will export the following to the Git remote:"
    • " - CLAUDE.md, rules, skills, agents (your instructions and workflows)"
    • " - Auto memory and agent memory (learned patterns from your sessions)"
    • " - Settings (hooks, permissions — NOT env vars)"
    • " - MCP server configurations (command/args only — env vars with API keys are STRIPPED)"
    • " - Keybindings"
    • ""
    • "What is NEVER exported: OAuth tokens, API keys in env vars, ~/.claude.json, session transcripts"
    • ""
    • "Note: Memory files may contain information from your conversations. Review ~/.claude/projects/*/memory/ if concerned."
  5. Ask the user to confirm they want to initialize brain sync with the provided remote.

  6. Run the initialization sequence:

    bash
    # Parse arguments for encryption flag
    ENABLE_ENCRYPTION=false
    REMOTE_URL=""
    for arg in $ARGUMENTS; do
      case "$arg" in
        --encrypt) ENABLE_ENCRYPTION=true ;;
        *) if [ -z "$REMOTE_URL" ]; then REMOTE_URL="$arg"; fi ;;
      esac
    done
    
    # Create brain repo directory
    mkdir -p ~/.claude/brain-repo
    
    # Initialize git repo
    cd ~/.claude/brain-repo
    git init
    git remote add origin "$REMOTE_URL" 2>/dev/null || git remote set-url origin "$REMOTE_URL"
    
    # Create directory structure
    mkdir -p machines consolidated meta
    
    # Initialize meta files
    echo '{"entries":[]}' > meta/merge-log.json
    
    # Set up encryption if requested
    if [ "$ENABLE_ENCRYPTION" = "true" ]; then
      echo "Setting up age encryption..."
      
      # Check if age is installed
      if ! command -v age-keygen &>/dev/null; then
        echo "ERROR: age not found. Install it from https://github.com/FiloSottile/age"
        echo "On macOS: brew install age"
        echo "On Ubuntu/Debian: apt install age"
        exit 1
      fi
    
      # Generate age keypair
      source "${CLAUDE_PLUGIN_ROOT}/scripts/common.sh"
      IDENTITY_FILE="${HOME}/.claude/brain-age-key.txt"
      RECIPIENTS_FILE="${HOME}/.claude/brain-repo/meta/recipients.txt"
      generate_age_keypair "$IDENTITY_FILE" "$RECIPIENTS_FILE"
      
      echo "Age encryption configured:"
      echo "  Private key: $IDENTITY_FILE"
      echo "  Public key: $RECIPIENTS_FILE"
    fi
    
    # Register this machine (with encryption settings)
    if [ "$ENABLE_ENCRYPTION" = "true" ]; then
      bash "${CLAUDE_PLUGIN_ROOT}/scripts/register-machine.sh" "$REMOTE_URL" --encrypt
    else
      bash "${CLAUDE_PLUGIN_ROOT}/scripts/register-machine.sh" "$REMOTE_URL"
    fi
    
    # Export initial brain snapshot
    MACHINE_ID=$(cat ~/.claude/brain-config.json | jq -r '.machine_id')
    mkdir -p "machines/${MACHINE_ID}"
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/export.sh" --output "machines/${MACHINE_ID}/brain-snapshot.json"
    
    # Copy as initial consolidated brain
    cp "machines/${MACHINE_ID}/brain-snapshot.json" consolidated/brain.json
    
    # Commit and push (specific paths, not -A)
    git add machines/ consolidated/ meta/
    git commit -m "Initialize brain: $(hostname)"
    git branch -M main
    git push -u origin main
  7. Confirm success and show the user:

    • Their machine ID and name
    • The remote URL
    • Instructions: "Install claude-brain on your other machines and run: /brain-join $ARGUMENTS"
    • Reminder: "Auto-sync is enabled. Brain syncs silently on every session start/end."

If any step fails, show the error and suggest fixes (e.g., create the remote repo first on GitHub).

Frequently asked questions

What does the Brain Init AI skill do?

Initialize brain sync network. Creates a Git remote for your brain and exports your current Claude Code state.

Why use Brain Init on TypingMind?

Because you install it once and use it with any model. Brain Init is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Brain Init in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/toroleapinc/claude-brain/tree/main/skills/brain-init. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Brain Init?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Brain Init?

As many as you like. As long as a model supports skills, you can use Brain Init with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Brain Init AI skill free?

Yes. It is published on GitHub by toroleapinc under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇