brain-init

A setup tool for a Logseq graph, which is a folder of linked notes, used as an external project memory called Claude Brain. It can create the graph structure or add a project page to an existing graph.

In plain words
What is it for?
Use it for first-time Claude Brain setup or to add a new project page. It responds to commands such as “init brain” and “add project to brain,” but not loading, saving, or status checks.
Why use it?
Starting a note-based project memory by hand requires creating configuration, index, and metadata files in the right places. This defines that initial structure and handles adding projects.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jame581/logseqbrain/brain-init
Any agent
npx skills add jame581/LogseqBrain --skill brain-init
Clone the repo
git clone --depth 1 https://github.com/jame581/LogseqBrain

Made for: Claude Code, Codex.

Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,338 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00071 $0.01338
Opus 5 $0.00036 $0.00669
Sonnet 5 $0.00014 $0.00268
Haiku 4.5 $0.00007 $0.00134

Measured 2d ago against content hash 200c2b683fa8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

brain-init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/brain-init/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

First-Time Graph Setup

If the graph folder is empty or missing core files, initialize it:

  1. Create logseq/config.edn with minimal Logseq config:
{:meta/version 1
 :preferred-format "Markdown"
 :journal/page-title-format "yyyy-MM-dd"
 :journal/file-name-format "yyyy_MM_dd"}
  1. 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
  1. 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._
  1. 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._
  1. Create the journals/ directory with a .gitkeep file to ensure it persists in version control. Use mkdir -p via Bash or create journals/.gitkeep with 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, write a journey-log entry per skills/_shared/journey-log.md with the activity line: initialized graph at <graphPath>.

Read the full file on GitHub · 108 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 108 lines · 71 tokens per session scan A 200c2b683fa8

Subscribe to this mod's changes

brain-init is a skill published in the GitHub repository jame581/LogseqBrain (17 stars, last pushed 1mo ago), licensed MIT. It adds 71 tokens to every session and 1,338 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

curator-continuity

Use at the start of a build or coding session on a Curator-tracked project, and again when context runs low. Activates on "continue", "resume", "where did we leave off", "catch me up on this project", and on the save side "save state", "write a handoff", "checkpoint this", "I am running low on context", "before we…

talirezun/the-curator · 215 tokens

my-curator

Use when interacting with the user's My Curator second brain via the my-curator MCP. Activates for READ ("what does my wiki say about X", "deep research my second brain", "find every source that mentions Y", "what does our cohort wiki say"), WRITE ("save to my wiki", "compile our findings", "put this in my projects…

talirezun/the-curator · 194 tokens

review-implementing

Process and implement code review feedback systematically. Use when user provides reviewer comments, PR feedback, code review notes, or asks to implement suggestions from reviews. Activates on phrases like "implement this feedback", "address review comments", "fix review issues", "apply these suggestions", or when…

LEEI1337/phantom-neural-cortex · 68 tokens

using-git-worktrees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification.

LEEI1337/phantom-neural-cortex · 35 tokens

git-pushing

Stage, commit, and push git changes with conventional commit messages. Use when user wants to commit and push changes, mentions pushing to remote, or asks to save and push their work. Also activates when user says "push changes", "commit and push", "push this", "push to github", or similar git workflow requests.

LEEI1337/phantom-neural-cortex · 70 tokens

code-quality-check

Automated code quality verification checklist.

LEEI1337/phantom-neural-cortex · 10 tokens