cass

DocsRunning cass

Environment

On this page
  • Config: Loads .env via dotenvy::dotenv().ok(); configure API/base paths there. Do not overwrite .env.

  • Data Location: Defaults to standard platform data directories (e.g., ~/.local/share/coding-agent-search). Override with CASS_DATA_DIR or --data-dir.

  • ChatGPT Support: The ChatGPT macOS app stores conversations in versioned formats:

    • v1 (legacy): Unencrypted JSON in conversations-{uuid}/ — fully indexed.
    • v2/v3: Encrypted with AES-256-GCM, key stored in macOS Keychain (OpenAI-signed apps only) — detected but skipped.

    Encrypted conversations require keychain access which isn't available to third-party apps. Legacy unencrypted conversations are indexed automatically.

  • Logs: Written to cass.log (daily rotating) in the data directory.

  • Updates: Interactive TUI checks for GitHub releases on startup. Skip with CODING_AGENT_SEARCH_NO_UPDATE_PROMPT=1 or TUI_HEADLESS=1.

  • Cache tuning: CASS_CACHE_SHARD_CAP (per-shard entries, default 256) and CASS_CACHE_TOTAL_CAP (total cached hits across shards, default 2048) control prefix cache size; raise cautiously to avoid memory bloat.

  • Cache debug: set CASS_DEBUG_CACHE_METRICS=1 to emit cache hit/miss/shortfall/reload stats via tracing (debug level).

  • Temporary source exclusions: CASS_EXCLUDE_PATHS accepts comma- or newline-delimited file paths or directory prefixes to keep out of the archive: no conversation from an excluded source is stored, indexed or raw-mirrored, whichever connector found it. The Claude Code, Codex, Codebuff and Pi readers skip an excluded file without opening it; other connectors read it, and cass discards its conversations before storing anything. Entries match whole path components (sess does not exclude sessions), a relative entry is taken from the working directory, and symlinks and other aliases of an existing directory are resolved on both sides, so a .., symlinked or (on Windows) differently-cased spelling of a directory excludes it too. While source exclusions are active, CASS preserves scan/watch watermarks so excluded active session files are picked up after the exclusion is removed. An exclusion is prospective: conversations archived before it was set stay in the archive and stay searchable, because cass never deletes archived history on its own. To remove them, run cass forget --source-glob '<glob>' (a dry run until --apply).

  • Workspace exclusions: CASS_EXCLUDE_WORKSPACES accepts comma- or newline-delimited, case-sensitive globs over recorded workspace paths, such as /work/scratch/*,/work/retired/**. It works even when source paths are date-sharded Codex rollouts or a shared OpenCode/Devin database. Missing workspaces do not match; invalid globs stop indexing with an error. Workspace exclusions allow normal scan watermarks and source-completion records to advance, so an excluded workspace does not force repeated historical scans. Changing or removing the policy revisits sources once. Existing archived conversations remain searchable; use cass forget --workspace-glob '<glob>' to remove them. Raw captures made before parsing a shared store can still contain excluded sessions; workspace exclusion is not erasure of raw evidence.

Preview a selective cleanup, review the counts, and then repeat with --apply:

bash
# Scratch history older than 90 days; both selectors must match.
cass forget --workspace-glob '/work/scratch/*' --older-than 90d --json
cass forget --workspace-glob '/work/scratch/*' --older-than 90d --json --apply

# Exclude that workspace from future ingestion, while keeping scan progress.
CASS_EXCLUDE_WORKSPACES='/work/scratch/*' cass index --json

# Raw source captures have separate retention and their own preview.
cass mirror prune --older-than 90d --json

Exact-file batches. Repeat --source-path to select exact stored paths without interpreting glob characters or trimming whitespace. This also works for archived files that no longer exist on disk. Preview the complete batch, then repeat it with --apply:

bash
cass forget --source-path '/logs/session[1].jsonl' \
  --source-path '/other/project/session-two.jsonl' --json
cass forget --source-path '/logs/session[1].jsonl' \
  --source-path '/other/project/session-two.jsonl' --apply --json

Repeated --source-glob patterns are also supported. All source paths and globs form a union; workspace and age filters intersect that union. Duplicate paths and overlapping globs select each conversation once. Selector syntax and the complete selection's shared-source safety are validated before deletion. An apply stores its compact plan in a temporary disk file and commits bounded batches; each batch commits its tombstones, canonical deletion and repair marker together. A successful mutating invocation rebuilds derived assets once. A zero-match apply creates no new tombstones and skips that rebuild unless an earlier interrupted forget left a repair pending. JSON reports the deduplicated source_paths and source_globs, plus derived_rebuilt to distinguish a completed rebuild from a preview or no-op. When there is exactly one distinct glob and no literal paths, pattern and source_glob identify that glob; otherwise they are empty/null. There is no deferred-rebuild mode.

Memory bounds and progress (GH #565). Delete transactions hold at most 256 selected conversations and target at most 8 MiB of estimated canonical payload. An individual conversation larger than that budget is processed alone and remains atomic; its size is therefore an explicit lower bound on working memory. The selection plan and source checks do not accumulate the whole archive in RAM. The report records delete_batches_committed, max_delete_batch_conversations, max_delete_batch_estimated_bytes and oversized_conversations.

Before the first writable open, forget applies the same optional FTS shadow limit as indexing (CASS_FTS_SHADOW_MAX_MESSAGES, default 100,000 indexable messages). It retires an oversized shadow and does not recreate it during post-delete repair. Quill remains the lexical search index; the SQL fallback can scan canonical messages without an FTS shadow. JSON fallback_fts reports rebuilt or retired and the corpus size. Setting the FTS limit to zero explicitly disables that protection.

Analytics uses bounded reset and payload pages. Lexical rebuilding uses the existing bounded profile by default (one worker, one preparation thread, a one-page channel, 64-conversation fetches and 64 MiB text commit intervals); explicit positive CASS_TANTIVY_REBUILD_* knob overrides still apply. JSON rebuild_profile records the effective configuration. These work-unit limits are not a fixed process RSS ceiling: the largest atomic conversation/message, index engine allocations and explicit overrides also contribute. Each maintenance phase is printed to stderr even without RUST_LOG; stdout remains the JSON report when --json is selected.

Selection and previews. Globs are case-sensitive and * also matches /; quote them so the shell passes them unchanged. Use --source-path for literal filenames instead of widening a glob to group unrelated paths. Selectors match the stored path, which for a shared store may be a logical handle such as .../opencode.db/<session-id>. A missing workspace never matches --workspace-glob. Age uses the maximum message timestamp, strictly before the reported before_ms cutoff; equality, empty sessions and sessions with even one missing message timestamp are kept. Each invocation resolves the duration once. JSON previews include up to 20 sample_sessions, each with source_path, external_id, workspace and last_message_at, alongside the existing counts and sample_source_paths. Human output shows the same session details, so sessions in one shared store can be distinguished before applying.

Changed sessions and re-inclusion. A forgotten shared-store session remains suppressed for the same source provenance, agent, stored source path and external session ID until its exclusion is explicitly released. Appending to or editing the forgotten session itself does not restore it, and neither do sibling changes, a full rescan or changes to workspace exclusions. Removing CASS_EXCLUDE_WORKSPACES only changes prospective admission; it does not undo an applied forget.

Inspect the durable records and preview an explicit release before applying it:

bash
cass forget --list --json

# Copy the complete stored source_path and session identity from the list.
# --source-path is literal, including any glob characters in the filename.
cass forget --reinclude --source-path '/path/opencode.db/session-id' \
  --source-id local --agent opencode --external-id session-id --json

cass forget --reinclude --source-path '/path/opencode.db/session-id' \
  --source-id local --agent opencode --external-id session-id --apply --json
cass index --json

--list returns exclusions for durable shared-session identities and legacy_sources for ordinary-file stamps. Its selectors are optional. --reinclude requires at least one selector and defaults to a read-only preview; --apply removes the selected records and invalidates the matching source's completion evidence and replay cutoffs, including physical databases behind logical session paths. Unrelated source completions are retained. An ordinary cass index can then recover unchanged historical sources; --force-rebuild only rebuilds derived assets from existing canonical rows. Other session exclusions and active path, workspace or agent policies still apply.

Re-inclusion itself restores zero conversations. JSON reports conversations_restored: 0 and sets reindex_required only after an applied release. Its next_command_argv binds the follow-up index to the same database and data directory. Previews and repeated releases with no matches do not request reindexing or clear replay state.

Both management modes accept one literal --source-path or one --source-glob, plus exact --source-id, --agent and --external-id filters. Supplied filters are ANDed. Source/provenance, agent and external-ID selectors are available only with --list or --reinclude; repeating a source selector in these modes is rejected. Workspace and age selectors are rejected in these modes because the existing v23 exclusion records do not store that metadata. Preview JSON reports matched and removed counts separately; a dry run always removes zero.

Identity filters do not release path-wide source stamps. If a selected session also has a legacy stamp at its stored source path, listing marks it blocked_by_source_stamp and the release preview names the path in blocked_by_source_stamps. Applying that identity-only release refuses the whole request. To release both mechanisms, preview a source-only request with --reinclude --source-path '<stored path>', review every selected record, then repeat with --apply.

Ordinary single-session files retain their existing size/mtime behavior for all selectors: unchanged files stay forgotten across incremental and full scans, while a changed size or modification time makes the file eligible for indexing again. Editing a file without changing that stamp does not clear its tombstone.

Forgetting is always an explicit operation. CASS does not automatically delete old archived conversations. Source files remain on disk, and existing raw-mirror captures are governed separately by mirror prune. While any durable session exclusion refers to a shared container, indexing suppresses new raw captures of that container and its SQLite sidecars, including known path aliases. Kept siblings still update in the canonical archive. A shared snapshot cannot omit only the forgotten session, so it remains blocked until the last relevant identity exclusion is released. Ordinary-file stamps retain their existing capture policy.

Recovering a failed forget. Repeat the same selectors with --apply. Completed deletion batches survive a later failure; each individual conversation and its tombstones are atomic, and the retry selects the remaining conversations. A durable pending marker makes the retry finish rebuilding even when there are no matching canonical rows left. Reader admission remains blocked until the required derived repair and replacement lexical publication succeed. A preview remains read-only and does not perform this recovery. cass index --full --rebuild-profile bounded can rebuild derived assets for already-committed deletions; rerun the forget selectors to finish an interrupted deletion batch.

  • Active session retries: continuous watch mode retains skipped active paths and partially published Codex prefixes, including during startup, and retries them after the normal watch cooldown even without another filesystem event. CASS_ACTIVE_SESSION_RECENT_WRITE_WINDOW_SECS controls the recent-write window (default 120 seconds, maximum 3600); whole-file and advisory-lock guards remain in place outside the admitted Codex prefix path.

  • Watch testing (dev only): cass index --watch --watch-once path1,path2 triggers a single reindex without filesystem notify (also respects CASS_TEST_WATCH_PATHS for backward compatibility); useful for deterministic tests/smoke runs.

Complete Environment Variable Reference#

Variable Default Description
Core
CASS_DATA_DIR Platform default Override data directory
CASS_DB_PATH $CASS_DATA_DIR/agent_search.db Same as --db (the flag wins): path of the canonical database. When it lies outside the data dir, derived assets (lexical index, checkpoints, locks) follow its directory unless --data-dir is given
CASS_EXCLUDE_PATHS unset Comma/newline-delimited files or directory prefixes to skip without advancing scan/watch watermarks
CASS_OUTPUT_FORMAT unset json, jsonl, compact, sessions or toon makes robot output the default, as if --robot-format were given
CASS_SSH_CONFIG unset SSH config file passed as ssh -F <path> for remote sources (cass also sets BatchMode=yes and StrictHostKeyChecking=yes)
CASS_RAW_MIRROR 1 Raw-mirror capture of session source files into raw-mirror/v1/. 0, false, no or off stops capturing (GH #506). Indexing is unchanged, and existing captures stay until cass mirror prune. Doctor reports raw_mirror_capture_disabled, because a file its provider deletes then survives only in the archive DB.
CASS_DOCTOR_RAW_MIRROR_FULL_VERIFY unset Set to 1 to hash every raw-mirror descriptor/chunk during a read-only doctor run, overriding the default bounded verification limits
CASS_DOCTOR_RAW_MIRROR_FULL_VERIFY_MANIFEST_LIMIT 256 Defer full raw-mirror hashing above this manifest count while retaining metadata-only amplification diagnostics
CASS_DOCTOR_RAW_MIRROR_FULL_VERIFY_BYTE_LIMIT 536870912 Defer full raw-mirror hashing when either physical storage or estimated logical verification work exceeds this byte count; metadata-only amplification diagnostics remain available
CASS_FTS_DRYRUN_CAP 4096 Row-ID comparison cap for the read-only doctor --rebuild-canonical-fts --dry-run divergence scan (#345). At the cap the dry-run stops and reports a >= N divergent floor instead of an exact count; exact parity is deferred to the --yes apply path
Background Indexing
CASS_AUTO_REFRESH 1 Read-triggered catch-up for a stale/partial/behind index or an overdue source scan seen by search, pack, or TUI launch. Set 0 to disable globally; search --no-maintenance always remains read-only. A spawned catch-up that ends without advancing last_indexed_at or the completed-scan watermark (OOM-killed in a memory-capped scope, stall-aborted, crashed) counts as a failure: the next attempt waits 1 h, then 6 h, and three failures in a row trip the breaker (no auto-spawn until any run completes). --robot-meta/status --json report auto_refresh.outcome = backed_off/tripped with consecutive_failures and detail; schedule status and doctor show the same.
CASS_AUTO_REFRESH_SOURCE_SCAN_SECS 300 Completed-source-scan age before an eligible read requests incremental catch-up, including for a healthy lexical index. 0 disables only this cadence; stale/partial/pending catch-up and the daemon timer remain enabled. Subject to the separate cooldown, archive lock and failed-run breaker; not a completion deadline.
CASS_AUTO_REFRESH_COOLDOWN_SECS 300 Minimum spacing between auto-spawned catch-up runs per data dir
MALLOC_ARENA_MAX 2 for background children glibc allocator arena cap that cass gives each background index child when you have not set it: stale-on-read catch-up, background repair and scheduled job steps. A full lexical rebuild of a 3.7M-message archive peaked at 13.1 and 17.4 GB anonymous RSS in two runs with the cap, versus 19.7 and 19.8 GB with glibc's default, with no consistent difference in wall time. Foreground cass index inherits your environment unchanged; set the variable yourself to override either way. Non-glibc allocators ignore it.
CASS_FTS_INLINE_BUDGET_SECS 300 Wall-clock one index run may spend writing the fts_messages SQL-fallback shadow inline. Past it the rest of the run skips the shadow (canonical rows and the Quill index still land, last_indexed_at advances) and the reason is recorded for doctor; the shadow is behind until a repair. Exists because fsqlite's FTS5 does O(table) work per statement on a large shadow (GH #413, frankensqlite#405/#406). 0 disables.
CASS_FTS_REPAIR_PAGE_BUDGET_SECS 120 Per-page budget for the paged shadow repair/rebuild (index --full, doctor --fix): a page over budget stops the repair truthfully (shadow left Partial, reason recorded) instead of wedging the run. 0 disables.
CASS_FTS_SHADOW_MAX_MESSAGES 100000 Largest canonical corpus (indexable message count) for which cass keeps the fts_messages SQL-fallback shadow at all. fsqlite's FTS5 rebuilds the whole shadow in memory on the first write after every writable open (about 32 KB of RAM per message: a 631k-message archive costs 20 GB and minutes before anything is indexed), so above the bound the index run drops the shadow before its first write (through a deferred-FTS5 connection), records why (status index.fallback_fts_repair, doctor fts_table), and does not recreate it until the corpus fits. Quill lexical search is unaffected; the SQL fallback scans messages. 0 disables the bound.
CASS_BACKGROUND_NICE 15 nice value cass index --background applies to itself (0..=19)
CASS_BACKGROUND_IONICE_CLASS 3 ionice class for cass index --background on Linux (3 = idle)
CASS_DAEMON_INDEX_INTERVAL_SECS 0 While the semantic daemon is resident, spawn an incremental background index every N seconds (900 recommended; 0 = off)
CASS_SCHEDULE_MAX_BACKFILL_BATCHES 200 Maximum backfill batch attempts shared across the nightly workers; each tier retains one loaded model while running its remaining allowance
CASS_SCHEDULE_MAX_LOAD_DEFERRAL_SECS 10800 Longest severe machine load may keep skipping scheduled incremental runs, counted from the last incremental run that completed; past it the run goes ahead at scheduler priority (the indexer still throttles itself). 0 = skip for load without limit
CASS_RESPONSIVENESS_MIN_USER_IDLE_SECS 0 Require N seconds of console idle (macOS HIDIdleTime) before the nightly job / scheduled backfill runs; fails open where unavailable
Indexing & Redaction
CASS_INDEX_REDACTION full Index-time secret redaction: full scrubs API keys/tokens/passwords/private keys from every persisted message, title, snippet, and metadata blob before they reach SQLite or the lexical index; off skips redaction for faster ingest. off means raw text is indexed — note that the original session files and the cass raw-mirror blobs (<data_dir>/raw-mirror/v1/) already contain the same raw text unencrypted on the same disk, so full protects the queryable surfaces (search results, exports, robot output), not disk-at-rest secrecy. Unrecognized values warn and behave as full.
CASS_REDACT_SECRETS 1 Legacy redaction toggle (0/false/off/no disables). CASS_INDEX_REDACTION takes precedence when both are set.
CASS_REDACT_MEMO_CAPACITY 4096 Entry cap for the per-worker redaction memo cache used during batched persist. Raise on very large, boilerplate-heavy corpora if eviction churn shows up in cass::redact::memo debug logs. Only strings the secret prefilter flags as candidate-bearing are memoized, and individual inputs over 64 KiB are never cached (bounds worst-case cache memory).
CASS_INDEX_STALL_DETECT_SECS 120 Seconds without measured phase progress before cass index emits stall diagnostics; 0 disables detection
CASS_INDEX_STALL_ABORT_SECS 300 Seconds without progress before an abort-eligible lexical stall exits 70; 0 keeps stalls report-only. Semantic phases are report-only unless CASS_INDEX_STALL_ABORT_ALL_PHASES=1
CASS_INDEX_STALL_ABORT_ALL_PHASES unset Opt-in (#437): set 1 to promote the stall watchdog's report-only warnings to a hard abort (exit 70) in ANY phase — including scribe/accumulate and semantic report-only lanes — once CASS_INDEX_STALL_ABORT_SECS elapses without progress. The finalize/persist grace thresholds still apply; the abort finalizes exactly like lexical-phase aborts (best-effort WAL checkpoint, lock release via startup recovery)
CASS_INDEX_FINALIZE_ABORT_SECS 1800 Larger abort grace applied while the indexer is inside the finalize WAL-checkpoint / rebuild-tail windows; 0 makes the finalize window report-only
CASS_INDEX_FINAL_WAL_CHECKPOINT_TIMEOUT_SECS 900 Wall-clock budget for the index run's final wal_checkpoint(TRUNCATE). If the checkpoint outlives it (an archive whose frankensqlite writable path loops, #382), the run still exits 0 after its publish, leaves the WAL for the next opener, and logs the remedy instead of hanging; 0 keeps the default
CASS_DOCTOR_WAL_CHECKPOINT_TIMEOUT_SECS 120 Wall-clock budget for cass doctor --fix's WAL checkpoint (archive_wal); on expiry the check reports fail with the deadline, #382 and the stock-sqlite remedy instead of never returning; 0 keeps the default
CASS_NO_COLOR unset Force monochrome TUI output
NO_COLOR unset Honored by TUI only when CASS_RESPECT_NO_COLOR=1
CASS_RESPECT_NO_COLOR unset Make TUI inherit global NO_COLOR
Lexical Rebuild Tuning (#483) These bound the full/resumed lexical (Quill) rebuild that cass index --full and stale-on-read repair run. Defaults are sized from the host; the responsiveness governor below can only lower them. A single-core, low-memory profile for a wedged or memory-starved archive is cass index --full --rebuild-profile bounded --json, which is the same as CASS_TANTIVY_REBUILD_WORKERS=1 CASS_TANTIVY_REBUILD_PAGE_PREP_WORKERS=1 CASS_TANTIVY_REBUILD_PIPELINE_CHANNEL_SIZE=1 CASS_TANTIVY_REBUILD_BATCH_FETCH_CONVERSATIONS=64 CASS_TANTIVY_REBUILD_COMMIT_EVERY_MESSAGE_BYTES=67108864 cass index --full --json; any of those variables you set explicitly overrides the preset's value. Quill's per-thread writer heap is sized separately, by CASS_TANTIVY_MAX_WRITER_THREADS (memory-aware by default); set it to 1 as well for the smallest footprint. The rebuild checkpoints to .lexical-rebuild-state.json at every durable commit and resumes from it on the next run; the connector scan phase has no equivalent per-file ledger yet (#426).
CASS_TANTIVY_REBUILD_WORKERS cores − reserved, clamped to 1..=64 Writer/shard-builder threads for the lexical rebuild. Reserved cores default to 0 (1 core), 1 (2–4 cores), 2 (5–15 cores), else cores/8 clamped to 2..=8; override the reservation with CASS_TANTIVY_REBUILD_RESERVED_CORES
CASS_TANTIVY_REBUILD_PAGE_PREP_WORKERS ceil(workers / 2) clamped to 2..=8 (1 when workers is 1) Threads that fetch and prepare conversation pages ahead of the writers. 1 serializes page prep
CASS_TANTIVY_REBUILD_BATCH_FETCH_CONVERSATIONS max(512, writer_threads × 128), capped at the 1024-conversation page Conversations per SQL message-fetch chunk (the unit of writer feeding). Lower it to cap peak RSS on archives with very large conversations
CASS_TANTIVY_REBUILD_INITIAL_BATCH_FETCH_CONVERSATIONS 32 Chunk size for the first durable slice only, so the first restartable checkpoint lands quickly; the rebuild ramps to the steady-state chunk after the first commit
CASS_TANTIVY_REBUILD_COMMIT_EVERY_CONVERSATIONS / _MESSAGES / _MESSAGE_BYTES 10000 / 800000 / 536870912 Steady-state durable-commit (checkpoint) interval; whichever bound trips first commits. Smaller values checkpoint more often at the cost of more segment merges
CASS_TANTIVY_REBUILD_INITIAL_COMMIT_EVERY_CONVERSATIONS / _MESSAGES / _MESSAGE_BYTES 2048 / 800000 / 134217728 Commit interval used until the first durable commit
CASS_TANTIVY_REBUILD_PIPELINE_CHANNEL_SIZE 4 Prepared pages that may queue between page prep and the writers
CASS_TANTIVY_REBUILD_PIPELINE_MAX_MESSAGE_BYTES_IN_FLIGHT fetch-chunk bytes × (channel + 1) Cap on message bytes held in flight across the pipeline; the governor's CASS_RESPONSIVENESS_MAX_INFLIGHT_BYTES applies on top
CASS_TANTIVY_REBUILD_STAGED_SHARD_BUILD_MEMORY_RESERVE_BYTES total memory / 8, clamped to 4–32 GiB (16 GiB when total memory is unknown) Free memory the lexical rebuild keeps in reserve, in bytes. Total memory is the host's, or the tightest cgroup memory.max when that is lower (cass status --json reports what set it under topology_budget.topology.memory_limit_source). While available memory is at or below the reserve, the rebuild stays on its smaller startup budget and starts a new staged shard build only when none is running; it slows down but does not stop. Under a cgroup limit the 4 GiB floor can be more than the room the rebuild has (in a 12 GiB scope it is a third of the limit), so set a smaller value there (#496). A stall report taken while the reserve holds the rebuild says so in its hint, and its rebuild_pipeline.memory_limit_source names what set the memory figures
CASS_TANTIVY_REBUILD_STAGED_SHARD_BUILD_EMERGENCY_MEMORY_RESERVE_BYTES total memory / 32, clamped to 1–8 GiB (4 GiB when unknown), never above the reserve At or below this much available memory, new staged shard builds pause; one small build is still admitted when none is running
CASS_RESPONSIVENESS_MAX_WORKERS host ceiling Hard ceiling the load/PSI governor applies to every indexing worker pool, including the rebuild pools above
CASS_RESPONSIVENESS_MAX_INFLIGHT_BYTES RAM/32, never below 536870912 and never above 16 GiB Governor ceiling on in-flight message bytes across indexing
CASS_RESPONSIVENESS_DISABLE unset Set 1 to disable the load/PSI governor and run at the configured sizes regardless of host pressure
Search & Cache
CASS_CACHE_SHARD_CAP 256 Per-shard LRU cache entries
CASS_CACHE_TOTAL_CAP 2048 Total cached search hits
CASS_CACHE_BYTE_CAP available memory / 128, clamped to 64 MiB–2 GiB Search-hit cache byte limit; 0 disables the byte guard
CASS_CACHE_EVICTION_POLICY lru Cache eviction policy: lru or s3-fifo
CASS_SEARCH_BUDGET_MS 120000 Robot search time budget; on expiry search exits 0 with budget.timed_out
CASS_AUTOMATIC_WILDCARD_FALLBACK_MAX_DOCS 10000 Automatic wildcard fallback for sparse results runs only on indexes with at most this many documents; 0 disables it
CASS_WARM_DEBOUNCE_MS 120 Warm-up search debounce
CASS_DEBUG_CACHE_METRICS unset Enable cache hit/miss logging
CASS_QUILL_QUERY_FUEL_BUDGET Quill default (10000000) Escape hatch for Quill's deterministic per-query work ceiling (GH #441). Zero or unparseable values keep the engine default. When fuel runs out on a hybrid query the lexical leg is dropped, the semantic leg still answers, and _meta.lexical_degrade_reason reports query_fuel_exhausted; lexical-only queries return an actionable hint. The durable fix for fuel exhaustion is a consolidated index (an incremental cass index folds fragmented generations in its maintenance pass; --full rebuilds from scratch), and cass now publishes Quill snapshots only on its own commits (no per-second visibility seals), which is what let segment counts grow into the hundreds on append-only archives
CASS_LEXICAL_MERGE_MAX_OUTPUT_BYTES 1073741824 (1 GiB) Maximum estimated output per lexical merge run, including the covered document-ID range. Oversized singleton segments remain unmerged. This is a merge-planning limit, not a total-process RSS ceiling. Positive byte values accept underscores; zero or invalid values keep the default. Independently of this cap, a merge run never holds more than 4,194,304 documents (Quill's per-term posting limit), and Quill's own tier merge is disabled, so archives with several million messages rebuild into several segments (GH #498).
CASS_LEXICAL_MAX_MESSAGE_CONTENT_BYTES 8388608 (8 MiB) Most text of any one message that the lexical index holds; the rest of that message (typically a pasted image or base64 blob) is not searchable. It never limits a conversation: every message of a long session is indexed, and rebuilds and incremental updates read long sessions in bounded chunks. Zero or invalid values keep the default.
CASS_INDEX_SKIP_DISK_HEADROOM_CHECK unset Skips the free-space preflight that cass index --full / --force-rebuild runs before starting, and the rebuild's free-space floor. The requirement is max(512 MiB, lexical_rebuild_basis_bytes * 9 / 4 - rebuild_staging_bytes + db_bundle_bytes / 16 + migration_copy_bytes): the basis is the live published index (a rebuild wrote 2.12x of it in measurement, the new generation plus the fold into one segment), or the database bundle when no live index exists to size the rebuild by; the database is charged a 1/16 growth allowance, and a whole copy only while the engine's one-time migration repair is pending (migration_copy_bytes). Merge-retired segments, retained publish backups and failed-rebuild quarantine bundles are reported but not charged, and a failed rebuild's leftover .rebuild-staging generation is credited against the lexical charge, because the next rebuild resumes into it or clears it first. A refusal names the rule's terms and what cass index --gc, cass doctor cleanup and cass lexical-quarantine --plan would reclaim. While running, a rebuild stops (exit 14, kind storage, retryable) once free space where it writes falls below 512 MiB, keeping what it committed so the rerun resumes, and it skips the final fold into one segment when there is no room for it. Query the requirement before a run with cass doctor --json | jq .storage_pressure.full_rebuild_readiness, which shows required_bytes, available_bytes, shortfall_bytes and each input (GH #496). Set to 1 only when you know the disk can hold the rebuild.
CASS_SEARCH_EXACT_TOTAL_COUNT_MAX_DOCS 5000000 (50000 in v0.9.0 and earlier) Largest index (in documents) for which a full result page still reports an exact total_matches; above it the count is limit + 1, a lower bound (_meta.cursor_manifest.count_precision says which). 0 disables exact counting. See Match Counts: Exact or Lower Bound
CASS_SEARCH_BUDGET_MS 120000 Default robot-mode search budget when --timeout is not given. A search that runs out of it exits 0 with budget.timed_out: true, which means "no complete answer", not "no matches"
CASS_SEARCH_ACTIVE_REBUILD_WAIT_MS 30000 How long a human-mode search, or a robot search whose index is still readable, waits for an active lexical rebuild before returning exit 7 index-busy. With --timeout, the wait also stops at nine tenths of the time remaining. A robot search with no searchable generation does not wait
CASS_INCREMENTAL_AUTHORITATIVE_LEXICAL_REPAIR_MAX_DB_BYTES 1073741824 (1 GiB) Largest archive (database plus WAL) that a search may repair inline; plain cass index compares the database file alone against the same value to decide whether to defer the authoritative lexical repair to --full. Over it, search refuses with maintenance-required and starts a detached cass index --full --background (see When the Index Is Missing)
Semantic Search
CASS_SEMANTIC_EMBEDDER auto Select hash, minilm, multilingual-minilm, or explicit external (also requires endpoint consent)
CASS_EXTERNAL_EMBEDDINGS 0 Consent to text transmission with explicit external selection: 1/true enables, 0/false disables
CASS_EXTERNAL_EMBEDDING_URL unset Required /v1/embeddings endpoint: HTTPS or loopback HTTP; no URL credentials, query or fragment
CASS_EXTERNAL_EMBEDDING_MODEL unset Required response model identity, at most 512 bytes without control characters
CASS_EXTERNAL_EMBEDDING_DIMENSION unset Required output dimension, 1..16384; vectors must be finite and unit-normalized
CASS_EXTERNAL_EMBEDDING_REVISION 1 Stable operator revision identifying the vector space, nonempty and at most 512 bytes without control characters
CASS_EXTERNAL_EMBEDDING_API_KEY unset Optional bearer credential; configured values are not emitted by discovery or provider diagnostics
CASS_EXTERNAL_EMBEDDING_BATCH_SIZE 64 Inputs per external request, 1..128; the byte cap also applies
CASS_EXTERNAL_EMBEDDING_MAX_REQUEST_BYTES 262144 Encoded JSON request cap, 1024..4194304 bytes; oversized inputs are refused before transmission
CASS_EXTERNAL_EMBEDDING_TIMEOUT_MS 30000 Per-request deadline, 1..120000 milliseconds; bounds an in-flight request after cancellation
CASS_EXTERNAL_EMBEDDING_MAX_RETRIES 0 Explicit transient-request retries, 0..5; implicit protocol retries are disabled
CASS_SEMANTIC_PROGRESS_JSONL unset Absolute path to a JSONL file the semantic backfill appends one event per transition to (selection_*, packet_replay_*, embed_batch_*, staging_write_*, checkpoint_save_*, publish_*, error, cancelled, complete). Each line carries timestamp, phase + sub-phase, batch/row counters, byte counts, elapsed-since-start, and a cheap RSS estimate. Silent when unset. Best-effort writes — failures log at debug and never crash a backfill. See cass#257.
CASS_SEMANTIC_EMBED_BATCH_WARN_AFTER_MS 30000 Warn when one embedder batch takes more than 30s. Derived from cass#257 boxed quality-corpus telemetry: 60 MiniLM batches averaged ~5.95s, so the default is about 5x the observed healthy batch. Set 0 to disable warnings.
CASS_SEMANTIC_EMBED_BATCH_FAIL_AFTER_MS 300000 Abort a semantic backfill batch after a single embedder batch returns if it exceeded 5 minutes. Derived as a conservative ~50x multiple of the cass#257 healthy 128-doc MiniLM batch average. Set 0 to disable failure.
CASS_SEMANTIC_MAX_MESSAGES_PER_CHECKPOINT 10000 Soft cap for cass models backfill: checkpoint after a whole-conversation prefix near 10k selected messages. Derived from cass#257 high-volume proof (7,618 docs in ~6 minutes) plus the original 10k-message workaround. Set 0 for no message cap.
CASS_SEMANTIC_MAX_BYTES_PER_CHECKPOINT 8388608 Soft cap for cass models backfill: checkpoint after a whole-conversation prefix near 8 MiB selected content. Derived from cass#257 high-volume proof (4.3 MiB selected bytes) with about 2x headroom. Set 0 for no byte cap.
CASS_SEMANTIC_MAX_BACKFILL_RSS_MB 0 Process-memory cap in MiB for cass models backfill: once resident memory reaches it after a saved checkpoint, the run stops instead of starting another batch, and a rerun resumes. It is checked between batches, so one batch can exceed it; the batch size and the two checkpoint caps above bound a batch. 0 means no cap.
TUI
TUI_HEADLESS unset Disable interactive features
CASS_ALLOW_DUMB_TERM unset Allow TUI startup even when TERM=dumb
CASS_DISABLE_ANIMATIONS unset Disable UI animations
EDITOR then $VISUAL, then code External editor command (line-number flags are chosen per editor)
Updates
CODING_AGENT_SEARCH_NO_UPDATE_PROMPT unset Disable update notifications
Connector Overrides
CASS_AIDER_DATA_ROOT ~/.aider.chat.history.md Aider history location
CASS_OMP_DATA_ROOT unset OMP-only archive/store root; assigns OMP identity and preserves the exact sessions root for resume
PI_SESSIONS_DIR unset Exact Pi-Agent sessions directory
PI_CODING_AGENT_DIR unset Shared pi-family agent home; ambiguous paths remain Pi-Agent-owned in CASS (use CASS_OMP_DATA_ROOT for OMP-only ownership)
PI_CODING_AGENT_SESSION_DIR unset Exact OMP sessions directory
OMP_PROFILE unset Active OMP profile; takes precedence over PI_PROFILE
PI_PROFILE unset Legacy OMP profile selector when OMP_PROFILE is unset
PI_CONFIG_DIR .omp Home-relative OMP config directory name
XDG_DATA_HOME platform default OMP XDG data root ($XDG_DATA_HOME/omp) when present; also moves cass's own data dir to $XDG_DATA_HOME/coding-agent-search when CASS_DATA_DIR is unset
CASS_MUSE_DATA_ROOT ~/.local/share/muse Muse Code data root
CODEX_HOME ~/.codex Codex data directory
GEMINI_HOME ~/.gemini/tmp Gemini CLI session directory
OPENCODE_STORAGE_ROOT XDG data dir, XDG config dir, then ~/.local/share/opencode/storage OpenCode storage (fixed candidates; no home scan)
CHATGPT_ENCRYPTION_KEY unset Base64-encoded AES key for ChatGPT v2/v3