/logseq-brain:brain-initfrom logseq-brain
Initializes a Logseq graph for Claude's persistent memory (first-time setup) or adds a new project page to an existing graph.
Ships in logseq-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Initialize the Claude Brain Logseq graph or add a new project page to an existing graph.
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.
sh "<this skill's base directory>/../_shared/bin/brain" <command> …& "$(Split-Path (Split-Path (Get-Command git).Source))\bin\bash.exe" "<base>/../_shared/bin/brain" <command> …--graph <connected folder>. Elsewhere pass --graph only when the graph is not configured. It may go anywhere on the line. On exit 2 with graph not resolved, follow skills/_shared/path-resolution.md, then pass --graph.' inside becomes '\''. In double quotes the shell runs backticks and expands $.coverage: line. Never recompute a figure it printed. Its graph: line is the folder for your own Read, Edit and Write calls.If the graph folder is empty or missing core files, initialize it:
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"}
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
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._
pages/Decisions.md — cross-project decision log:type:: decisions
last-updated:: {{today}}
- ## Decision Log
- _Decisions that span multiple projects or are general in nature._
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.
Mention that Logseq turns every property key into a page (:property-pages/enabled? true) and that brain-doctor can turn that off on request. Init never edits logseq/config.edn for it.
After confirmation, run brain activity 'initialized the graph'.
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. Then check it doesn't exist yet: run brain digest Projects/<ProjectName>. Any exit other than 2 with page not found means the page exists: never overwrite it. Say so and offer "load " instead, or a different name. A did you mean: line naming Projects/<ProjectName> in another case means the same. Other did you mean: names only resemble it (a substring match), so continue.
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 for focus:: (the digest property cap — see skills/_shared/digest.md) and keep the full text in ## Overview and the Digest Identity bullet.
Create the project page at pages/Projects___<ProjectName>.md using the template from references/templates.md, substituting the gathered description into focus::, the Digest Identity bullet, and ## Overview. The triple underscore ___ is how Logseq represents the / namespace separator in filenames — so this page will appear as Projects/ProjectName in the Logseq sidebar.
brain digest Projects/<ProjectName> --apply — replaces the template's - Map: pending line with the measured Map. Its report must say map: ok.
Confirm no template placeholder survives. Step 4's report saying map: ok is 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 word pending in 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:
grep -cE '\{\{(today|project_description)\}\}' "pages/Projects___<ProjectName>.md"
must return 0. A bare {{ search would be wrong twice over: {{query}} and {{embed}} are legitimate Logseq macros that code-in-braces explicitly 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 a code-in-braces violation, 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>]]'.
"Add a task page for " (or an offer from brain-load / brain-save): follow skills/_shared/task-pages.md § Create a task page. Template: references/templates.md.
Always use yyyy-MM-dd format for dates (e.g., 2026-04-12). This matches Logseq's journal format and sorts correctly.
CLAUDE.md "Logseq format invariants" for namespace separators, bullet format, properties, link syntax, and date format.journals/ directory, use Bash (mkdir -p) or the Write tool to ensure it exists — do not skip this step.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
logseq-brain@skillsmith is listed by jame581/skillsmith — review the source before installing
npx claudepluginhub jame581/skillsmith --plugin logseq-brain5 skills in this plugin
/brain-doctorLint and repair the Claude Brain Logseq graph — find and fix format violations that create phantom pages or broken macros. Triggers: "brain doctor", "lint brain", "check brain health", "clean up brain", "fix brain", "graph hygiene", "why are there empty pages", "find broken pages", "backfill digests", "rebuild digest for <project>". Don't fire for loads (use brain-load), saves (use brain-save), status/analytics (use brain-status), or first-time setup (use brain-init).
/brain-loadLoad project context from the Claude Brain Logseq graph into the current session. Triggers: "load brain", "load <project>", "resume <project>", "continue work on <project>", "load <task ID>", "what do we know about <topic>", "search brain for X", "find X in brain". Don't fire for write operations (use brain-save), generic questions about Logseq itself, or "open <file>" / "switch to <branch>" requests that mean opening files or switching git branches rather than loading project memory.
/brain-saveSave session context, decisions, progress, and plans to the Claude Brain Logseq graph. Triggers: "save to brain", "save this", "remember this", "store this decision", "log this", "save progress", "rotate session log", "mark <project> paused". On wrap-up cues ("before I quit", "wrap up") after real project work, offer a save; never save unasked. Don't fire for read operations (use brain-load) or status checks (use brain-status).
/brain-statusShow a dashboard of all projects in the Claude Brain graph, or graph analytics. Dashboard triggers: "brain status", "show projects", "show brain", "what's in my brain", "project dashboard", "brain overview", "list projects", "summary". Analytics triggers: "brain stats", "graph analytics", "graph activity over time". Don't fire for loads (use brain-load) or saves (use brain-save).
Other plugins' skills for the same job