skills

Historical Search

Use search when you remember something discussed in a session. It searches local historical evidence and returns ranked candidates. A candidate is a place to investigate; it does not establish the current session or a complete index of everything on the machine.

Find a session

Patterns are case-insensitive regular expressions by default. Use --literal when you want the exact text rather than regex syntax.

seshtk search -p 'deployment.*failed' --runtime codex --cwd /path/to/project --json
seshtk search -p 'release checklist' --literal --since 7d --json
OptionEffect
-p, repeatedSupplies multiple search patterns.
--runtimeChooses claude-code, codex, cursor, or auto (the default).
--cwd, repeatedStarts in these directories; widens to other sessions if no matches are found.
--since / --untilBounds the search in time.
--tiersSelects from history,meta,content; selected tiers keep that order.
--include-toolsSearches full recorded tool text in the content pass.
--no-deepDisables the fallback pass over tool output.

Directory hints are starting points, not strict filters. The result's widened field tells you whether the search went beyond them.

Time bounds accept 24h, 7d, 2w, today, yesterday, calendar dates, and ISO date-times. An upper calendar date includes the whole local day. Prefer zoned ISO times in automation.

How the search widens

The selected tiers run from less expensive sources to transcript content:

TierEvidence searched
historyRecorded prompt history.
metaAvailable session titles and index or database metadata.
contentClassified user and assistant text in transcripts.
Tool-output fallbackRecorded tool fields, when earlier passes find nothing and deep search is enabled.

--include-tools includes tool text immediately. Otherwise the final tool-output pass is a fallback; --no-deep disables it. Search matches the original text, including full tool fields when enabled, rather than shortened read previews.

Large scans and limits

Estimate candidate files and bytes before authorizing an expensive content scan:

seshtk search estimate -p 'deployment.*failed' --runtime codex --json
LimitDefaultChange it with
Returned sessions15--limit
Decoded line size65,536 bytes--max-line-bytes
Scan authorization threshold2,147,483,648 estimated bytes (2 GiB)--large-scan-bytes
DeadlineNone--deadline-ms

A scan over the threshold produces E_SCAN_CONFIRMATION and exits 1. The error details include the estimate, source reports, and any partial results. It never prompts. After reviewing and authorizing the size, rerun the search with --allow-large-scan.

Limits can leave results incomplete. A deadline returns the evidence collected so far; malformed records and oversized lines are skipped and reported.

Interpret results and privacy

Inspect these fields before drawing conclusions from either matches or an empty result:

FieldWhat it tells you
resultsRanked matching sessions and redacted snippets.
tiersRunWhich passes actually ran.
widenedWhether directory hints were widened.
incompleteWhether source gaps or limits prevented full coverage.
sourcesEach source's availability, degraded status, and explanatory notes.
diagnosticsScan counts, parse errors, oversized lines, and elapsed time.

History and index read failures appear in source notes and mark affected sources degraded. Malformed or oversized transcript records appear in content-scan diagnostics and set incomplete; they may leave source notes and source status unchanged. An empty search returns exit 0; it does not prove a session never existed or that all sources were readable.

Redaction runs on each whole text item before a snippet window is selected. Matching uses the original text, so a result can match text hidden in its snippet. Treat raw transcripts separately as sensitive data. See the CLI reference for the enclosing response and errors.

Optional accelerators

rg and sqlite3 are optional. The toolkit looks for them on PATH and in common system locations. Without rg, Node still searches transcripts. Unavailable SQLite metadata is reported where applicable.

Environment variableUse
SESHTK_SEARCH_NO_RG=1Disable rg.
SESHTK_SEARCH_NO_SQLITE3=1Disable sqlite3.
SESHTK_SEARCH_RGSet an explicit rg executable path.
SESHTK_SEARCH_SQLITE3Set an explicit sqlite3 executable path.
SESHTK_SEARCH_PROBE_TIMEOUT_MSSet the tool-probe timeout; default 3000 ms, clamped to 500–60000 ms.

Library callers use searchSessions and estimateSearch with the same stateless operations. Their home and env options support isolated stores; see the library reference.

On this page