Agent Skills › Ar9av/obsidian-wiki › session-brain

session-brain

GitHub

构建基于本地聚类的会话历史主题图谱,支持集群命名与可视化。用于会话映射、话题分析及图谱重建,不修改主仓库。

.skills/session-brain/SKILL.md Ar9av/obsidian-wiki

触发场景

需要分析或可视化会话历史中的话题聚类 为未命名的会话集群生成标题和摘要 查看会话热度、休眠状态及跨话题连接

安装

npx skills add Ar9av/obsidian-wiki --skill session-brain -g -y
更多选项

非标准路径

npx skills add https://github.com/Ar9av/obsidian-wiki/tree/main/.skills/session-brain -g -y

不安装直接使用

npx skills use Ar9av/obsidian-wiki@session-brain

指定 Agent (Claude Code)

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

安装 repo 全部 skill

npx skills add Ar9av/obsidian-wiki --all -g -y

预览 repo 内 skill

npx skills add Ar9av/obsidian-wiki --list

SKILL.md

Frontmatter
{
    "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

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

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:

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.

版本历史

  • 5ae7837 当前 2026-10-18 22:05

    缩短描述以提升路由效率

  • 4bf87a8 2026-07-31 07:12

同 Skill 集合

.skills/claude-history-ingest/SKILL.md
.skills/code-understand/SKILL.md
.skills/codex-history-ingest/SKILL.md
.skills/copilot-history-ingest/SKILL.md
.skills/cross-linker/SKILL.md
.skills/daily-update/SKILL.md
.skills/graph-colorize/SKILL.md
.skills/hermes-history-ingest/SKILL.md
.skills/impl-validator/SKILL.md
.skills/llm-wiki/SKILL.md
.skills/memory-bridge/SKILL.md
.skills/obsidian-layout-adjustment/SKILL.md
.skills/openclaw-history-ingest/SKILL.md
.skills/pi-history-ingest/SKILL.md
.skills/session-search/SKILL.md
.skills/skill-creator/SKILL.md
.skills/tag-taxonomy/SKILL.md
.skills/vault-skill-factory/SKILL.md
.skills/wiki-agent/SKILL.md
.skills/wiki-capture/SKILL.md
.skills/wiki-context-pack/SKILL.md
.skills/wiki-dashboard/SKILL.md
.skills/wiki-dedup/SKILL.md
.skills/wiki-digest/SKILL.md
.skills/wiki-export/SKILL.md
.skills/wiki-history-ingest/SKILL.md
.skills/wiki-import/SKILL.md
.skills/wiki-ingest/SKILL.md
.skills/wiki-lint/SKILL.md
.skills/wiki-narrate/SKILL.md
.skills/wiki-query/SKILL.md
.skills/wiki-rebuild/SKILL.md
.skills/wiki-research/SKILL.md
.skills/wiki-setup/SKILL.md
.skills/wiki-stage-commit/SKILL.md
.skills/wiki-status/SKILL.md
.skills/wiki-switch/SKILL.md
.skills/wiki-synthesize/SKILL.md
.skills/wiki-update/SKILL.md

元信息

文件数
0
版本
5ae7837
Hash
f1239b76
收录时间
2026-07-31 07:12

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-20 20:36
浙ICP备14020137号-1