session-brain

session-brain is a skill for Claude Code, Codex from Ar9av/obsidian-wiki. It costs 153 tokens per session (1,085 once invoked), scanned A, original, MIT.

A local tool that builds a searchable graph of topics found in past Claude coding-agent sessions.

In plain words
What is it for?
Use it to build or refresh the session graph and group older sessions by topic; use session-search instead when looking for one specific session.
Why use it?
It helps you survey previous work without manually reading every transcript, while keeping the graph outside the Obsidian vault.

Skill for Claude CodeCodex

About the project

obsidian-wiki is a framework that helps AI agents build and maintain an interconnected knowledge base from text-based material in an Obsidian vault. It is for people who want their agents to remember discoveries, connect related information, and answer questions with wiki-link citations. Catalogue add-ons provide the agent skills, instructions, agents, and configuration used to create and maintain these wikis.

Ar9av/obsidian-wiki · 3,348 stars · on GitHub

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 skills/ar9av/obsidian-wiki/session-brain
Any agent
npx skills add Ar9av/obsidian-wiki --skill session-brain
Clone the repo
git clone --depth 1 https://github.com/Ar9av/obsidian-wiki

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-brain

README.md
[![agentmods](https://agentmods.dev/badge/skills/ar9av/obsidian-wiki/session-brain.svg)](https://agentmods.dev/skills/ar9av/obsidian-wiki/session-brain)
Your own site
<a href="https://agentmods.dev/skills/ar9av/obsidian-wiki/session-brain"><img src="https://agentmods.dev/badge/skills/ar9av/obsidian-wiki/session-brain.svg" alt="Measured on agentmods" height="20"></a>
Per session 153 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,085 The whole file, excluding the scripts and references it only reads on demand.
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.00153 $0.01085
Opus 5 $0.00077 $0.00543
Sonnet 5 $0.00031 $0.00217
Haiku 4.5 $0.00015 $0.00109

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

Security

Grade A, and why

session-brain 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 5d 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.

.skills/session-brain/SKILL.md · 102 lines

How it starts

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

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

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

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:

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

Read the full file on GitHub · 102 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. 5d ago First seen · 102 lines · 153 tokens per session scan A e72dc2189e2c

Subscribe to this mod's changes

session-brain is a skill published in the GitHub repository Ar9av/obsidian-wiki (3,348 stars, last pushed 2d ago), licensed MIT. It adds 153 tokens to every session and 1,085 once invoked, about $0.0008 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.

Related

Other skills, from other repositories