Skip to main content
skill CX Codex

session-brain — Claude Code skill: what it does, how to install

Builds an interactive topic graph over Claude Code session history without touching your vault. Useful for clustering past sessions and spotting active or dormant work topics.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Ar9av/obsidian-wiki --skill session-brain -a claude-code
Open on GitHub

What session-brain does

The skill maps topics across Claude Code session history using local clustering. It outputs files into a sidecar directory at ~/.claude/session-brain/. Your notes vault remains completely untouched. Deterministic Python inside the obsidian-wiki CLI performs the clustering, edge calculations, and HTML export.

The skill strictly requires the obsidian-wiki CLI to function. A cold build takes roughly 3 seconds across 1000 sessions, while incremental runs re-read only modified transcripts. The agent names clusters in a single step using top terms and exemplars, without loading full conversation logs. Cluster names survive rebuilds because they are stored by vocabulary rather than shifting cluster IDs.

The resulting browser graph displays topic momentum, dormant areas, and bridge sessions linking separate topics. Roughly 40% of an older cache may exist only as prompt entries in history.jsonl. The tool plots these history-only entries as hollow rings.

What it helps with

  • cluster agent session history locally without vault writes
  • spot dormant topics and recent activity spikes
  • view an interactive session graph in the browser via graph.html
  • identify bridge sessions connecting separate work topics

Example prompts for the agent

  • Build the session graph and summarize the biggest topics
  • Rebuild the session graph with --full and open the browser visualization
  • Check unnamed session clusters and assign names based on top terms

How to install session-brain

1Skills CLI (Vercel)

npx skills add Ar9av/obsidian-wiki --skill session-brain -a claude-code

2Manually: put the files in place

~/.claude/skills/session-brain/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/session-brain/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about session-brain

How to install session-brain in Claude Code?

Run npx skills add Ar9av/obsidian-wiki --skill session-brain -a claude-code.

What does the session-brain skill do?

It uses the obsidian-wiki CLI to cluster session history and generates an interactive HTML graph at ~/.claude/session-brain/. Unlike vault ingest tools, it indexes raw transcripts directly and never modifies vault files.

What are history-only sessions on the graph?

They are sessions preserved only as prompt lines in history.jsonl without full transcripts, making up roughly 40% of a long-lived cache. The graph renders them as hollow rings; you can locate them, but their full text cannot be reloaded.

Source text

SKILL.md · MIT
---
name: session-brain
description: >
  Build or refresh a browser-viewable topic graph over Claude session history using local clustering. Use for mapping or clustering sessions, recent or stale topic analysis, or rebuilding/showing the session graph. Unlike wiki-history-ingest, it indexes raw sessions and never writes to the vault.
---

# Session Brain

Builds a searchable topic graph over your agent session history. The output is a **sidecar**
at `~/.claude/session-brain/` — the vault is never touched.

All the heavy lifting is deterministic Python in the `obsidian-wiki` CLI. Your only job is to
name the clusters, which takes exactly one turn and requires reading no transcripts.

## When to use which skill

| Goal | Skill |
|---|---|
| Build or refresh the graph; survey topics | `session-brain` (this one) |
| Find and load a specific past session | `session-search` |
| Distil sessions into permanent vault pages | `wiki-history-ingest` / `claude-history-ingest` |

## Step 1: Build

```bash
obsidian-wiki sessions-build --json
```

Roughly 3 seconds cold on ~1000 sessions, well under a second incrementally — it re-reads only
transcripts whose size or mtime changed. Useful flags:

| Flag | When |
|---|---|
| `--full` | Ignore all caches and re-read everything |
| `--mutual` | Tighter, smaller clusters (mutual-kNN edges only) |
| `--half-life N` | Change the recency half-life (default 90 days) |
| `--min-sim 0.15` | Fewer, stronger edges — use if the graph is too dense to read |
| `--skip name` | Exclude a project. Match is substring-based; pass the bare name, because cache dirs start with `-` and argparse reads that as a flag |

Report the headline numbers: total sessions, how many have transcripts vs. are history-only,
edges, and cluster count.

## Step 2: Name the unnamed clusters

```bash
obsidian-wiki sessions-clusters --unnamed --json
```

Each cluster comes with `top_terms` and `exemplars` (its three highest-degree sessions, whose
titles are already in `graph.json`). **That is all you need.** Do not open transcripts to name a
cluster — the whole design goal is that naming costs one turn regardless of corpus size.

Write a 3–5 word `name` and a one-sentence `summary` per cluster, then:

```bash
obsidian-wiki sessions-name --from - <<'EOF'
[{"id": 3, "name": "warden telemetry pipeline", "summary": "Building and debugging the redacted telemetry chain."}]
EOF
```

Names are stored in `names.json` keyed by the cluster's dominant vocabulary, not its id — so they
survive rebuilds even though cluster ids are positional and shift as the corpus grows. On repeat
runs `--unnamed` is usually empty and this step is free.

If a cluster's terms are genuinely incoherent, name it honestly (`"mixed — short sessions"`)
rather than inventing a theme.

## Step 3: Report the map

Read `clusters.json` and tell the user:

- **Biggest topics** — by `size`
- **What's hot** — highest `momentum` (activity in the last 30 days vs. the 60 before it)
- **What's gone quiet** — `dormant: true` (low recency *and* nothing in 60 days)
- **Where topics meet** — `bridges`, the sessions that connect two otherwise separate topics.
  These are often the most interesting sessions in the graph.

Then offer the visualisation:

```bash
open ~/.claude/session-brain/graph.html
```

Node size is session length, brightness is recency, hollow rings are history-only sessions, and
gold borders are bookmarked ones. The time slider and search box filter together.

## Notes

- **Never write to the vault** from this skill. If the user wants session knowledge in the vault,
  that is `wiki-history-ingest`.
- **History-only sessions are real.** Roughly 40% of a long-lived cache exists only as prompts in
  `history.jsonl`; those get graph nodes and are findable, but can never be loaded. Say so plainly
  rather than implying they are missing.
- The graph is derived data. If it looks wrong, `--full` rebuilds from scratch; nothing is lost.

© Ar9av · MIT · Ar9av/obsidian-wiki

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set38

wiki-context-pack Extracts a token-capped, citation-ready slice of an Obsidian vault for downstream agents. Helpful when an assistant needs targeted context without parsing whole vaults. CX Codex +1 1,600installs wiki-stage-commit Reviews LLM-written pages sitting in _staging/ and promotes the accepted ones into the live wiki. Only runs when WIKI_STAGED_WRITES=true. CX Codex +1 1,500installs pi-history-ingest Distills Pi coding agent session history into Obsidian notes from JSONL logs. Useful when you need to turn raw terminal conversations into reusable wiki records. CX Codex +1 1,200installs wiki-import Rebuilds wiki pages in the current Obsidian vault from graph.json or an OKF bundle. Useful when moving previously exported content between vaults. CX Codex +1 986installs vault-skill-factory Turns mature curated wiki pages into a portable Agent Skill package and writes it to a review directory. Installing stays your call. CX Codex +1 719installs obsidian-layout-adjustment A skill that restyles Obsidian through CSS snippets: it maps a plain description of an element to the right UI layer, patches the active snippets and checks the result on a screenshot. CX Codex +1 435installs wiki-narrate Creates a cited briefing, plain explanation, or lecture strictly from Obsidian vault notes. Useful when you need factual topic readouts without model hallucination. CX Codex +1 366installs session-search Searches a session-brain graph for past agent conversations and loads the relevant transcript into the active prompt. Useful when retracing earlier work. CX Codex +1 319installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor