Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
danielmiessler avatar

Contextsearch

  • 35 installs
  • 17.2k repo stars
  • Updated August 1, 2026
  • danielmiessler/personal_ai_infrastructure

Two-phase search across a PAI session registry, work directories, and ISAs for cold-start recovery of prior sessions and context.

About

Scans a session registry, session names, work directories, and ISA titles in parallel, then falls back to git history, returning a compact context block of recent sessions. Developers use it to recall prior work and pick up where they left off.

  • Parallel Phase-1 index scan with git-history Phase-2 fallback
  • Compact under-40-line context block with session slugs and ISA paths

Contextsearch by the numbers

  • 35 all-time installs (skills.sh)
  • Ranked #1,773 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/danielmiessler/personal_ai_infrastructure --skill contextsearch

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs35
repo stars17.2k
Last updatedAugust 1, 2026
Repositorydanielmiessler/personal_ai_infrastructure

What it does

Two-phase search across a PAI session registry, work directories, and ISAs for cold-start recovery of prior sessions and context.

Files

SKILL.mdMarkdownGitHub ↗

ContextSearch

Search prior work for: $ARGUMENTS

Usage Modes

1. Standalone — Search, present findings, say: "Context loaded on [topic]. Most recent session: [X]. What would you like to do?" 2. Paired with request — Search first, then execute the request informed by context.

---

Phase 1 — Fast Index Scan (ALL IN PARALLEL)

Run all four searches simultaneously in a single response:

1A. Session Registry Read ~/.claude/PAI/MEMORY/STATE/work.json. Match entries where task, slug (object key), or sessionName contains "$ARGUMENTS" (case-insensitive). Extract: task, phase, progress, effort. Limit to 5 most recent matches.

1B. Session Names Read ~/.claude/PAI/MEMORY/STATE/session-names.json. Match entries where name contains "$ARGUMENTS" (case-insensitive). Extract: sessionId, name. Limit to 5 most recent.

1C. Work Directory Names

fd -t d -i "$ARGUMENTS" ~/.claude/PAI/MEMORY/WORK/ --max-depth 1 | tail -10

1D. ISA Title Grep Use Grep to search for "$ARGUMENTS" across ~/.claude/PAI/MEMORY/WORK/ with glob **/ISA.md. Use files_with_matches mode. Limit to 5 results.

---

Phase 2 — Conditional Deep Dive

SKIP Phase 2 entirely if Phase 1 returned 3+ matches. Phase 1 is usually sufficient.

Only if Phase 1 returned fewer than 3 total matches, run in parallel:

2A. PAI Git History

git -C ~/.claude log --oneline --all --grep="$ARGUMENTS" -i -10

2B. Current Project Git History

git log --oneline --all --grep="$ARGUMENTS" -i -10

---

After Search: Load ISA Summaries (NOT full ISAs)

From Phase 1C/1D matches, identify the 3 most recent ISAs (by directory date prefix). Read only the first 10 lines of each (title + summary). Do NOT read full ISAs — the main agent can request a full read if needed.

---

Output Format

Compact single list. Omit sections with no results. Keep total output under 40 lines.

═══ CONTEXT: $ARGUMENTS ═══════════════════════

📋 SESSIONS (newest first, max 5):
  - [slug] — [task] | [phase] | [progress]

📂 ISA SUMMARIES (max 3):
  - [dir name]: [first heading from ISA]
    Path: ~/.claude/PAI/MEMORY/WORK/[dir]/ISA.md

🔗 COMMITS (if Phase 2 ran):
  - [hash] [message] ([repo])

════════════════════════════════════════════════

---

After Results

Standalone: "Context loaded on [topic]. Most recent: [X]. What would you like to do?"

Paired: Proceed with the request. If deeper context is needed, Read the specific ISA path shown above.

Gotchas

  • Searches PAI session registry, work directories, and ISAs — not published content (use _CONTENTSEARCH for that).
  • Phase 1 (fast scan) may miss relevant sessions. If results seem incomplete, use phase 2 (full search).
  • Session descriptions in work.json are AI-generated summaries. They may not capture every topic discussed.

Examples

Example 1: Find prior work

User: "what did we do with the Telegram bot?"
→ Phase 1: fast scan of session registry
→ Finds sessions: telegram-monitor-revival, fix-telegram-channels-plugin-broken
→ Returns session summaries with ISA links

Example 2: Resume previous work

User: "pick up where we left off on the feed system"
→ Searches work directories and ISAs
→ Finds latest ISA with phase/progress state
→ Provides context for cold-start recovery

Execution Log

After completing any workflow, append a single JSONL entry:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"ContextSearch","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/PAI/MEMORY/SKILLS/execution.jsonl

Replace WORKFLOW_USED with the workflow executed, 8_WORD_SUMMARY with a brief input description, and SECONDS with approximate wall-clock time. Log status: "error" if the workflow failed.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.