brain-init
Skill18 starsChanged 2 months agoMITView on GitHub
Set up the Claude Brain Logseq graph (first-time) or add a new project page. Triggers: "init brain", "setup brain", "init brain project <name>", "add project to brain". Don't fire for loads, saves, or status checks — those are handled by brain-load, brain-save, and brain-status.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- svy04/ballasttheir own version, first seen Aug 23, 2026
- toroleapinc/claude-braintheir own version, first seen Mar 4, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- toroleapinc/claude-brain★ 91same name
- svy04/ballast★ 74same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- evalSkill
- releaseSkill
- brain-doctorSkill
- brain-loadSkill
- brain-saveSkill
- brain-statusSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Put text arguments in single quotes.
- Distinctive: line 29
If the graph folder is empty or missing core files, initialize it:
- Very specific: line 31
Create logseq/config.edn with minimal Logseq config:
- Very specific: line 40
Create pages/Index.md — the master index page:
- Very specific: line 53
Create pages/Meta.md — for storing user preferences and conventions:
- Very specific: line 67
Create pages/Decisions.md — cross-project decision log:
- Very specific: line 77
Create the journals/ directory with a .gitkeep file to ensure it persists in version control.
- Very specific: line 83
After confirmation, run brain activity "initialized graph at <graphPath>".
- Distinctive: line 87
When the user wants to add a project (e.g., "add MyProject to brain", "init brain project GameDev"):
- Very specific: line 103
Update pages/Index.md — add a link to the new project under the Projects section:
- Very specific: line 112
Always use yyyy-MM-dd format for dates (e.g., 2026-04-12).
- Very specific: line 117
When creating the journals/ directory, use Bash (mkdir -p) or the Write tool to ensure it exists — do not skip this step.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Brain Init
Initialize the Claude Brain Logseq graph or add a new project page to an existing graph.
Prerequisites
Resolve the graph path per skills/_shared/path-resolution.md. If the resolved folder is empty or missing core files, this skill performs first-time setup (below). Otherwise it adds a new project to the existing graph. The helper (below) is required from step 4 on.
Running the helper
- Bash:
sh "<this skill's base directory>/../_shared/bin/brain" <command> … - PowerShell-only Windows:
& "$(Split-Path (Split-Path (Get-Command git).Source))\bin\bash.exe" "<base>/../_shared/bin/brain" <command> … - Neither works: stop and say "logseq-brain needs Git for Windows (Git Bash) — https://git-scm.com/download/win".
- In Cowork, always pass
--graph <connected folder>. Elsewhere pass--graphonly when the graph is not configured. It may go anywhere on the line. On exit 2 withgraph not resolved, followskills/_shared/path-resolution.md, then pass--graph. - Put text arguments in single quotes; a
'inside becomes'\''. In double quotes the shell runs backticks and expands$. - Exit 0 clean, 1 findings (act on them), 2 error (act on its reason; don't retry blindly). Quote every
coverage:line. Never recompute a figure it printed. Itsgraph:line is the folder for your own Read, Edit and Write calls.
First-Time Graph Setup
If the graph folder is empty or missing core files, initialize it:
- Create
logseq/config.ednwith minimal Logseq config:
{:meta/version 1
:preferred-format "Markdown"
:journal/page-title-format "yyyy-MM-dd"
:journal/file-name-format "yyyy_MM_dd"}- Create
pages/Index.md— the master index page:
type:: index
description:: Master index of Claude's brain — all projects and key pages
- ## Projects
- _No projects yet. Use "init brain project [name]" to add one._
- ## Quick Links
- [[Meta]] — preferences, working style, conventions
- [[Decisions]] — cross-project decision log- Create
pages/Meta.md— for storing user preferences and conventions:
type:: meta
last-updated:: {{today}}
- ## User Preferences
- _Add preferences as they emerge from working sessions._
- ## Conventions
- _Add naming conventions, coding style preferences, etc._
- ## Tools & Stack
- _Add commonly used tools, languages, frameworks._- Create
pages/Decisions.md— cross-project decision log:
type:: decisions
last-updated:: {{today}}
- ## Decision Log
- _Decisions that span multiple projects or are general in nature._- Create the
journals/directory with a.gitkeepfile to ensure it persists in version control. Usemkdir -pvia Bash or createjournals/.gitkeepwith the Write tool. This directory must exist before brain-save can write journal entries — do not skip this step.
Replace {{today}} with the current date in yyyy-MM-dd format.
Confirm to the user that the graph is ready and they can open it in Logseq.
After confirmation, run brain activity "initialized graph at <graphPath>".
Adding a New Project
When the user wants to add a project (e.g., "add MyProject to brain", "init brain project GameDev"):
- Determine the project name from the user's request.
- Ask the user for a brief description and any initial context for the project (tech stack, repo location, key info) — gather this before writing the page. The template (
references/templates.md) uses the same description in three places:focus::, the Digest Identity bullet, and## Overview. If the description exceeds 120 bytes, use a short form forfocus::(the digest property cap — seeskills/_shared/digest.md) and keep the full text in## Overviewand the Digest Identity bullet. - Create the project page at
pages/Projects___<ProjectName>.mdusing the template fromreferences/templates.md, substituting the gathered description intofocus::, the Digest Identity bullet, and## Overview. The triple underscore___is how Logseq represents the/namespace separator in filenames — so this page will appear asProjects/ProjectNamein the Logseq sidebar. brain digest Projects/<ProjectName> --apply— replaces the template's- Map: pendingline with the measured Map. Its report must saymap: ok.- Confirm no template placeholder survives. Step 4's report saying
map: okis the explicit gate for the Map placeholder — do not proceed to this step if it didn't, since a failed or skipped step 4 leaves the literal wordpendingin the- Map:bullet (references/templates.md), which isn't{{…}}syntax and the grep below won't catch it. Then check for this template's two remaining placeholders specifically, not for{{in general:
must returngrep -cE '\{\{(today|project_description)\}\}' "pages/Projects___<ProjectName>.md"0. A bare{{search would be wrong twice over:{{query}}and{{embed}}are legitimate Logseq macros thatcode-in-bracesexplicitly whitelists, and a user's project description may contain{{of its own — matching either would send you "replacing" content that was never a placeholder. If it doesn't, find and replace the remaining placeholder before continuing — a literal{{...}}left in the graph is acode-in-bracesviolation, exactly the kind of format break this plugin exists to prevent. - Update
pages/Index.md— add a link to the new project under the Projects section:[[Projects/<ProjectName>]] — <brief description>
Confirm the project page was created and remind the user they can now use "save to brain" during work sessions and "load [project]" to restore context.
After confirmation, run brain activity "created project [[Projects/<ProjectName>]]".
Date Format
Always use yyyy-MM-dd format for dates (e.g., 2026-04-12). This matches Logseq's journal format and sorts correctly.
Important Notes
- See
CLAUDE.md"Logseq format invariants" for namespace separators, bullet format, properties, link syntax, and date format. - When creating the
journals/directory, use Bash (mkdir -p) or the Write tool to ensure it exists — do not skip this step.
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
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.

