/logseq-brain:brain-savefrom logseq-brain
Saves session context, decisions, progress, and plans to a Logseq graph for continuity across sessions. Activates on explicit save cues like 'save to brain' or wrap-up prompts.
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.
Persist session context to the Claude Brain Logseq graph, for continuity across sessions and devices. A routine save is: save-begin, one Read, three Edits, save-finish. It reads no file but this one.
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.Confirm the save was asked for. If the user's words were not an explicit save request (a wrap-up cue, "thanks", or your own idea), don't save: offer it as references/auto-suggest.md says, and continue only on a yes.
Targets. Take the project from the names, files and repos discussed, or the user's words. If unclear, ask: "This touched [X] and [Y] — save to both?" Several pages are saved one at a time, each running steps 2–7 before the next begins.
brain save-begin <page> [--also FILE…]. Don't list the graph first. It baselines the page, pages/Index.md and today's journal, and prints what you edit:
== digest: the property block and ## Digest (a map: stale or missing here is expected: save-finish recomputes the Map);== open: the page's open:: items (open: none when empty) and, when there are items, an open-checked: line;== session-log: the newest entry;== current-plan;== anchors: the page's Index line and the end of today's ## Sessions.Name every other file this save may write with --also: pages/Meta.md, pages/Decisions.md, pages/Tasks___<ID>.md. If the need appears while composing, rerun save-begin with the full list before the first Edit, never after: a rerun resets the baselines.
page not found (exit 2): never write to a missing page. Offer to create it via brain-init's "Adding a New Project". If declined, list the projects (brain status) and let the user pick.status:: with active | blocked | done. Seed status:: active if it's missing. On completion signals ("merged", "deployed", "closed", "released", "hotovo"), suggest status:: done, and never write a status change the user didn't confirm. When the save targets a project page, touch a related task page only to change its status::, passing it in --also. A save that targets the task page itself follows steps 2–7 like any page. A worked task with no page gets only the Current Plan pointer and an offer to create it. Never create one uninvited.save-begin, the step-3 one-line Read, one Edit of status:: and last-updated:: (add status:: if absent), then save-finish <page> --summary 'status → <value>' with no --index, so the Index parenthetical is untouched. Intended: no Session Log entry and no digest refresh. Project values are active | paused | done, task values active | blocked | done; for "mark blocked", say blocked is a task status and ask. Confirm the change first unless the user stated it plainly.One Read of the page, for Edit: Read with offset: 1, limit: 1. That unlocks Edit for the whole file. The text you replace comes from step 2's output. Need another section's text for an anchor (Implementation, Decisions)? Use brain read <page> '<section>', not a whole-page Read. Don't read Index or the journal: save-finish writes them.
Compose.
- yyyy-MM-dd: Brief summary of what was done
- Detail
- files-modified:: key files changed
- skills-used:: skills or tools used
- related-tickets:: Jira IDs
- open-questions:: unresolved questions to carry forward
Write each :: child only when it has a real value.- PROJ-1234: title with status::, estimate::, task-folder:: and summary:: children. Add the ID to related-tickets::. The full plan lives in the task folder.pages/Meta.md, in --also): only new, lasting preferences, conventions or tools. Never one-off instructions or sensitive data. Details in references/categories.md § 6.open:: re-check. Judge each open: item against this session. Resolved: drop it, and name the Session Log line that resolves it. Can't judge: keep it. When open-checked: ends · ask, ask once before any Edit, batched with the Decisions question when both apply: "Still open? (1) … (2) …", listing only the items you would keep. On a task page a resolved item may move to ## Done instead of vanishing. Drop an item only for a session reason (named) or the user's answer. Set open-checked:: <today> only after the user answered that question, never otherwise.references/decisions.md (the conflict check and the cross-project copy to pages/Decisions.md, which must then be in --also). Declined ones stay as Session Log prose.{{ }}.# directly before a number or word, even after a letter (C#-parity, PKCS#12): backtick the token or rephrase.[[Tasks/…]], [[Projects/…]].[x](file:///…) or backticks. Never [[file://…]], never relative [x](docs/x.md).key:: only in the page-top block and the children shown in the templates above (Session Log files-modified:: etc., the Current Plan pointer's), and Decision entries' properties per references/decisions.md. Any other single-colon line such as - status: blocked is prose: don't turn it into ::.yyyy-MM-dd.Edit the page surgically. Never rewrite a whole page. New entries go at the end of their section.
## Digest prose (they are adjacent). Set last-updated:: and digest-updated:: to today. Write focus:: and next:: (both required). Write open:: only when something is genuinely open; otherwise remove the line. Each value is one line of at most 120 bytes. Rewrite the prose bullets from this session's knowledge, in slot order: Identity, Now, Binding (dated pointers to decisions), Hazard, then a free slot. Task pages usually need only Identity and Now. The whole section is capped at 800 B, Map included. Leave the Map line alone; save-finish computes it. A page with no ## Digest gets one here, right after the property block, per skills/_shared/digest.md § Surface 2. Say in step 7 that it was backfilled, and that a Rebuild from source is available.status::, when needed.skills/_shared/logseq-format.md.brain save-finish <page> --summary '<one line>' --index '<latest version or milestone> — <current focus>'. Use single quotes. Pass --index for a project page only. The summary becomes - [[Projects/<Name>]]: <summary> under today's ## Sessions. The index text replaces the parenthetical of the page's one-liner in pages/Index.md (e.g. v0.8.0 shipped 2026-06-23 — v0.9.0 in design). Both are rewritten on every save. The command validates, writes the Sessions bullet, the Index text and the Map, checks every file save-begin baselined, and logs the activity line.
over: lines, shorten the free slot first, then Binding and Hazard, with one Edit. A refused text gets rephrased.index: missing: Read pages/Index.md and add the one-liner under ## Projects, its descriptor taken from the page's first Overview bullet. Then run brain check pages/Index.md. index: ambiguous: tell the user.check … error-tier findings: a line this save wrote breaks a rule, and the activity line is deferred. The helper has written the Map, so Read the page again before fixing with Edit. Then run the brain check … && brain activity … it printed.broken-link, unknown-property-key): tell the user; don't block. A broken-link on [[Tasks/<task ID>]] that this save wrote: say "new link to missing task page Tasks/<ID>" and offer to create it per skills/_shared/task-pages.md; write nothing unless the user says yes. For unknown-property-key, name the canonical key the finding gives.nonconvergent-map / duplicate-map: see skills/_shared/hygiene-rules.md.Confirm in plain language: what was written, the check result, any warn-tier items, an open:: item dropped (and why), and a digest backfill if one happened. Rotation: after save-finish, if step 2's table showed the Session Log row over 32768 B, suggest rotation (references/rotation.md). On a yes, run brain rotate <page> then --apply; if the yes arrives next turn, run them then. It costs no model output. On an explicit "rotate session log" request, skip the size trigger and go straight to brain rotate <page>, then --apply on a yes; no save baselines are involved.
See references/auto-suggest.md. Suggest only; never auto-save.
save-begin once per page, before its first Edit. A rerun resets the baselines save-finish checks against; if it prints warning: changed since the last save-begin, run brain lint on the files it names before you finish.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
logseq, session-persistence, context-saving, knowledge-graph
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-initSet 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.
/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-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