New to Claude Skills? Learn how to install them →

danielmiessler on GitHub

Context Search

Free

Quickly find prior work by topic or date.

Get this skill

Free · Opens the source repo

What Context Search does

ContextSearch is a skill designed to help users quickly locate previous work sessions, ISAs, and conversations within the LifeOS framework. By leveraging a deterministic Bun CLI, it enables searches across multiple sources simultaneously, scoring results based on token overlap and recency. This functionality is particularly useful for users who have a wealth of work spread across various sessions and need to recall specific details without having to sift through everything manually.

The skill processes queries that can include partial words or date phrases such as 'yesterday' or 'last week', making it easier to find relevant information based on memory cues rather than exact titles. This is crucial for maintaining productivity, as it allows users to pick up where they left off without wasting time trying to remember exact project names or details.

ContextSearch is particularly beneficial for developers and designers who frequently engage in iterative work and need to reference prior projects or discussions. It streamlines the process of retrieving context, allowing users to focus on their current tasks rather than getting bogged down in searching through extensive logs or records. The output is formatted for easy reading, providing snippets and relevant details that help users quickly assess the context of their previous work.

However, it's important to note that ContextSearch is not designed for searching published content such as blog posts or newsletters. Its focus is strictly on internal work history, making it ideal for personal project management and session recall but unsuitable for broader content discovery.

When to use it

This skill is best used when you need to recall past work sessions or conversations, particularly when you have partial information or specific date references.

When not to use it

ContextSearch is not suitable for searching external published content or for users who need to find information outside their own work history.

What you can build with it

Recalling a Recent Project

You need to remember details about a project you worked on last week. Use ContextSearch to quickly find the relevant session and pick up where you left off.

Finding Previous Conversations

During a team meeting, you want to reference a past discussion. ContextSearch allows you to locate that conversation efficiently by searching for key terms.

Reviewing Past ISAs

Before starting a new task, you want to review your previous ISAs related to a similar project. ContextSearch helps you retrieve those insights without hassle.

How to install Context Search

View source

1. Install with the skills CLI

npx skills add danielmiessler/lifeos/ContextSearch --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by danielmiessler

ContextSearch

Customization

Before executing, check for user customizations at: ~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/ContextSearch/

If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.

What It Does

Finds prior LifeOS work — sessions, ISAs, conversations — by topic, partial words, or date phrases like "yesterday" or "last week". A deterministic Bun CLI searches five sources in parallel, scores by token-overlap times recency, applies date filters, and returns ranked results with snippets.

The Problem

Work spreads across sessions, ISAs, and conversation logs, and a week later you can't remember where a project lived or what it was called. Substring search misses it because you remember the gist, not the exact title. You need to recall half-remembered work fast — by a few words, or by "the thing I did yesterday" — and pick up where you left off without rereading everything by hand.

How It Works

Search prior work for: $ARGUMENTS

The skill body delegates to a deterministic Bun CLI. The tool searches five sources in parallel, scores by token-overlap × recency, applies date filters, and returns ranked results.

Workflow Routing

Single-tool skill — no Workflows/ directory. Every invocation routes to the one CLI:

WorkflowTriggerFile
Search (inline)context search, /cs, prior work, recall, find session, resume, date phrasesTools/ContextSearch.ts

Run the search

bun run ~/.claude/skills/ContextSearch/Tools/ContextSearch.ts "$ARGUMENTS" --pretty --limit 10

The tool auto-detects TTY for output mode; explicit --pretty keeps the human-readable block when the skill is invoked from inside a Claude Code session (where stdout is not a true TTY). Pipe to --json for structured output to jq.

Useful flag patterns

# Limit results
bun run ~/.claude/skills/ContextSearch/Tools/ContextSearch.ts "$ARGUMENTS" --limit 5

# Constrain by date
bun run ~/.claude/skills/ContextSearch/Tools/ContextSearch.ts "$ARGUMENTS" --since 2026-05-01

# JSON for programmatic use
bun run ~/.claude/skills/ContextSearch/Tools/ContextSearch.ts "$ARGUMENTS" --json | jq '.results[0]'

The tool also parses date phrases inline: "yesterday markdown" becomes a bounded since/until of yesterday only, plus token search for markdown.

Usage Modes

  1. Standalone — Run the search, present the pretty block, say: "Context loaded on [topic]. Most recent: [X]. What would you like to do?"
  2. Paired with request — Run the search first, then execute the request informed by found context. If a result's path looks promising, Read it for full detail.

Output shape

The pretty block:

═══ CONTEXT: <query> ═══════════════════════

📋 RESULTS (N, newest+best first):
  • <slug>
    task: ... | phase: ... | progress: ... | effort: ... | <recency>d ago | score: ... | sources: ...
    ↳ "<snippet from matched source>"
    <path to ISA or jsonl>

Searched: work.json=N, names=N, dirs=N, isa=N, jsonl=N
════════════════════════════════════════════════

JSON: { query, cleaned_query, tokens, since, until, stats, results: [{ source[], slug, sessionUuid, name, task, phase, progress, effort, score, recencyDays, snippet, path }] }

Gotchas

  • Token-overlap scoring, not substring matching. Queries like markdown extended find sessions named Research Type Markdown Extended Images even though "markdown extended" is not a substring of that name. The query is tokenized (lowercase, [^a-z0-9]+ split, stopwords removed) and any candidate that shares ≥1 non-stopword token gets scored.
  • Date phrases are first-class. today, yesterday, day before yesterday, last week, last month, N days ago, and YYYY-MM-DD parse out of the query as bounded date filters; the remaining tokens still score against content. yesterday and today use single-day windows (since AND until); last week uses a 7-day rolling window.
  • JSONL-source date is the first user-message timestamp, not file mtime. Conversation jsonl files get touched whenever Claude Code re-reads them, so mtime drifts. The tool parses the first type:"user" line's timestamp to recover the actual session start date — that's what date filters compare against.
  • Search is restricted to the ~/.claude project's own conversation directory under ~/.claude/Projects/ for jsonl content (dir name derived from $HOME at runtime — path with / and . mapped to -). Other Claude project directories on the same machine are out of scope by design.
  • No persistent index. Every query rescans from disk. ripgrep over ~9k jsonl files completes in ~1s; total query latency is typically 1–2s, well within interactive perception. If a future scale change makes that unworkable, an opt-in cached index (e.g., per-jsonl first-user-timestamp + word-frequency map) is the v2.
  • Standalone vs paired. When the user invokes ContextSearch alone (/cs <topic>), present results and ask what they want to do. When invoked as a paired primer to an unrelated request, run the search silently and use the top results to anchor the answer — don't dump the search block into the response unless the user asked.
  • Session-names.json date is jsonl mtime (best-available fallback). Some session UUIDs don't appear in work.json or as MEMORY/WORK/ directories — they're conversation-only sessions whose only structural trace is the auto-generated name. For those, the tool uses jsonl mtime for recency. If the file's been re-read recently the date will skew newer than the actual conversation.

After Results

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

Paired: Proceed with the user's request, anchored by the top result's context. If deeper detail is needed, Read the specific path the tool returned.

Examples

Example 1: Resume work on a specific topic

User: "what did we do with the Telegram bot?"
→ bun run Tools/ContextSearch.ts "telegram bot"
→ Tokens [telegram, bot] hit work.json + ISA bodies + jsonl
→ Returns telegram-monitor-revival, fix-telegram-channels-plugin-broken, ranked by recency

Example 2: Find half-remembered session

User: "open up that test extended markdown document that you made yesterday"
→ bun run Tools/ContextSearch.ts "test extended markdown document yesterday"
→ Date phrase 'yesterday' parses out → since/until = 2026-05-07 only
→ Tokens [test, extended, markdown, document] hit jsonl content
→ Returns "Research Type Markdown Extended Images" session in top-3 with snippet

Example 3: Date-only browsing

User: "what did I work on last week?"
→ bun run Tools/ContextSearch.ts "last week"
→ Date phrase parses to since=7d-ago, no token filter
→ Returns all sessions from the past 7 days, newest first

Execution Log

After completing any workflow, append a single JSONL entry:

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

Frequently asked questions about Context Search

Similar skills