LogseqBrain CLAUDE.md

Pokyny pre prácu s projektom LogseqBrain, doplnkom, ktorý ukladá trvalú pamäť agenta do používateľského grafu v Logseq. Logseq graf je súbor poznámok prepojených medzi sebou.

In plain words
What is it for?
Pomáhajú agentovi upravovať markdownové skills a konfiguračné súbory doplnku bez predpokladania databázovej verzie Logseq.
Why use it?
Vysvetľujú, kde sa nachádzajú súbory, ako sa rieši cesta ku grafu a aké obmedzenia má používaná verzia Logseq.

Instructions file

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 instructions/jame581/logseqbrain/claude-md
Clone the repo
git clone --depth 1 https://github.com/jame581/LogseqBrain
Per session 2,414 This file is loaded in full into every session.
When invoked 2,414 The same file — it is already loaded in full.
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.02414 $0.02414
Opus 5 $0.01207 $0.01207
Sonnet 5 $0.00483 $0.00483
Haiku 4.5 $0.00241 $0.00241

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

Security

Grade A, and why

LogseqBrain CLAUDE.md 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 3d 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.

CLAUDE.md · 75 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this repo is

A Claude Code plugin (logseq-brain) that gives Claude persistent memory via a user-owned Logseq graph. There is no build, no tests, no runtime code — the plugin is entirely markdown skills (skills/<name>/SKILL.md) plus .claude-plugin/plugin.json. Claude itself is the runtime: skills instruct Claude to read/write markdown files in the user's ClaudeBrain graph using the standard Read/Write/Edit/Bash tools.

Target: Logseq OG (the markdown version) only. Logseq split in 2026 — OG moved to https://github.com/logseq/og and is in maintenance mode (security and Electron upgrades, no new features), while the DB/SQLite version continues at the original repo. There is no API or CLI for file graphs (@logseq/cli serves DB graphs only), so all leverage here is file layout, property discipline, and ripgrep. Do not propose DB-version features.

The plugin is distributed via the skillsmith marketplace, the Gemini extension URL, and (for Cowork) a locally-built logseq-brain.plugin zip. The .plugin archive is a build artifact — gitignored (*.plugin), not checked in. Edit files under skills/ and .claude-plugin/, never inside an archive.

Architecture

Five skills make up the save/load cycle against a Logseq graph:

  • brain-init — First-time graph setup (creates pages/Index.md, Meta.md, Decisions.md, logseq/config.edn, journals/.gitkeep) and adds new project pages. New project pages ship with a digest scaffold, so a fresh page never lands in a missing-digest report.
  • brain-load — Reads a project page back into the session. Since v0.10.0 the default is digest mode: one Read(offset 0, limit 20) of the page-top properties + ## Digest, plus today's journal's mention(s) of the project (shrunk to fit), and then nothing else — everything further is fetched on demand through the escalation ladder, announced. A page with no digest falls back to the pre-v0.10.0 brief mode unchanged and is offered a digest, never given one uninvited. Also full mode, fuzzy project name matching, and cross-graph search ("what do we know about X").
  • brain-save — Surgically appends session logs, decisions, plan updates to the relevant Projects___<Name>.md page via Edit. Also updates journals, Meta, Index. Detects cross-project decisions and decision conflicts (marks old as status:: superseded); seeds/updates task status::, suggests rotation of Session Logs past 64 KB/40 entries, refreshes the project's Index.md one-liner on every save, prompts on decision-shaped statements, and runs a mechanical post-write verify grep over the files it wrote. Since v0.10.0, step 9 of 13 unconditionally refreshes the page's digest — properties plus the ## Digest section, with the Map bullet recomputed from the file rather than remembered.
  • brain-status — Dashboard across all project pages, built from a single ripgrep over digest properties since v0.10.0; pages not yet backfilled fall back to section-targeted reads one page at a time. Flags stale projects; groups task pages by status::. Separate brain-stats analytics mode.
  • brain-doctor — Graph-hygiene lint/repair (v0.8.0, extended in v0.9.0). Scans pages + journals for format violations that spawn phantom pages or broken macros ({{ }} mis-used for inline code, bare #number/hex tags, un-namespaced [[Task]] links, [[file://]] links, junk/description links), reports them, and — after a backup — repairs them. Includes the jira-markup residue check and the guided task-status backfill. v0.10.0 takes the rule catalog to 14 — adding missing-digest, stale-digest, oversized-digest, and (wave A) stale-map, all report-tier except the safe-only subset of oversized-digest — plus a guided whole-graph digest backfill ("backfill digests") that states its read cost before spending it. Maintenance tool, run on demand; not part of the per-session save/load cycle.

Read the full file on GitHub · 75 lines

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. 3d ago First seen · 75 lines · 2,414 tokens per session scan A 011b83177fa4

Subscribe to this mod's changes

LogseqBrain CLAUDE.md is an instructions file published in the GitHub repository jame581/LogseqBrain (17 stars, last pushed 1mo ago), licensed MIT. It adds 2,414 tokens to every session, about $0.0121 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.