Skip to content

About

Persistent memory for Claude using a dedicated Logseq graph. Save and load project context, decisions, and progress across sessions and devices.

Topics

Resources

Contributing

Stars

18 stars

Watchers

0 watching

Forks

Latest commit

 

History

326 Commits

Folders and files

Repository files navigation

Logseq Brain

Version License Skillsmith

Persistent memory for Claude using a dedicated Logseq graph. Save and load project context, decisions, and progress across sessions and devices.

Overview

This plugin turns a Logseq graph into Claude's external brain. Claude can read from and write to the graph, storing project plans, decisions, implementation details, and session logs. Because Logseq syncs across devices, your Claude context travels with you — start a task on your desktop, continue on your notebook.

Install

Logseq Brain ships through the skillsmith marketplace.

Claude Code

/plugin marketplace add jame581/skillsmith
/plugin install logseq-brain@skillsmith

GitHub Copilot CLI

copilot plugin marketplace add jame581/skillsmith
copilot plugin install logseq-brain@skillsmith

Cowork (Desktop App)

  1. Create a new Logseq graph called "ClaudeBrain" (or any name you prefer).
  2. Install this plugin in Claude (accept the .plugin file).
  3. Say "init brain" — Claude will ask you to select the graph folder.
  4. Say "init brain project MyProject" to add your first project.

Setup

Requirements: a POSIX shell with awk. That is built into macOS, Linux and Cowork; on Windows, install Git for Windows (Git Bash). The skills call a small bundled helper (plugin/skills/_shared/bin/brain in this repo) for every byte count, digest Map and format check. It writes only inside your graph folder, keeps private scratch copies of the pages it checks in your temp folder, and makes no network calls.

After installing, create a Logseq graph (e.g. "ClaudeBrain") and tell the plugin where to find it. Pick one:

  • Environment variable: export LOGSEQ_BRAIN_PATH=/path/to/ClaudeBrain (highest precedence)
  • Just tell Claude the path when prompted — Claude saves it to a durable user config file (%APPDATA%\logseq-brain\config.json on Windows; on macOS/Linux $XDG_CONFIG_HOME/logseq-brain/config.json if XDG_CONFIG_HOME is set, otherwise ~/.config/logseq-brain/config.json) so you're not asked again, even after plugin reloads

Then say "init brain" to set up the graph structure, and "init brain project MyProject" to add your first project.

Skills

brain-init — Set up the graph for the first time, or add a new project.

  • "init brain" — creates the graph structure (Index, Meta, Decisions pages)
  • "init brain project MyProject" — adds a new project page, and never overwrites one that already exists

brain-load — Load project context into the current session.

  • "load MyProject" — loads the project's digest in one helper call: ~1.5 KB no matter how big the page is, plus today's journal entry for that project if there is one (targeting ~2 KB). It tells you exactly what it didn't read
  • Anything it didn't read is one question away — ask and it greps for just that, announcing each step
  • Since v0.12.0 a digest load is 2 tool calls and a save about 6, down from 11 and 27 (measured with the eval suite in evals/)
  • "load MyProject full" — loads everything including decisions, implementation, linked tasks
  • "load CRMGM-2070" — loads a task page by its tracker ID (any KEY-123 form: Jira, YouTrack, Linear). If there's no page yet, it says how often the ID is linked in the graph and offers to create one; it never creates it unasked
  • "load brain" — loads a high-level overview of all projects
  • "what do we know about strategy pattern", "search brain for X" — searches across the graph

brain-save — Save the current session's work to the graph.

  • "save to brain" — saves decisions, progress, and plans from this session
  • Never saves without your confirmation: "wrap up" or "before I quit" only offer a save
  • "save progress" — same as above
  • "remember this" — save specific information
  • Automatically detects multi-project sessions and Jira task context
  • Updates Meta.md when new user preferences are discovered
  • Jira comment drafts are stored verbatim in fenced code blocks
  • Every save ends with one helper call that writes the journal's ## Sessions bullet, the Index.md one-liner and the digest Map, then checks every file the save touched for format problems before it logs the save. The text it writes itself is checked first: a refusal writes none of it and says what to fix
  • Seeds and updates task status:: as work progresses; "mark MyProject paused" sets a project's status without a full save
  • Re-checks the page's open:: items on each save, drops the ones the session resolved, and after 30 days asks about the rest in one question
  • Suggests Session Log rotation to a SessionArchive page once a project or task page grows past 32 KB ("rotate session log"). On a yes, the helper moves the oldest entries verbatim, writing both files or neither, and refuses any layout it can't move safely
  • Offers to create a task page when the session worked on a task that has none
  • Refreshes the project's Index.md one-liner and the page's digest on every save, so the cheap-recall surface never goes stale; a page without a digest gets one on its first save

brain-status — Quick dashboard of all projects.

  • "brain status" — shows all projects with status, last activity, current focus
  • "show projects" — same as above
  • Flags stale projects that haven't been updated recently
  • Groups task pages by status:: (active, blocked, done)
  • Builds the whole dashboard from one brain status call over every project and task page's digest properties
  • "brain stats" — graph analytics: projects, tasks, decisions, sessions, recent activity

brain-doctor — Lint and repair the graph (graph hygiene).

  • "brain doctor" / "check brain health" — scans for format problems and reports them
  • "fix brain" / "clean up brain" — repairs them after a backup and your confirmation
  • Catches the things that quietly create empty "phantom" pages or broken macros: code wrapped in {{ }}, bare #number/hex tags (and # after a letter, as in C#-parity), un-namespaced [[Task]] links, [[file://]] links, relative file links, and links whose description is itself a link
  • Also flags malformed properties, links to pages that don't exist, property keys outside the plugin's fixed list (with the right key when it's a known synonym), duplicate entries and structural gaps
  • Ranks the most-linked missing task pages and offers stubs for them, and offers to turn off Logseq's :property-pages/enabled? so property keys stop becoming pages
  • Reports unfenced Jira markup residue and guides a one-time batch backfill of missing task status::
  • Reports digests that are missing, stale, over their 800 B cap, or whose Map is stale, mislabelled, duplicated or can't converge, and can backfill missing ones in one guided pass ("backfill digests")

Graph Structure

ClaudeBrain/
├── pages/
│   ├── Index.md                    ← master index
│   ├── Meta.md                     ← your preferences and conventions
│   ├── Decisions.md                ← cross-project decisions
│   ├── Projects___MyProject.md     ← project pages (namespace: Projects/)
│   ├── Projects___MyProject___SessionArchive.md  ← rotated Session Log entries
│   └── Tasks___PROJ-1234.md        ← task pages (namespace: Tasks/)
├── journals/
│   └── 2026_04_12.md                ← daily journal: ## Sessions + ## Activity
└── logseq/
    └── config.edn                   ← Logseq graph config

Journey Log

Every brain operation (init / load / save / status / search) leaves a one-line HH:mm-prefixed bullet in today's journal under ## Activity — a low-cost, time-ordered audit trail of what Claude did, when. Disable by adding "journeyLog": false to your user config file (%APPDATA%\logseq-brain\config.json on Windows; on macOS/Linux $XDG_CONFIG_HOME/logseq-brain/config.json if XDG_CONFIG_HOME is set, otherwise ~/.config/logseq-brain/config.json).

Digest

Every project and task page carries a small summary at the top — four properties (focus::, next::, open::, digest-updated::) and a ## Digest section capped at 800 bytes. Loading a project reads only that from the page — one ~1.5 KB read instead of a 107 KB one — plus today's journal entry for that project if there is one. Nothing else is loaded up front.

The last digest bullet is a map — e.g. Session Log | 87 KB (47 entries) · Active Tasks | 10 KB · Current Plan | 3 KB · Decisions | 2 KB (2) · page | 107 KB — computed from the file, never written from memory, and derived from whatever sections the page actually has (not a fixed list — a page whose real second-largest section is Active Tasks shows Active Tasks). It does two jobs: it tells Claude what it doesn't have (so it can't quietly reason as though it read everything), and it's the index Claude uses when you ask for more.

Pages without a digest keep working exactly as before: a load offers to build one, and the first save creates one. Run brain-doctor and say "backfill digests" to do the whole graph at once.

The Map is computed by the bundled helper from the page itself, never written by hand.

About

Persistent memory for Claude using a dedicated Logseq graph. Save and load project context, decisions, and progress across sessions and devices.

Topics

Resources

Contributing

Stars

18 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages