Skip to main content
skill CX Codex

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

Searches a session-brain graph for past agent conversations and loads the relevant transcript into the active prompt. Useful when retracing earlier work.

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

What session-search does

The skill searches past agent sessions using the obsidian-wiki sessions-query CLI. Scoring balances four signals: TF-IDF cosine similarity, cluster lift, human bookmark boosts, and a 90-day time decay half-life. Because of cluster lift, a session surfaces even when the target query term was never mentioned word-for-word.

Matches appear in a compact table showing project, date, topic, and match rationale. To load context, the skill picks at most 3 eligible session IDs. It first checks for claude-session-load or bookmark-load inside ~/.claude/skills/. If those are absent, it reads files via obsidian-wiki sessions-show or extracts human messages with an inline Python script.

A pre-built graph.json is mandatory; without it, the tool exits with code 1. If the graph is older than roughly 7 days, the skill suggests a rebuild without running it unprompted. For entries marked loadable: false, the transcript was deleted from disk, so the agent synthesizes answers strictly from surviving prompt text.

What it helps with

  • find past agent sessions covering a specific topic
  • load earlier conversation transcripts into the current chat
  • check when a feature or task was last touched
  • extract human prompts from multi-megabyte JSONL session files

Example prompts for the agent

  • Which past session handled the telemetry setup?
  • Find when we last worked on the auth service and pull in that transcript
  • Search previous sessions for database migration steps

How to install session-search

1Skills CLI (Vercel)

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

2Manually: put the files in place

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

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

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

Questions about session-search

How to install session-search in Claude Code?

Run npx skills add Ar9av/obsidian-wiki --skill session-search -a claude-code in your terminal.

What does session-search do?

It queries the session-brain graph for topics discussed in earlier sessions, ranks the hits, and loads their transcripts into your active conversation.

What happens if a transcript was pruned from disk?

Entries marked loadable: false are history-only. The skill states that the full transcript is gone and relies exclusively on surviving prompt text.

Source text

SKILL.md · MIT
---
name: session-search
description: >
  Search the session-brain graph for a past agent session by topic and load the winning transcript into the current conversation. Use for finding which session handled X, when Y was last worked on, or whether this was done before. Read-only; requires a session-brain graph.
---

# Session Search

Answers "which of my past sessions was about X" and then pulls that session's context in.

## Step 1: Check the graph exists and is fresh

```bash
obsidian-wiki sessions-query "<topic>" --json
```

If this exits 1 with "run sessions-build first", tell the user and offer `/session-brain`. If
`graph.json` is more than ~7 days old, mention it and offer a rebuild — but **do not silently
rebuild**, since that is a multi-second operation the user did not ask for.

## Step 2: Rank

The scoring already combines four signals, so take the ordering as given rather than re-ranking:

- **similarity** — TF-IDF cosine against the session's text
- **cluster lift** — a session inside the best-matching topic scores higher even if its own words
  never matched. This is why a session that never said "telemetry" can still surface for it.
- **bookmark boost** — a human already flagged this session as worth keeping
- **time decay** — 90-day half-life, applied with a floor so an old exact match still outranks a
  fresh weak one

Useful filters: `--project NAME`, `--cluster N`, `--since DATE`, `--top N`.

## Step 3: Present

Show the top ~5 as a compact table — title, project, date, topic, and the `why` string, which
already explains the match. Do not dump the raw JSON at the user.

Two things must be stated honestly rather than glossed over:

- Entries with `loadable: false` are **history-only**: the transcript has been pruned from disk
  and only the prompts survive. They are listed in `unloadable` with a reason. Say the transcript
  is gone; do not imply it can be retrieved.
- If everything relevant is unloadable, answer from the prompt text that *is* there and say that
  is all that remains.

## Step 4: Load — hand off, do not reimplement

`should_load` holds at most 3 session ids worth opening, already filtered to ones with
transcripts.

**Prefer an existing loader skill if the user has one installed:**

- `claude-session-load` — loads a Claude session by id
- `bookmark-load` — use when the hit is bookmarked

⚠️ Those skills live in the user's personal skills directory (`~/.claude/skills/`), **not in this
repo**. They may not exist. Do not assume them and do not error if they are absent — fall back to
reading the transcript directly:

```bash
# the path is in the query result as `transcript`
obsidian-wiki sessions-show <session-id> --pretty
```

The transcript is JSONL and can be tens of MB. **Never read one whole.** Filter to the human turns
first:

```bash
grep -c '' <transcript>   # size check before anything else
python3 -c "
import json,sys
for line in open(sys.argv[1], errors='replace'):
    try: r = json.loads(line)
    except ValueError: continue
    if r.get('type')=='user' and not r.get('isSidechain') and not r.get('isMeta'):
        c = (r.get('message') or {}).get('content')
        if isinstance(c,str) and not c.lstrip().startswith('<'): print('>', c[:400])
" <transcript>
```

## Step 5: Answer

Synthesise from what you loaded and cite the session ids you used. If the answer came from a
history-only session's prompts rather than a real transcript, say so — the user needs to know how
much of the context you actually have.

## Related

- `/session-brain` — build or refresh the graph, survey and name topics
- `wiki-query` — search compiled vault knowledge; this skill searches raw session history instead
- `wiki-agent` — pull a topic out of *another* agent's history and distil it into the vault

© 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-brain 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. CX Codex +1 316installs

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