cass

DocsSearch

Key Features

On this page

Instant Search (Sub-60ms Latency)#

  • "Search-as-you-type": Results update instantly with every keystroke.
  • Edge N-Gram Indexing: We frontload the work by pre-computing prefix matches (e.g., "cal" -> "calculate") during indexing: 2–20 character prefixes of every word in titles and in the first 4 KiB of each message, trading disk space for fast lookup at query time.
  • Smart Tokenization: Handles snake_case ("my_var" matches "my" and "var"), hyphenated terms, and code symbols (c++, foo.bar) correctly.
  • Zero-Stall Updates: The background indexer commits changes atomically; reader.reload() ensures new messages appear in the search bar immediately without restarting.
  • One-shot CLI overhead: the sub-60ms figure is the engine query. A one-shot cass search --robot currently spends roughly a second in archive open and integrity preflight on a ~10 GB archive; --robot-meta reports that separately as _meta.timing.other_ms, while search_ms stays in the tens of milliseconds.

Optional Semantic Search (Local by Default)#

  • Local inference: Uses frankensearch's pure-Rust native MiniLM implementation with local safetensors weights. Once MiniLM is installed, no network traffic is required to answer queries.

  • Warm-daemon reuse: Semantic and hybrid CLI searches automatically use an already-running local embedding daemon (including a socket selected with CASS_DAEMON_SOCKET) and only initialize the installed in-process model if daemon inference fails. Pass --daemon to permit auto-spawning a missing daemon in human-mode searches (robot/JSON searches never spawn one, even with --daemon, because their bounded budget cannot wait for a daemon to start; start cass daemon yourself first; _meta.effective.daemon shows the request and what applied), or --no-daemon to force direct inference. --fast-only stays in the deterministic hash-vector space. Each data directory gets a distinct default socket and owner-private pinned key; fresh handshake, health, embedding, batch, and rerank challenges authenticate the exact response and immutable Frankensearch embedding identity before any daemon output is used. --two-tier progressive refinement (fast results refined in place by the quality tier) is experimental and currently inactive: the one-shot CLI collapses it to a single-tier quality search and the TUI's progressive lanes are disabled at HEAD, so hybrid search today is lexical plus one MiniLM refinement pass when the model is installed.

  • Opt-in acquisition: cass models install downloads all-minilm-l6-v2 from Hugging Face on explicit request and verifies SHA256 checksums. cass models install --model multilingual-minilm explicitly selects paraphrase-multilingual-MiniLM-L12-v2 for CJK and mixed-language retrieval. Nothing is fetched until an install command runs, and merely installing the multilingual model never changes the active space.

  • Air-gapped install: cass models install --model <minilm|multilingual-minilm> --from-file <dir> accepts a pre-downloaded model directory so you can bring the assets in yourself.

  • Switching spaces: both models output 384 values, but their identities and vectors are incompatible. Set CASS_SEMANTIC_EMBEDDER=multilingual-minilm, then run cass models backfill --tier quality --embedder multilingual-minilm; cass keeps lexical fail-open active until the complete new generation is atomically published.

  • Required files (all must be present after install; cass models verify --model <minilm|multilingual-minilm> checks the selected model):

    • model.safetensors
    • tokenizer.json
    • config.json
    • special_tokens_map.json
    • tokenizer_config.json
  • Vector index: Stored as vector_index/index-<embedder>.fsvi in the data directory.

  • Lexical fail-open: While the model is absent, cass returns lexical-only results and reports fallback_mode="lexical" in health/status; search never blocks on semantic assets.

Conversation titles can provide useful evidence when the messages themselves contain generic discussion. Enable CASS_SEMANTIC_TITLES=1 during indexing and search to combine a separate title vector with each conversation's best body match. The default remains the existing body search.

bash
# Uses the selected installed native model; this does not install a model.
CASS_SEMANTIC_TITLES=1 cass index --semantic

CASS_SEMANTIC_TITLES=1 cass search 'PostgreSQL query planner' --mode semantic --json
CASS_SEMANTIC_TITLES=1 cass search 'PostgreSQL query planner' --mode hybrid --robot

# Resume bounded title maintenance alongside the selected body backfill.
CASS_SEMANTIC_TITLES=1 cass models backfill --tier quality --max-batches 4 --json

Titles use the same selected native MiniLM, multilingual MiniLM, or explicit hash model as their body space. External embedding providers are not supported for titles. A title-only edit updates the title artifact without re-embedding unchanged message bodies. Explicit semantic indexing prepares the required SQLite scope index; scheduled work reports needs_setup until that foreground setup has completed. Enabled background indexing subsequently maintains a bounded batch of up to 64 conversations when title artifacts already exist.

The semantic leg combines title and body evidence per conversation. Its results still cite real archived messages, including an alternative message when the stored representative falls outside a requested role or time range. Agent, workspace, source, session-path and time filters apply before title top-k selection. Canonical edits, deletions and the durable forget fence invalidate stale title evidence. Searching never builds or repairs title artifacts.

Setting Default Effect
CASS_TITLE_FUSION weighted Choose weighted cosine scores, rrf ranks, or max over active channels
CASS_TITLE_WEIGHT 0.25 Title contribution from 0 (body only) through 1 (title only); changes do not require re-embedding
CASS_TITLE_BODY_CANDIDATES 1000 Body candidate budget, from 1 to 1000
CASS_TITLE_CANDIDATES 1000 Title candidate budget, from 1 to 1000
CASS_TITLE_TOTAL_CANDIDATES 2000 Combined conversation budget, from 1 to 2000
CASS_TITLE_MAX_ADMISSION_TITLES 100000 Maximum titles admitted against canonical history per request; maximum 1000000

Opted-in robot results include request-local title_search metadata with the policy, indexed and eligible title counts, stale exclusions, candidate bounds, and timings. semantic_title and semantic_title_body identify results with title evidence. This metadata establishes candidate validity and does not claim that every current conversation has an indexed title. Title and body artifacts have independent coverage. The offline hash regressions verify routing, filtering and lifecycle behavior; they do not measure neural relevance gains.

Opt-In External Embeddings#

An OpenAI-compatible embedding service can own inference, including any GPU it supports. Select external explicitly and set CASS_EXTERNAL_EMBEDDINGS=1 to consent to sending selected archive text during backfill and query text during semantic search. Configuring a URL alone sends nothing. Local models and hash embeddings keep their existing behavior.

Configure the endpoint's actual model name, output dimension and a stable model revision before backfilling. This example assumes a loopback service producing 384-dimensional vectors:

bash
export CASS_EXTERNAL_EMBEDDINGS=1
export CASS_EXTERNAL_EMBEDDING_URL='http://127.0.0.1:8000/v1/embeddings'
export CASS_EXTERNAL_EMBEDDING_MODEL='your-model-name'
export CASS_EXTERNAL_EMBEDDING_DIMENSION=384
export CASS_EXTERNAL_EMBEDDING_REVISION='model-revision-1'
# Set CASS_EXTERNAL_EMBEDDING_API_KEY separately if the service requires it.

cass models backfill --tier quality --embedder external --data-dir /path/to/cass-data --json
CASS_SEMANTIC_EMBEDDER=external cass search 'your query' --mode semantic --data-dir /path/to/cass-data --json

Use HTTPS for a non-loopback endpoint. Redirects and URLs containing credentials, a query or a fragment are refused. Responses must name the configured model and supply finite, unit-normalized vectors of the declared dimension. Fixed public probes check dimensions, normalization and repeatability before archive/query text is sent. Endpoint, model, dimension and revision identify a separate vector space; changing them requires its own completed backfill, while credential rotation preserves the space. Provider errors retain durable backfill checkpoints. A blocking request remains bounded by CASS_EXTERNAL_EMBEDDING_TIMEOUT_MS when cancellation occurs.

The persistent service also accepts --semantic-embedder external with --data-dir and --db; it uses the same consent and publication admission. cass capabilities --json and cass robot-docs env list every provider setting and default without printing configured values or contacting the endpoint. External protocol tests use a synthetic loopback service; they establish neither GPU performance nor a provider's retrieval quality.

Explicit Hash Vector Tier#

The deterministic hash embedder is available only when explicitly selected, such as with --fast-only, --embedder hash, or CASS_SEMANTIC_EMBEDDER=hash. It is a separate lexical-feature vector space, not a silent substitute for missing MiniLM vectors:

Feature ML Model (MiniLM) Hash Embedder (FNV-1a)
Meaning Understanding ✅ "car" ≈ "automobile" ❌ Exact tokens only
Initialization Time ~500ms (model loading) <1ms (instant)
Network Dependency None (after install) None
Disk Footprint ~90MB model files 0 bytes
Deterministic ✅ Same input = same output ✅ Same input = same output

Algorithm:

  1. Tokenize: Lowercase, split on non-alphanumeric, filter tokens <2 characters
  2. Hash: Apply FNV-1a to each token
  3. Project: Use hash to determine dimension index and sign (+1 or -1) in a 384-dimensional vector
  4. Normalize: L2 normalize to unit length for cosine similarity

When to Use:

  • Quick setup without downloading model files
  • Environments where ML inference overhead is unwanted
  • Fast-tier testing or an explicitly chosen degraded mode

Override: Set CASS_SEMANTIC_EMBEDDER=hash to force hash mode even when ML model is available.

FSVI Vector Index Format#

cass uses the frankensearch FSVI vector index format (.fsvi) for storing semantic embeddings.

Features:

  • Memory-mappable: large indexes open without copying into RAM
  • Quantization: supports f32 and f16 storage for smaller on-disk size
  • Fast search: exact brute-force vector search by default; HNSW approximate search runs only when --approximate is passed and the HNSW sidecar file exists. In status --json, hnsw_present and hnsw_state (present_unverified when a sidecar file exists) report the sidecar; hnsw_ready is currently always false, because status does not verify native ANN admission

Index Location: ~/.local/share/coding-agent-search/vector_index/index-<embedder>.fsvi

Search Modes#

cass supports three search modes, selectable via --mode flag or Alt+S in the TUI:

Mode Algorithm Best For
Lexical BM25 full-text Exact term matching, code searches
Semantic Vector similarity Conceptual queries, "find similar"
Hybrid (default) Lexical + single-tier semantic refinement fused with RRF; lexical fail-open Balanced precision and recall

Lexical Search: Uses Quill's BM25 implementation with prefix matching. Best when you know the exact terms you're looking for. The lexical index is derived from SQLite; if it is missing, stale, or incompatible, cass reports the state and rebuilds through the normal indexing path from the canonical database.

Semantic Search: Computes vector similarity between query and indexed MiniLM embeddings. Finds conceptually related content even without exact term overlap. Explicit semantic mode requires the MiniLM model and a compatible MiniLM vector index; it never substitutes same-dimensional hash vectors.

Hybrid Search: The default. It combines lexical and semantic results using Reciprocal Rank Fusion (RRF) when semantic assets are ready, and it fails open to lexical when semantic enrichment is still catching up or disabled:

RRF_score = Σ 1 / (K + rank_i)

Where K=60 (tuning constant) and rank_i is the position in each result list. This balances the precision of lexical search with the recall of semantic search. Semantic refinement is a single pass over the installed MiniLM index; progressive two-tier refinement (--two-tier) is experimental and currently inactive.

bash
# CLI examples
cass search "authentication" --mode lexical --robot
cass search "how to handle user login" --mode semantic --robot
cass search "auth error handling" --mode hybrid --robot

Advanced Search Features#

  • Wildcard Patterns: Full glob-style pattern support:
    • foo* - Prefix match (finds "foobar", "foo123")
    • *foo - Suffix match (finds "barfoo", "configfoo")
    • *foo* - Substring match (finds "afoob", "configuration")
  • Auto-Fuzzy Fallback: On small indexes (up to 10,000 documents by default), an exact search with sparse results is retried with *term* wildcards to broaden matches. A visual indicator shows when the fallback is active.
  • Query History Deduplication: Recent searches deduplicated to show unique queries; navigate with Up/Down arrows.
  • Match Quality Ranking: New ranking mode (cycle with F12) that prioritizes exact matches over wildcard/fuzzy results.
  • Match Highlighting: Snippets mark the terms the engine matched with **bold**, in human-readable and robot/JSON output alike; --highlight also marks the query terms' other occurrences, never marking a term twice.

Rich Terminal UI (TUI)#

Powered by FrankenTUI (ftui) — a high-performance Elm-architecture TUI framework with adaptive frame budgets, Bayesian diff selection, and spring-based animations.

  • Three-Pane Layout: Filter bar (top), scrollable results (left), and syntax-highlighted details (right).
  • Multi-Line Result Display: Each result shows location and up to 3 lines of context; alternating stripes improve scanability.
  • Live Status: Footer shows real-time indexing progress—agent discovery count during scanning, then item progress as a progress bar labelled Indexing 150/2000 (7%)—plus active filters.
  • Multi-Open Queue: Queue multiple results with Ctrl+Enter, then open all in your editor with Ctrl+O. Confirmation prompt for large batches (≥12 items).
  • Find-in-Detail: Press / to search within the detail pane; matches highlighted with n/N navigation.
  • Mouse Support: Click to select results, scroll panes, or clear filters.
  • Theming: Adaptive Dark/Light modes with role-colored messages (User/Assistant/System). Presets include dark, light, high-contrast, and accessible variants.
  • Ranking Modes: Cycle through recent/balanced/relevance/quality with F12; quality mode penalizes fuzzy matches.
  • Analytics Dashboard: 7 views (Dashboard, Explorer, Heatmap, Breakdowns, Tools, Plans, Coverage) with interactive charts, KPI tiles, and drill-down filtering. Open with Alt+A; Esc returns to search.
  • Inline Mode: Run cass tui --inline to keep terminal scrollback intact. The UI anchors to a region of the terminal while logs scroll normally. Configure with --ui-height <rows> and --anchor top|bottom.
  • Macro Recording: Capture input sessions with cass tui --record-macro session.macro for reproducible bug reports and workflow automation. Events are saved as human-readable JSONL with full timing data.
  • Asciicast Recording: Capture reproducible TUI demos and bug repro artifacts with cass tui --asciicast demo.cast.
    • Security default: recording captures terminal output only (input keystrokes are not serialized by default).

HTML Session Export#

Export conversations as styled, portable HTML files with optional encryption:

  • Mostly Self-Contained: All layout CSS and the export payload are inlined directly; the file opens without a local web server and references no Tailwind CDN (Tailwind is not used at runtime). Only the Prism.js syntax-highlighting assets are loaded from cdn.jsdelivr.net, pinned with SRI hashes.
  • Progressive Enhancement / Graceful Degradation: Prism.js resources fall back via onerror="...no-prism" — code blocks remain readable offline in plain monospace, and the page layout never depends on a network resource.
  • Password Protection: AES-256-GCM encryption with PBKDF2 key derivation (600,000 iterations)—opens directly in any browser
  • Rich Styling: Dark/light themes, syntax-highlighted code blocks, collapsible tool calls
  • Print-Friendly: Optimized print styles with page breaks and footers
  • Searchable: Built-in search functionality within the exported document
  • Credential redaction: HTML and generic conversation exports redact recognized credentials by default, including raw source files and archives indexed with redaction disabled. --include-secrets explicitly preserves source credentials and marks the output as sensitive. Encryption uses the same sharing policy.

TUI Usage: Press Ctrl+E in the detail view to open the export modal, or Ctrl+Shift+E to export Markdown immediately with defaults. On the detail pane's Export tab, e/h open the HTML export modal and m runs the Markdown export.

CLI Usage:

bash
# Basic export
cass export-html /path/to/session.jsonl

# With encryption
printf '%s\n' "secret" | cass export-html /path/to/session.jsonl --encrypt --password-stdin

# Explicit raw-fidelity export (contains credentials; handle as sensitive)
cass export-html /path/to/session.jsonl --include-secrets --json

# Custom output location
cass export-html session.jsonl --output-dir ~/exports --filename "my-session"

# Open in browser after export
cass export-html session.jsonl --open

# Robot mode (JSON output)
cass export-html session.jsonl --json

Universal Connectors#

Ingests history from 35 local agent connectors, normalizing them into a unified Conversation -> Message -> Snippet model. cass capabilities --json | jq .connectors is the canonical machine-readable inventory (kept in lockstep with the runtime registry):

  • Codex: ~/.codex/sessions and ~/.codex/archived_sessions (Rollout JSONL, plain or zstd-compressed .jsonl.zst)
  • Cline: VS Code global storage (Task directories)
  • Gemini CLI: ~/.gemini/tmp (Chat JSON)
  • Claude Code: ~/.claude/projects (Session JSONL), plus macOS Desktop metadata sidecars under ~/Library/Application Support/Claude/claude-code-sessions and ~/Library/Application Support/Claude/local-agent-mode-sessions
  • Clawdbot: ~/.clawdbot/sessions (Session JSONL)
  • Vibe (Mistral): ~/.vibe/logs/session/*/messages.jsonl (Session JSONL)
  • OpenCode: .opencode directories (SQLite)
  • Amp: ~/.local/share/amp & VS Code storage
  • Cursor: ~/Library/Application Support/Cursor/User/ global + workspace storage (SQLite state.vscdb)
  • ChatGPT: ~/Library/Application Support/com.openai.chat (v1 unencrypted JSON; v2/v3 encrypted—see Environment)
  • Aider: ~/.aider.chat.history.md and per-project .aider.chat.history.md files (Markdown)
  • Pi-Agent: ~/.pi/agent/sessions (Session JSONL with thinking content; pi_agent_rust SQLite sessions too)
  • Pi Durable (pi_durable): Pi's experimental durable harness (@earendil-works/pi-durable). SQLite stores at <agent dir>/experimental/durable-sessions/<cwd-hash>/<ms>-<uuid>/session.sqlite (agent dir PI_CODING_AGENT_DIR or ~/.pi/agent); JSONL commit-log stores under explicit roots. Each conversation in a store (lead, forks, task-owned children) is its own conversation. System prompts, task checkpoints and application documents are never indexed, and the stores are not raw-mirrored
  • Prime Agent (prime_agent): ~/.prime/agent/sessions/<session-id>.jsonl (versions 1–3). Indexes the active branch with omission counts for abandoned siblings; preserves thinking, tool results and context summaries. Overrides, in precedence order: PRIME_AGENT_SESSION_DIR, legacy PRIME_AGENT_CODING_AGENT_SESSION_DIR, then PRIME_AGENT_CODING_AGENT_DIR (with /sessions appended). Prime retains its own agent identity.
  • Oh My Pi (omp): OMP v18's default ~/.omp/agent/sessions, named profiles under ~/.omp/profiles/<name>/agent/sessions, XDG stores under $XDG_DATA_HOME/omp, and explicit OMP-only archive roots via CASS_OMP_DATA_ROOT (pi-family JSONL, including per-session sub-agent transcripts)
  • GitHub Copilot Chat: VS Code global storage under github.copilot-chat (JSON)
  • Copilot CLI: ~/.copilot/session-state, legacy ~/.copilot/history-session-state, and gh copilot config paths (JSONL/JSON)
  • OpenClaw: ~/.openclaw/agents/*/agent/openclaw-agent.sqlite (native SQLite transcripts) and ~/.openclaw/agents/*/sessions (legacy JSONL). OPENCLAW_STATE_DIR selects a different state directory. Watch mode polls database/WAL/SHM bundles under selected database files, state directories, and remote mirrors, and enrolls native stores created after startup. Discovery checks supported paths and immediate agent directories without walking session logs. Mirrors of .openclaw or .openclaw/agents support both retained-basename and contents-copy layouts. Native history suppresses a legacy migration copy only within the same physical agent directory, so another mirror's same-named session remains searchable.
  • Goose: ~/.local/share/goose/sessions/sessions.db (SQLite, v1.20+), plus the earlier per-session *.jsonl layout under ~/.goose/sessions
  • Crush: ~/.crush/crush.db and per-project .crush/crush.db (SQLite)
  • Hermes: the default ~/.hermes/state.db plus each named profile's ~/.hermes/profiles/<name>/state.db (SQLite), including homes with only profile stores. HERMES_HOME selects one literal home directory and includes its profiles; HERMES_SQLITE_DB selects one existing database. Explicit project-local .hermes homes and profile directories are supported too. Conversations retain their native session_id and record profile (default for the root); named-profile identities are scoped to their store so equal session IDs do not merge. Plain cass index discovers existing profile history, and watch mode follows profile databases and their WAL sidecars. Selecting an individual database or sidecar refreshes only that store.
  • Devin CLI: ~/.local/share/devin/cli/sessions.db (SQLite; override with CASS_DEVIN_DATA_ROOT). Indexes visible local sessions along their active parent chain, preserving tool messages and excluding abandoned branches and inline image payloads. Cloud-only sessions are outside this connector's scope.
  • Shelley: reads the local SQLite conversation database directly. Set CASS_SHELLEY_DB=/absolute/path/to/shelley.db, or add that file to the paths of a type = "local" source in sources.toml. Any filename is accepted after schema validation. Defaults include ~/.config/shelley/shelley.db and shelley.db in the current directory. Live indexing watches the database and its WAL/SHM sidecars; metadata changes refresh existing sessions. CASS_SKIP_SUBAGENTS=1 excludes conversations with a Shelley parent ID. The database can also contain credentials and application settings, so raw mirroring and remote database ingestion are disabled; keep the database on its original machine.
  • Grok Bot: indexes the desktop application's local rolling chat replica. Set CASS_GROK_BOT_DATA_ROOT to its persistence directory. Native message IDs preserve already indexed history as older messages leave the application's window; repeat scans do not duplicate retained messages. CASS reads only chat content. Raw mirroring and automatic fleet copying are disabled because the replica also holds secret and approval fields. This connector is separate from the Grok CLI connector and does not fetch cloud history.
  • Kimi Code: $KIMI_CODE_HOME/sessions/*/*/agents/*/wire.jsonl (default ~/.kimi-code; sub-agents index as <sessionId>:<agentId>), plus the legacy ~/.kimi/sessions/*/*/wire.jsonl layout (Session JSONL)
  • Muse Code: ~/.local/share/muse/sessions/<YYYY>/<MM>/<DD>/<session-id>/session.jsonl, including nested subagent/*/session.jsonl transcripts (override with CASS_MUSE_DATA_ROOT)
  • Qwen Code: ~/.qwen/tmp/*/chats/session-*.json (Chat JSON)
  • Factory (Droid): ~/.factory/sessions (JSONL files organized by workspace slug)
  • Antigravity (IDE + agy CLI): both stores are probed by default — the IDE's ~/.gemini/antigravity/ and the CLI's ~/.gemini/antigravity-cli/ — each holding brain/<uuid>/.system_generated/logs/transcript.jsonl (clean JSONL transcript) with the durable per-conversation conversations/<uuid>.db (SQLite) mirrored alongside. IDE conversations are keyed ide/<uuid> so the two stores never collide; CASS_ANTIGRAVITY_DATA_ROOT replaces both with one explicit base. Resume with cass resume <transcript> --agent agy (agy --conversation <uuid>).
  • OpenHands (OpenDevin): ~/.openhands/conversations/<id>/ — base_state.json metadata plus an events/event-NNNNN-<uuid>.json event stream (JSON)
  • Grok Build (xAI grok): ~/.grok/sessions/<percent-encoded-cwd>/<session-uuid>/ — updates.jsonl (authoritative ACP session-update stream) with summary.json metadata and chat_history.jsonl fallback (override the base dir with GROK_HOME). Resume with grok --resume <session-id>.
  • Codebuff / Freebuff (codebuff): ~/.config/manicode/projects/<project>/chats/<chat-id>/chat-messages.json with its run-state.json (override with CASS_CODEBUFF_DATA_ROOT). Both products write the same Manicode store and no chat records which binary wrote it, so their sessions share one lineage identity, codebuff (filter with --agent codebuff). Messages are reconciled by their native IDs, so an edited message updates in place instead of duplicating.
  • Kiro CLI (kiro): ~/.kiro/sessions/cli/<session-uuid>.jsonl (append-only event log: prompts, assistant messages, tool results) with the matching <session-uuid>.json snapshot read for session ID, working directory, title, timestamps and model.
  • Continue (continue): ~/.continue/sessions/<id>.json, one JSON snapshot per session holding its current ordered history (IDE extension and CLI). CONTINUE_GLOBAL_DIR moves the store, as it does for Continue itself.
  • ZCode CLI / Desktop (zcode): reads ~/.zcode/cli/db/db.sqlite (Windows: %USERPROFILE%\.zcode\cli\db\db.sqlite) with structural validation that distinguishes ZCode from OpenCode. Overrides, in precedence order: ZCODE_SESSION_DB_PATH, ZCODE_SESSION_DB, storage.sessionDbPath in <storage>/cli/config.json, then <storage>/cli/db/db.sqlite; <storage> is ZCODE_STORAGE_DIR or ~/.zcode. Indexes visible prompts, assistant text, reasoning and tool calls in recorded sequence, preserves direct token usage, excludes soft-deleted sessions and injected system reminders, and honors CASS_SKIP_SUBAGENTS=1. Watch mode follows database, WAL, SHM and rollback-journal changes. Raw mirroring and automatic remote copying are disabled because the database also contains local settings and internal prompt snapshots. Rollout logs, desktop logs, credentials, provider configuration and certificates are never indexed. cass resume is not supported for ZCode.

Claude Code Desktop sidecars preserve title, workspace, model, and session IDs, but not necessarily the full conversation body. If Claude Code has culled an old CLI JSONL body, cass can still index searchable sidecar metadata while reporting that the conversation body is unavailable.

Connector Details#

Pi-Agent parses JSONL session files with rich event structure:

  • Location: ~/.pi/agent/sessions/ (override the agent home with PI_CODING_AGENT_DIR, or the sessions directory directly with PI_SESSIONS_DIR)
  • Format: Typed events—session_start, message, model_change, thinking_level_change
  • Features: Extracts extended thinking content, flattens tool calls with arguments, tracks model changes
  • Detection: Scans for *_*.jsonl pattern in sessions directory

Oh My Pi (omp) uses the same pi-family wire format but remains a separate agent identity throughout search, analytics, resume, TUI, and HTML export:

  • Default and profiles: ~/.omp/agent/sessions/ and ~/.omp/profiles/<name>/agent/sessions/; OMP_PROFILE selects a profile and takes precedence over legacy PI_PROFILE
  • XDG: $XDG_DATA_HOME/omp/sessions/ and $XDG_DATA_HOME/omp/profiles/<name>/sessions/ when the OMP XDG root exists
  • Overrides and ownership: PI_CODING_AGENT_SESSION_DIR names the exact OMP sessions directory. CASS_OMP_DATA_ROOT declares an OMP-only archive/store root and is the right choice for copied, mounted, or custom OMP data. PI_CODING_AGENT_DIR is shared by both pi-family programs, so CASS conservatively keeps otherwise-ambiguous paths under that root owned by Pi-Agent; use one of the OMP-specific variables when OMP identity matters. PI_CONFIG_DIR changes the home-relative .omp config directory name.
  • Resume: results in the current live home/config store use omp [--profile <name>] --resume <id>; copied profiles, XDG archives, remote mirrors, and explicit roots also carry --session-dir <dir> so a canonical-looking archive cannot reopen a different live store
  • Upgrade behavior: archives created by older cass versions are reclassified from pi_agent to omp using the same conservative canonical/XDG/remote-mirror ownership policy as live discovery, then the derived lexical index and analytics are rebuilt so a transcript cannot remain attributed to both agents. The conventional ~/.local/share/omp shape is durable path evidence; an arbitrary historical custom $XDG_DATA_HOME/omp path is reclassified only while that root is currently configured and resolvable. Without provider-qualified evidence, ambiguous historical paths fail closed as Pi-Agent rather than letting a generic .../omp/sessions directory steal ownership.

OpenCode reads SQLite databases from workspace directories:

  • Location: .opencode/ directories (scans recursively from home)
  • Format: SQLite database with sessions table
  • Detection: Finds directories named .opencode containing database files

Search across agent sessions from multiple machines—your laptop, desktop, and remote servers—all from a single unified index. cass uses SSH/rsync to efficiently sync session data, tracking provenance so you know where each conversation originated.

The easiest way to configure multi-machine search is the interactive setup wizard:

bash
cass sources setup

What the wizard does:

  1. Discovers SSH hosts from your ~/.ssh/config
  2. Probes each host to check for:
    • Existing cass installation (and version)
    • Agent session data (Claude, Codex, Cursor, Gemini, etc.)
    • System resources (disk space, memory)
  3. Lets you select which hosts to configure
  4. Installs cass on remotes that don't have it (optional)
  5. Indexes existing sessions on remotes (optional)
  6. Configures sources.toml with correct paths and mappings
  7. Syncs the configured remotes by running cass sources sync right after configuration (skipped with --skip-sync or --dry-run; --json setup defers it and reports the command to run)

Wizard options:

Flag Purpose
--hosts <names> Configure only specific hosts (comma-separated)
--dry-run Preview changes without applying them
--non-interactive Use auto-detected defaults for scripting
--skip-install Don't install cass on remotes
--skip-index Don't run indexing on remotes
--skip-sync Skip the final cass sources sync. Interactive setup runs that sync after the hosts are configured and records it as complete only once it has actually finished; --json setup always defers it and reports sync.status = "pending" with the command to run
--resume Resume an interrupted setup
--json Output progress as JSON (for automation)

Examples:

bash
# Full interactive wizard
cass sources setup

# Configure specific hosts only
cass sources setup --hosts laptop,workstation,build-server

# Preview without making changes
cass sources setup --dry-run

# Resume interrupted setup
cass sources setup --resume

# Non-interactive for CI/CD
cass sources setup --non-interactive --hosts myserver --skip-install

Resumable state: If setup is interrupted (Ctrl+C, connection lost), state is saved to the cache directory (~/.cache/cass/setup_state.json on Linux). Resume with --resume.

Testing your real fleet#

Tailscale discovery is optional: cass sources discover --tailscale --json adds online tailnet peers to SSH-config discovery, and cass sources setup --tailscale offers them in setup. It reads local tailscale status --json with a five-second deadline; a missing CLI, stopped daemon, or login failure produces a warning and leaves SSH-config discovery available. Explicit setup --hosts skips discovery. Connections use ordinary SSH over assigned Tailscale IPv4 addresses, so MagicDNS is not required. Matching SSH aliases retain their user/key configuration; otherwise SSH uses its normal defaults. IPv6-only peers are currently omitted. Tailscale ACLs, SSH authorization and host-key checks still apply; discovery does not log in, install Tailscale, or change either SSH or tailnet configuration.

The local fixture and Docker tests do not prove that your machines can sync and search each other's sessions. The opt-in live harness uses actual SSH connections and cass sources discover, sources add, sources sync, and search. It creates isolated synthetic Codex sessions on each machine, checks source provenance and filters, repeats a sync to detect duplicates, and appends messages. It checks both lexical and default hybrid search, requires one JSON response per sync, holds the real indexing lock to test busy refusal, and recovers transferred sessions through sources reingest. A refused SSH connection must leave the other sources searchable.

Keep the inventory and SSH configuration outside this repository. For example, create a mode-0600 JSON file containing:

json
{
  "ssh_config": "/private/path/to/ssh_config",
  "hosts": [{"ssh": "workstation"}, {"ssh": "laptop"}]
}

Then run with an explicit binary:

bash
python3 scripts/e2e/live_fleet_search.py \
  --inventory /private/path/to/fleet.json \
  --cass-bin /path/to/cass

Python 3 and authenticated SSH access are required on the remote machines. The Unix runner needs Python 3.9+, rsync, and a CASS binary supporting the tested commands. Each inventory alias must appear in the supplied SSH configuration; included configuration files are supported. Host-key verification stays enabled. To exercise actual tailnet discovery and transport, add --tailscale to the harness command and use tailnet IPv4 addresses as the private inventory targets. Keep any required SSH users, keys and trusted host-key aliases in the private SSH configuration. For a discovery test independent of explicit aliases, use SSH Match originalhost entries rather than literal Host entries for those addresses. The harness retains fresh test directories and raw receipts privately outside git; it never changes existing session archives or deletes test data. Console results use ordinal labels. An unreachable machine keeps the overall result failed, even if the other machines pass. Do not attach raw receipts or inventories to public issues: they contain machine identities.

Remote Installation Methods#

When the wizard installs cass on remote machines, it tries every viable method in this priority order, falling through to the next when one fails; setup fails only when all of them do, and the error lists each attempt:

Priority Method Speed Requirements
1 Pre-built binary ~10s curl/wget, GitHub access, compatible release binary
2 Source build ~30 min rustup and cargo, curl/wget, 6GB free disk in $HOME, 10GB RAM
3 Full bootstrap ~30 min curl, 6GB free disk in $HOME, 10GB RAM (installs rustup, then builds as in 2)

The source build does what install.sh --from-source does: it downloads the release tag's source archive into $HOME, installs the Rust toolchain that tag's rust-toolchain.toml pins (a dated nightly; cass does not build on stable), and runs cargo install --locked --path . --bin cass inside it, so the binary lands in ~/.cargo/bin/cass. The unpacked tree is removed afterwards. It does not use crates.io. It builds with thin LTO instead of the release profile's fat LTO, so the binary is somewhat larger and slower than the published one. Measured building v0.10.0 on a fresh account (two build jobs): 28 minutes, 8.6 GB peak compiler memory (10.9 GB and 36 minutes with fat LTO), 1.5 GB toolchain, 0.8 GB cargo cache and a 2.6 GB build tree. The wizard offers it only to hosts above those floors.

crates.io lags the releases: the newest version on crates.io is 0.7.0 (2026-08-25), so cargo install coding-agent-search builds 0.7.0. Later versions depend on franken-agent-detection and frankensearch at exact git revisions. Their required APIs must be published before CASS can return to registry-only dependencies (bead zztql; GH #548). Use the installer or the GitHub Release binaries for a current version.

Resource Requirements:

  • Minimum 1GB free disk in $HOME for the pre-built binary
  • 6GB free disk in $HOME and 10GB RAM for a source build
  • Linux pre-built binaries require glibc 2.28+ on conventional FHS-style distributions (see System Requirements); older glibc, musl-only, and NixOS hosts fall back to source installation when possible.
  • SSH access with key-based authentication

What Gets Installed:

  • The cass binary (location depends on method: ~/.cargo/bin/cass for cargo-based, ~/.local/bin/cass for pre-built binary)
  • No daemon, no background services—just the binary

Installation Progress: The wizard shows real-time progress for each stage:

Installing cass on laptop...
  [1/4] Checking environment...     ✓
  [2/4] Downloading binary...       ████████░░ 80%
  [3/4] Verifying checksum...       ✓
  [4/4] Setting up PATH...          ✓

Use --skip-install if you prefer to install manually on remotes.

Host Discovery & Probing#

The setup wizard automatically discovers SSH hosts from your configuration:

Discovery Sources:

  • ~/.ssh/config (parses Host entries)
  • Hosts with wildcards (*, ?) are automatically excluded

Probe Results (for each discovered host):

Check Purpose
Connectivity Can we establish SSH connection?
cass Version Is cass already installed? What version?
Agent Data Which agents have session data?
Session Count How many conversations exist?
System Info OS, architecture, disk space, memory

Each setup run probes every selected host afresh; probe results are not cached between runs.

For Clawdbot, Kimi, and Kiro CLI, the wizard checks ~/.clawdbot/sessions, ~/.kimi/sessions, ~/.kimi-code/sessions, and ~/.kiro/sessions/cli. Sync preserves those directory names inside each source mirror so the native reader can index the transcripts. A previously synced transcript-only source acquires this layout on its next successful sync. For Continue, Factory, and Vibe, the wizard checks the transcript directories ~/.continue/sessions, ~/.factory/sessions, and ~/.vibe/logs/session before suggesting them for sync. Settings and authentication files elsewhere in those homes stay outside the suggested paths.

Manual Setup#

For manual configuration without the wizard:

bash
# Add a remote machine using platform presets
cass sources add user@laptop.local --preset macos-defaults

# Or specify paths explicitly
cass sources add dev@workstation --path ~/.claude/projects --path ~/.codex/sessions

# Sync sessions from all configured sources
cass sources sync

# Check source health and connectivity
cass sources doctor

Remote Archive Safety#

Remote source diagnostics are intentionally local-only. cass triage --json, cass doctor --json, cass health --json, and cass status --json report the remote_source_sync summary from cass-owned evidence: sources.toml, sync_status.json, the local remotes/<source>/mirror/ copy, and archive DB provenance rows. They do not open SSH sessions, mutate remote machines, or rewrite provider session logs while classifying source gaps.

cass sources doctor is the explicit networked exception: it performs bounded, read-only probes of configured source hosts. Its per-source human summary keeps the same native reachability, binary-health, and mirror/sync state codes and safe command as the JSON report. It intentionally does not claim local search readiness, because a remote host probe cannot establish the controller's local SQLite, lexical, or semantic asset state.

This matters because agent harnesses can prune their own logs. If a laptop is retired, a remote path disappears, or a provider truncates older sessions, the cass archive DB and cass-owned local mirror may be the only remaining evidence for those conversations. Treat gap names such as remote_source_unavailable, remote_source_pruned, local_archive_ahead_of_remote, and remote_copy_ahead_verified as preservation signals first: keep the archive and mirror intact, then run the recommended cass sources sync --json (all configured remote sources; --source <name> narrows it) or source-specific sync command after reviewing the reported evidence.

To review a manual raw-mirror retention plan, use cass mirror prune --older-than 90d --json or cass mirror prune --max-size 100GB --json. Add --apply after reviewing the scope and totals. Preview entries contain at most 1,000 manifest/blob details; omitted_entry_count reports additional candidates. Planned counts and bytes cover the entire plan, including omitted details. Use provider/path selectors to inspect a narrower scope. Previews do not append audit records. Add --keep-tag <tag> to pin captures linked to tagged conversations. prune holds down blobs referenced by captures from the last 7 days by default, writes complete intent/result records to raw-mirror/v1/pruned.jsonl for non-empty applied plans, and refuses apply mode while an index/watch job is active. Applied pruning syncs the audit independently of the optional capture setting CASS_RAW_MIRROR_FSYNC. Each completed result is recorded before the next removal; a later failure preserves those earlier results. An abrupt crash between a removal and its result record can still leave an intent without a confirmed result.

Use --provider opencode and/or --source-path '*/opencode.db' with an age or size rule to target one source without retiring unrelated captures. Repeated providers are alternatives; a source-path glob further narrows them.

--keep-latest N retires every capture of a source file except its newest N (a source file is one provider, source and original path) and keeps those N out of reach of --older-than and --max-size. Use it for a prune that runs on a timer: cass mirror prune --keep-latest 1 --safety-hold-down 6h --apply keeps the mirror to the newest capture of each source file plus whatever was captured inside the hold-down window, and never retires the only copy of a session whose provider has since deleted it. Older captures of an appended transcript share their complete chunks with the newest one, so retiring them frees only their superseded tail chunks; for a file that was rewritten rather than appended to, it also drops the earlier versions.

Indexing also runs automatic retention for the default archive. It keeps the latest two captures per source file, honors a six-hour hold-down and the keep, pinned, and recovery tags, and only retires an older capture when a protected capture contains its verified byte-for-byte prefix. Automatic retirement uses the same audit log. Set CASS_RAW_MIRROR_AUTO_PRUNE=0 to leave retention to manual commands.

A capture stages its copy under raw-mirror/v1/tmp/capture.<pid>.<ts>.<n> and holds the mirror lock until it publishes. A capture that is killed, for example by a timeout around cass index, leaves that directory behind. An unscoped cass mirror prune (no --provider or --source-path) takes the same lock, so any staging directory it finds is abandoned. The preview lists each one that has not been written for an hour, with its size, as a staging entry, and --apply removes it. Staging-named symlinks are not followed.

A pruned capture of a source that is still on disk is copied again by the next index run. On a machine whose providers never delete their session files, set CASS_RAW_MIRROR=0 (or false, no, off) to stop capturing altogether. Indexing and search are unchanged, and existing captures stay until you prune them. cass doctor reports raw_mirror_capture_disabled and warns about what is given up: a session file its provider later deletes survives only in the archive DB. With a selector, --max-size measures unique blobs in that selection. Shared blobs still referenced outside it and orphan blobs without source provenance remain protected. The JSON plan records the selectors and scope_blob_bytes.

Large mutable sources are stored as content-addressed chunks: JSONL and NDJSON transcripts of 256 KiB or more in 256 KiB chunks, and other sources of 8 MiB or more, such as SQLite stores, in 4 MiB chunks. A growing transcript reuses every unchanged complete chunk, so an index run after an append stores only its changed tail chunk and a manifest, and SQLite sources reuse unchanged 4 MiB byte regions. New chunks use zstd when it reduces their stored size. Chunks that do not shrink are stored as-is. Existing whole-blob and plain chunked captures remain readable. cass doctor --json reports storage_kind, chunk_count and the full-source digest, and verifies every referenced chunk before treating a snapshot as recovery authority.

CASS_RAW_MIRROR_MAX_BYTES defaults to 8 GiB and counts stored file bytes, including manifests and capture caches. CASS_RAW_MIRROR_MIN_FREE_BYTES defaults to 2 GiB of free disk space. When a budget refuses a capture, indexing can still proceed and cass status --json reports the refusal under raw_mirror_capture. Review the budget and free space before changing retention settings.

Configuration File#

Sources are configured in the platform config directory (Linux: ~/.config/cass/sources.toml, macOS: ~/Library/Application Support/cass/sources.toml):

toml
[[sources]]
name = "laptop"
type = "ssh"
host = "user@laptop.local"
paths = ["~/.claude/projects", "~/.codex/sessions"]
sync_schedule = "manual"

[[sources]]
name = "workstation"
type = "ssh"
host = "dev@work.example.com"
paths = ["~/.claude/projects"]
sync_schedule = "daily"

# Path mappings rewrite remote paths to local equivalents
[[sources.path_mappings]]
from = "/home/dev/projects"
to = "/Users/me/projects"

# Agent-specific mappings
[[sources.path_mappings]]
from = "/opt/work"
to = "/Volumes/Work"
agents = ["claude_code"]

Configuration Fields:

Field Description
name Friendly identifier (becomes source_id)
type Connection type: ssh or local
host SSH host (user@hostname)
paths Paths to sync (supports ~ expansion)
sync_schedule manual, hourly, or daily. Only the jobs installed by cass schedule install run it; without them it is a label and syncs happen when you run cass sources sync
path_mappings Rewrite remote paths to local equivalents

CLI Commands#

bash
# List configured sources
cass sources list [--verbose] [--json]

# Add a new source
cass sources add <user@host> [--name <name>] [--preset macos-defaults|linux-defaults] [--path <path>...] [--no-test] [--json]

# Set how often `cass schedule install` jobs sync a remote source (default: manual)
cass sources schedule <name> <manual|hourly|daily> [--json]

# Remove a source
cass sources remove <name> [--purge] [-y]

# Check connectivity and config
cass sources doctor [--source <name>] [--json]

# Sync sessions
cass sources sync [--source <name>] [--no-index] [--verbose] [--dry-run] [--json]

Read-Only (rrsync) Remotes#

A key restricted in the remote's authorized_keys to command="rrsync -ro /home/user",restrict works: cass sources sync retries without --secluded-args (which rrsync refuses), and the connectivity check in sources add and sources doctor runs true, the one non-rsync command rrsync allows. Three things differ from an unrestricted key:

  • Write remote paths without ~. cass expands ~ by asking the remote shell for $HOME, and rrsync refuses that.
  • rrsync anchors every path at its directory. With rrsync -ro /home/user, configure /.claude/projects (served as /home/user/.claude/projects); /home/user/.claude/projects would be served as /home/user/home/user/.claude/projects. Paths containing .. are refused.
  • Tailscale SSH authenticates through the tailnet, not authorized_keys, so a forced command does not restrict a Tailscale SSH session. Use a regular sshd for a read-only key.

Excluding Noisy Agent Harnesses#

If one harness is generating mostly junk or looped output, you can disable it persistently even if its files remain on disk:

bash
# Inspect current include/exclude state
cass sources agents list --json

# Stop indexing this harness in future runs
cass sources agents exclude openclaw

# Re-enable it later
cass sources agents include openclaw

cass stores this preference in sources.toml (~/.config/cass/sources.toml on Linux, ~/Library/Application Support/cass/sources.toml on macOS). New scans, syncs, and watcher processes read the saved exclusion.

By default, cass sources agents exclude <agent> also removes already archived local data for that agent and rebuilds the lexical index so the exclusion frees space instead of only blocking future imports.

A purging exclusion requires exclusive access to the selected archive and search data. If an indexer, watcher, or maintenance operation already holds that access, the command exits with code 7 and leaves configuration and archive data unchanged. Stop the active process, then retry the exclusion. Once admitted, the command retains exclusive access through deletion and publication of the rebuilt lexical index.

Exclusions apply to a whole connector. Excluding openclaw also removes archived conversations for named agents such as openclaw/alice and openclaw/bob. Qualified names such as openclaw/alice are rejected by exclude; they are never silently widened to the whole connector. Use cass forget --agent openclaw/alice to preview removing only that named agent's archived conversations, then add --apply to confirm the deletion.

If you want to block future indexing but keep the data already archived:

bash
cass sources agents exclude openclaw --keep-indexed-data

This option saves only the configuration change and can run while indexing is active. Restart any running watcher for the new exclusion to take effect; its current selection of connectors remains active until it exits.

Sync Engine Internals#

The sync engine uses rsync over SSH for efficient delta transfers and falls back to other transports when rsync is unavailable:

Transfer Methods (auto-detected):

Method When Used Characteristics
rsync rsync available on both ends Delta transfers, compression, progress stats
WSL rsync Windows without native rsync, WSL with rsync installed Runs wsl rsync
scp rsync unavailable Full file copies through the system scp, inheriting the OpenSSH agent, keys and ~/.ssh/config
SFTP the fallbacks above unavailable Full file transfers via the SSH native protocol

Safety Guarantees:

  • Additive-only syncs: rsync runs WITHOUT --delete, so remote deletions never propagate locally.
  • Local copies follow the remote: rsync runs with -a and without -u, so a local mirror file that differs from the remote is overwritten, even when the local copy is newer. The mirror is a copy of the remote, not a place to edit sessions.
  • Interrupted transfers resume: --partial keeps a partly transferred file under its final name so the next sync continues it. A failed sync can therefore leave a truncated file until the next sync completes.

Transfer Configuration:

Setting Default Purpose
Connection timeout 10s Fail fast on unreachable hosts
Transfer timeout 300 s of I/O inactivity rsync --timeout aborts a transfer that stalls this long; there is no wall-clock limit on a transfer that keeps moving
Compression Enabled Reduce bandwidth for text-heavy sessions
Partial transfers Enabled Resume interrupted syncs

rsync Flags Used:

-avz --links --safe-links --stats --partial [--protect-args | --secluded-args] --timeout 300 \
  -e "ssh [-F $CASS_SSH_CONFIG] -o BatchMode=yes -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=yes"

Where -avz = archive mode + verbose + compression. --protect-args/--secluded-args is auto-detected per remote rsync version (omitted when the remote rejects it), and --timeout carries the transfer timeout in seconds. StrictHostKeyChecking=yes means a host whose key is not already in known_hosts fails with "Host key verification failed". Connect once with plain ssh <host> and accept the key, or add it with ssh-keyscan, before the first sync.

Data Flow:

Remote: ~/.claude/projects/
    ↓ (rsync over SSH)
Local: ~/.local/share/coding-agent-search/remotes/<source>/mirror/<path>_<hash>/
    ↓ (connector scan)
Index: agent_search.db + index/v9-quill/

Where <path> is a filesystem-safe version of the remote path (e.g. .claude_projects), and <hash> is an FNV-1a hash of the original path in hex, so foo/bar and foo_bar never collide.

Sessions from remotes are indexed alongside local sessions, with provenance tracking to identify origin.

Path Mappings#

When viewing sessions from remote machines, workspace paths may not exist locally. Path mappings rewrite these paths so file links work on your local machine:

bash
# List current mappings
cass sources mappings list laptop

# Add a mapping
cass sources mappings add laptop --from /home/user/projects --to /Users/me/projects

# Test how a path would be rewritten
cass sources mappings test laptop /home/user/projects/myapp/src/main.rs
# Output: /Users/me/projects/myapp/src/main.rs

# Agent-specific mappings (only apply for certain agents)
cass sources mappings add laptop --from /opt/work --to /Volumes/Work --agents claude_code,codex

# Remove a mapping by index
cass sources mappings remove laptop 0

TUI Source Filtering#

In the TUI, filter sessions by origin:

  • F11: Cycle source filter (all → local → remote → all)
  • Shift+F11: Open source filter menu to select specific sources

Remote sessions display with a source indicator (e.g., [laptop]) in the results list.

Provenance Tracking#

Each conversation tracks its origin:

  • source_id: Machine identifier (e.g., "laptop", "workstation")
  • origin_kind: local or remote
  • origin_host: the remote host label, absent for local sessions
  • workspace_original: Original path on the remote machine (before path mapping)

--fields provenance selects exactly source_id, origin_kind and origin_host.

These fields appear in JSON/robot output and enable filtering:

bash
cass search "auth error" --source laptop --json
cass timeline --since 7d --source remote
cass stats --by-source