/obsidian-brain:emergefrom obsidian-brain
Surface unnamed patterns across vault themes. Use when: (1) /emerge for last 30 days, (2) /emerge 14d for custom window, (3) /emerge this week.
Ships in obsidian-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.
None: SKILL.md is the whole skill.
Operates on themes (clustered by /consolidate), not raw notes, so it scales
to large vaults within one sub-agent's context budget. Reads themes updated in a
date window, ranks them by activation, and synthesizes cross-cutting patterns.
Tools needed: Bash, Agent, Write, Read
Run this as a command of its own:
git rev-parse --show-toplevel
If it fails (not a git repo), run pwd instead. Keep the printed path; the steps below call it <REPO_ROOT>. Paste that literal path wherever a block below names '<REPO_ROOT>', in single quotes (write a ' inside it as '\''). Do not put git inside $(...): a worktree-isolated session refuses any command substitution whose text contains git (#521).
TaskCreate: subject="Collect themes in window", activeForm="Collecting themes"
TaskCreate: subject="Analyze patterns across themes", activeForm="Analyzing patterns"
TaskCreate: subject="Build emerge report", activeForm="Building report"
TaskCreate: subject="Write vault note", activeForm="Writing vault note"
TaskCreate: subject="Present results", activeForm="Presenting results"
Track task IDs. Set task #1 to in_progress.
Parse the arg as DAYS: no arg = 30, Nd/N days = N, this week = days since Monday. Bind it to $DAYS.
cd '<REPO_ROOT>'
python3 -c '
import glob, json, os, re, sys
def _ob_hooks():
try:
for _m in json.load(open(os.path.expanduser("~/.claude/plugins/known_marketplaces.json"))).values():
_s = _m.get("source") if isinstance(_m, dict) else None
if not (isinstance(_s, dict) and _s.get("source") == "directory"):
continue
_i = _m.get("installLocation") if isinstance(_m, dict) else None
if not (isinstance(_i, str) and os.path.isabs(_i)):
continue
_h = os.path.join(_i, "hooks")
if os.path.isfile(os.path.join(_h, "obsidian_utils.py")):
return _h
except Exception:
pass
_c = [_d for _d in glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")) if re.fullmatch("[0-9]+([.][0-9]+)*", _d.split("/")[-2])]
return max(_c, key=lambda _p: ([int(_n) for _n in _p.split("/")[-2].split(".")], _p), default="hooks")
sys.path.insert(0, _ob_hooks())
from emerge_cli import run_emerge_themes; run_emerge_themes(int(sys.argv[1]) if len(sys.argv) > 1 else 30)
' "$DAYS"
Parse the STATUS= line:
STATUS=SPARSE:<n> → tell the user verbatim: "Only theme(s) were updated in this window. Run /consolidate to seed themes first, or widen the window: /emerge 90d." — then STOP (do not run Steps 2-4).STATUS=OK:<themes>:<unassigned> → proceed to Step 2.If the command errors (config missing / non-zero exit), tell the user to run /obsidian-setup first and stop. Mark task #1 completed.
Set task #2 to in_progress. Spawn one Agent:
Agent({
description: "Analyze vault themes for cross-cutting patterns",
prompt: "Read ~/.claude/obsidian-brain/emerge-themes.json. It contains `themes` (each with name, summary, note_count, activation, project, and a `members` array of {title, excerpt, similarity, surprise, project}) and `unassigned_candidates` ({title, excerpt, project, date}). Analyze and write to ~/.claude/obsidian-brain/emerge-analysis.md with EXACTLY these sections:\n\n## Growing Themes\nThemes with high activation / recent member growth — momentum.\n\n## Decaying Themes\nThemes with low activation / stale members — fading from focus.\n\n## Cross-Project Connections\nThemes whose members span multiple projects, or shared themes between projects. SKIP this section entirely if there is only 1 project.\n\n## Contradictions\nTensions or reversals across themes. Highlight members with high `surprise` values (they diverged from their theme centroid).\n\n## New Candidates\nProto-themes hinted by the `unassigned_candidates` — clusters of related unassigned notes not yet consolidated.\n\nFor each item: a descriptive name, 2-3 references (theme names or note titles), and a confidence (strong/moderate/tentative).\n\nIMPORTANT: Output ONLY the `##` section content as the note body — do NOT add YAML frontmatter, a top-level `#` title, or any `---` delimiter line. The note's frontmatter and title are added separately by run_build_note; any frontmatter you add would be embedded into the body and produce a malformed double-frontmatter note.\n\nWrite using the Write tool. Return ONLY: WRITTEN:~/.claude/obsidian-brain/emerge-analysis.md"
})
If no WRITTEN: response, report failure and stop. Mark task #2 completed.
cd '<REPO_ROOT>'
python3 -c '
import glob, json, os, re, sys
def _ob_hooks():
try:
for _m in json.load(open(os.path.expanduser("~/.claude/plugins/known_marketplaces.json"))).values():
_s = _m.get("source") if isinstance(_m, dict) else None
if not (isinstance(_s, dict) and _s.get("source") == "directory"):
continue
_i = _m.get("installLocation") if isinstance(_m, dict) else None
if not (isinstance(_i, str) and os.path.isabs(_i)):
continue
_h = os.path.join(_i, "hooks")
if os.path.isfile(os.path.join(_h, "obsidian_utils.py")):
return _h
except Exception:
pass
_c = [_d for _d in glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")) if re.fullmatch("[0-9]+([.][0-9]+)*", _d.split("/")[-2])]
return max(_c, key=lambda _p: ([int(_n) for _n in _p.split("/")[-2].split(".")], _p), default="hooks")
sys.path.insert(0, _ob_hooks())
from emerge_cli import run_build_note; run_build_note()
' 2>&1
Parse SAVED:<path> and everything after ---REPORT---. Mark tasks #3-#4 completed.
Display report prefixed with Pattern Discovery Results:. Confirm saved path. Mark task #5 completed.
Then add a section "Lessons growing in this window" (shown in the conversation, not saved in the note). Read the lessons:
cd '<REPO_ROOT>'
HOOKS=$(python3 -c "
import glob, json, os, re
def _ob_hooks():
try:
for _m in json.load(open(os.path.expanduser('~/.claude/plugins/known_marketplaces.json'))).values():
_s = _m.get('source') if isinstance(_m, dict) else None
if not (isinstance(_s, dict) and _s.get('source') == 'directory'):
continue
_i = _m.get('installLocation') if isinstance(_m, dict) else None
if not (isinstance(_i, str) and os.path.isabs(_i)):
continue
_h = os.path.join(_i, 'hooks')
if os.path.isfile(os.path.join(_h, 'obsidian_utils.py')):
return _h
except Exception:
pass
_c = [_d for _d in glob.glob(os.path.expanduser('~/.claude/plugins/cache/*/obsidian-brain/*/hooks')) if re.fullmatch('[0-9]+([.][0-9]+)*', _d.split('/')[-2])]
return max(_c, key=lambda _p: ([int(_n) for _n in _p.split('/')[-2].split('.')], _p), default='hooks')
print(_ob_hooks())
")
if ! test -f "$HOOKS/retro_rollup.py"; then echo "ERROR: retro_rollup.py not found under $HOOKS - verify the obsidian-brain install resolved there is complete (git pull for a directory-source checkout, or /plugin marketplace update for a cache install), then retry." >&2; exit 1; fi
python3 "$HOOKS/retro_rollup.py" report --json < /dev/null
Read the lessons only from report --json, never from the state file. The window starts $DAYS days before today and includes its start date. Keep lessons with sessions of at least 2 and at least one members[].date inside the window. Sort by the number of members dated inside the window (most first), keep 10, and print one line each: <name> · <members in window> new items · <sessions> sessions · <tracking_ref or "no tracking">. If none qualify, or the command fails, print "No lessons grew in this window." and move on.
/consolidate first or widen the window (/emerge 90d) — see Step 1./obsidian-setup first.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub abhattacherjee/obsidian-brain --plugin obsidian-brain21 skills in this plugin
/check-itemsTriage open `- [ ]` items across your Obsidian vault with evidence-grounded AI classification. Auto-closes items shipped by merged PRs, surfaces items needing external action (e.g. `gh issue close`), hides stale items by default. Replaces the old token-overlap heuristic with a two-pass AI pipeline backed by a persistence cache. Use when: (1) sweeping a project for done work, (2) auditing what's still actionable, (3) recovering from /recall deferral fatigue./compressInteractively saves curated insights from the current Claude Code session to the Obsidian vault. Use when: (1) /compress command to save session insights, (2) /compress <topic> to extract a specific topic, (3) user wants to capture decisions, patterns, solutions, or error fixes from the current session./Other plugins' skills for the same job