Brain:Init logo

Brain:Init

Community
coco-research
brain:init

Use when setting up project memory in a new folder or on the first brain:init in a project. Creates project_brain.db, registers the project, and bootstraps it from CLAUDE.local.md, memory files, docs, and emails; safe to re-run.

Overview

Publishercoco-research
Repositorycoco
Skill namebrain:init
Stars
550
Forks
12
Bundled files
Instructions only
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 coco-research 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/coco-research/coco/tree/main/systems/brain/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/coco-research/coco.git /tmp/coco
mkdir -p .claude/skills
cp -r /tmp/coco/systems/brain/skills/brain-init .claude/skills/coco-research-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.

/brain:init --- Initialize Project Brain

Sets up a new project_brain.db in the current working directory and bootstraps it from existing project knowledge.

Procedure

Step 1: Check existing state

Run:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py info
  • If no DB exists → proceed to Step 2 (full init)
  • If DB exists with project(s) → skip to Step 3 (scan only). Tell user: "Brain already initialized. Running scan for new/changed files..."

Step 2: Create the database and project record

Run:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py init

Ask the user:

  • Project name (e.g., "My Project A", "My Project B")
  • Slug (short URL-safe identifier, e.g., "my-project-a", "my-project-b")
  • Description (one-liner)

Then run:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py add-project "{name}" --slug {slug} --desc "{description}"

If the project has sub-scopes (like ProjectA-Phase1 and ProjectA-Phase2 under one umbrella), ask if the user wants multiple project records.

Step 3: Scan the project folder

Run the scanner to discover what's available:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py scan

This returns a JSON report with:

  • manifest_diff: new/changed/unchanged file counts, whether this is the first scan
  • files_to_process: paths of new or changed files
  • knowledge_sources: which CLAUDE.local.md, memory files, docs, and emails were found

Show the user a summary:

FOLDER SCAN
===========
First scan:     yes/no
Files found:    NN total (NN new, NN changed, NN unchanged)

Knowledge sources detected:
  CLAUDE.local.md:  found / not found
  CLAUDE.md:        found / not found
  Memory files:     N files (list names)
  Documents:        N files in docs/
  Emails:           N files in emails/
  Reference docs:   N files

If nothing to process (all unchanged): "Everything up to date. No new knowledge to extract." → done.

Step 4: Extract knowledge from sources (Claude-driven)

Process sources in priority order. For each source, read the file, extract structured knowledge, and collect proposed writes. Do NOT write to the brain yet — collect everything first.

Priority 1: CLAUDE.local.md

If found, read the full file. Extract:

  • Sections like "Key Decisions" → decisions (with date, decision text, decided_by if mentioned)
  • People mentioned by name → person entities (with metadata like role, email, team if mentioned)
  • Systems/tools mentioned → system entities (e.g., Snowflake, Postgres, Datadog)
  • Teams mentioned → team entities
  • Folder structure sections → document entities for key docs
  • Recent Changes entries → events (with date, type, title)
Priority 2: Memory files (~/.claude/projects/.../memory/*.md)

Each memory file has frontmatter (name, description, type) and content. Read each file:

  • project type memories → decisions or context to enrich existing entities
  • feedback type memories → skip (these are Claude behavior guidance, not project knowledge)
  • reference type memories → system or document entities with metadata
Priority 3: Document inventory

For each file in docs/, emails/, and Reference Doc/:

  • Create a document entity with metadata: {"path": "relative/path", "type": "doc|email|reference", "size": N}
  • Use the filename (cleaned) as the entity name
  • Do NOT read the full content of every file — just register them in the inventory
Priority 4: CLAUDE.md (project-level, if exists)

Same extraction as CLAUDE.local.md but lower priority (may overlap).

Step 5: Present extraction summary

Show proposed writes:

BRAIN BOOTSTRAP SUMMARY
========================
Project: {name} ({slug})

From CLAUDE.local.md:
  Entities:    N (list: name [type])
  Decisions:   N (list: short text)
  Events:      N (list: title)

From memory files:
  Decisions:   N (list: short text)
  Entities:    N (list: name [type])

Document inventory:
  Documents:   N (list: filename [doc|email|reference])

Total proposed writes: NN

Ask: "Write all to brain? [Y/n/adjust]"

Step 6: Execute writes

On confirmation, write in this order using Python:

python
import sys
sys.path.insert(0, '$HOME/.claude/skills/brain/scripts')
from brain.schema import get_db
from brain.operations import *
  1. Entities — use upsert_entity (idempotent, safe to re-run)
  2. Relationships — use create_relationship (also idempotent)
  3. Decisions — use create_decision (check for duplicates by matching decision text before inserting)
  4. Events — use create_event (check for duplicates by matching title + date)
  5. Document entities — use upsert_entity with type="document"

After all writes, sync to MemPalace and brain.json:

python
from brain.memory_bridge import full_sync
full_sync("project_brain.db", project_slug)

After writes complete, update the manifest:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py scan-update

Step 7: Report

BRAIN INITIALIZED
=================
DB:            {path}/project_brain.db
Project:       {name} ({slug})
Schema:        v1 (11 tables)

Bootstrapped from existing knowledge:
  Entities:      +N (total: N)
  Decisions:     +N (total: N)
  Events:        +N (total: N)
  Documents:     +N (total: N)
  Relationships: +N (total: N)

Manifest updated: N files tracked

Next: Run /brain-update at end of session, or /brain-rescan when files change.

Step 8: Generate knowledge articles

After completing brain writes (Step 6) and confirming the manifest is updated (Step 6 scan-update), initialize the knowledge engine for this project.

First, register the project with the knowledge engine:

python
import sys, os
sys.path.insert(0, os.path.expanduser("~/.coco/knowledge"))
from engine import KnowledgeEngine

engine = KnowledgeEngine()
engine.register_project("{slug}", os.path.abspath("project_brain.db"))

This is required before the cron can harvest the project. (FIX M1: register_project must be called before running any cron phases.)

Then, bootstrap article generation:

python
engine.full_refresh("{slug}")

Or equivalently via CLI:

bash
python3 ~/.coco/knowledge/cron.py --run --project {slug} --phases 2,3,5

This runs:

  • Phase 2 (harvest evidence from the brain DB you just populated + infer relationships)
  • Phase 3 (generate articles for all entities — first run will generate all)
  • Phase 5 (FTS5 index the new articles)

Show the user:

KNOWLEDGE ENGINE
================
Articles generated:  N
FTS5 indexed:        N
Estimated cost:      $0.XXX

Articles written to: ~/.coco/knowledge/articles/
Search with: /brain-wiki search "{project_name}"

Skip this step silently if:

  • ~/.coco/knowledge/ does not exist (knowledge engine not installed)
  • The cron.py call fails for any reason (non-blocking — brain init still succeeds)

Important Rules

  • Dedup before writing. Always check what exists in the DB before proposing new writes. Use upsert_entity which handles this automatically for entities.
  • Don't read every file. For doc inventory, just register the file — don't parse 130KB HTML files to extract content. That's what /brain-update is for (conversation-driven).
  • Date everything. Decisions and events need dates. Parse from the source if available, fall back to file modification date, then today.
  • Memory files are structured. They have frontmatter — use the type field to decide what to extract.
  • Manifest tracks scan state. Always run scan-update after writes so the next scan is incremental.

Frequently asked questions

What does the Brain:Init AI skill do?

Use when setting up project memory in a new folder or on the first brain:init in a project. Creates project_brain.db, registers the project, and bootstraps it from CLAUDE.local.md, memory files, docs, and emails; safe to re-run.

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/coco-research/coco/tree/main/systems/brain/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?

It is published on GitHub by coco-research. Check the repository for licensing terms. 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 👇