skills

CLI Reference

Use seshtk to inspect local session history from a terminal or script. Install Session Toolkit, then run seshtk <command> --help for the options supported by your installed version.

Choose a command

CommandPurposeMore detail
self-identifyCheck the exact current session using host and transcript evidence.Identity
listBrowse historical sessions by directory or time.Discovery
searchFind historical sessions from remembered text.Search
search estimateEstimate candidate files and bytes before searching content.Scan authorization
readRead a provider-qualified native session ID.Bounded reads
parseRead an explicit transcript file with a specified provider.Source coordinates
exportSave conversational Markdown to a new file or bounded batch.Export safety
activityCapture sensitive structured records and recorded tool activity.Activity
capabilitiesReport the installed version, providers, and supported operations.Capabilities

Replace SESSION_ID in examples with a native ID from a selected result. The prefix is one of claude-code, codex, or cursor.

seshtk self-identify --cwd /path/to/project --json
seshtk list --cwd /path/to/project --since 7d --json
seshtk search -p 'deployment failed' --literal --json
seshtk search estimate -p 'deployment failed' --literal --json
seshtk read --session 'codex:SESSION_ID' --max-records 100 --json
seshtk parse /path/to/transcript.jsonl --runtime cursor --max-bytes 4000000 --json
seshtk read --session 'codex:SESSION_ID' --evidence --json
seshtk activity --session 'codex:SESSION_ID' --json
seshtk activity --session 'claude-code:SESSION_ID' --out ./activity.json --json

Export accepts an exact session, a visible conversation marker, or a bounded batch. These selection modes have different ambiguity rules; see export safety.

seshtk export --session 'claude-code:SESSION_ID' --out ./conversation.md --json
seshtk export --cwd /path/to/project --match 'visible marker' --out ./match.md
seshtk export --cwd /path/to/project --all --out ./transcripts --json

Capabilities

Before an integration depends on a command or its output format, check the installed version and the capability IDs it requires:

seshtk --version
seshtk capabilities --json

The capability response includes data.version, data.providers, and data.capabilities. A package version alone does not establish that an operation is supported. The currently implemented IDs are:

OperationCapability ID
Capability discoverytoolkit.capabilities.v1
Help and version outputcli.help.v1, cli.version.v1
Exact current identityidentity.current.v1
Historical listingsessions.list.v1
Transcript reading and explicit-file parsingtranscript.read.v1, transcript.parse.v1
Codex cutoff and expansion evidencetranscript.evidence.codex.v1
Markdown exportexport.markdown.v1
Search and scan estimationsearch.v1, search.estimate.v1
Sensitive activity captureactivity.v1

The reported providers are claude-code, codex, and cursor. Exact evidence cutoffs and expansion support Codex only.

Machine output

Add --json to any command for exactly one newline-terminated response envelope. This includes help and version output. capabilities always uses this format.

{ "ok": true, "schema_version": 1, "data": {} }

Failures replace data with an error object containing code, message, hint, and optional details. Diagnostics go to stderr, leaving stdout for the single response.

Without --json, read and parse print conversation text; other operations print structured JSON. Running seshtk without arguments prints help. Commands never prompt or emit color. JSON and unattended invocations perform no update lookup.

Exit codes and errors

A successful exit means the result can be interpreted; inspect its coverage to learn whether it is complete.

ExitMeaning
0Successful result, including no search matches or partial source coverage.
1Any reported error except E_IO and E_INTERNAL.
2E_IO or E_INTERNAL.
Error codeWhat to inspect
E_USAGEOptions, arguments, and conflicting selection modes.
E_AMBIGUOUSMultiple matching sessions or conflicting identity evidence.
E_UNAVAILABLEMissing sources or insufficient evidence for the operation.
E_CURSOR_INVALIDA continuation or evidence token that does not fit the request.
E_SOURCE_CHANGEDA transcript changed since the captured read or token.
E_SCAN_CONFIRMATIONEstimated scan size; rerun with --allow-large-scan only after authorizing it.
E_IOSource and destination paths and permissions.
E_INTERNALAn unexpected failure; retain the installed version when reporting it.

self-identify succeeds only for authoritative identity. Other identity statuses produce an error whose details preserves the structured evidence. Library identity calls return the status for the caller to interpret.

Update notices

Successful interactive operations can check npm for a newer stable release. Both stdin and stderr must be TTYs. A notice goes to stderr and includes an explicit-version installation command; no automatic upgrade runs.

Control or conditionBehavior
SESHTK_NO_UPDATE_CHECK=1Disables checking.
--json, help/version, or capabilitiesNo update lookup or notice.
CI or non-TTY invocationNo update lookup or notice.
Library imports and functionsCannot invoke the CLI-only updater.
Cached lookupReused for 24 hours, including failed lookups.
Registry requestHas a 1-second timeout; only newer stable SemVer releases trigger a notice.

The cache is $XDG_CACHE_HOME/session-toolkit/update.json, falling back to ~/.cache/session-toolkit/update.json. Missing, malformed, or expired caches trigger a fresh lookup. Lookup and cache-write failures never fail the requested session operation; its stdout remains unchanged.

On this page