# CLI sources

The CLI discovers source locations before it parses transcript content. Discovery returns paths and source kinds so the setup flow can ask what you approve first.

## Supported sources

| Source | Canonical policy value | Local store |
| --- | --- | --- |
| Claude Code | `claude_code` | `~/.claude/projects` |
| Cursor | `cursor` | global and workspace `state.vscdb` stores; `~/.cursor/projects/*/agent-transcripts/**/*.jsonl` |
| Codex | `codex` | `~/.codex/{sessions,archived_sessions}/**/*.jsonl` and `*.jsonl.zst` |
| Gemini CLI | `gemini_cli` | `~/.gemini/tmp/**/chats` session JSON/JSONL |
| OpenCode | `opencode` | `$XDG_DATA_HOME/opencode/opencode.db`, `~/.local/share/opencode/opencode.db`, or `~/.opencode/opencode.db` |

User-facing aliases such as `claude` and `gemini` map to canonical policy values.

## Other histories and exports

Cline histories and Claude chat exports (`conversations.json`) are not supported
by the CLI's local discovery or upload commands. The CLI has no general import
command. Claude Code transcripts are a different format from Claude chat exports;
do not rename an export or relabel it as a supported CLI source.

Claude chat exports, Cline histories, T3 Code stores, and Antigravity artifacts do not currently have a supported import path. Keep them local. Antigravity files under `~/.gemini/antigravity` are not Gemini CLI conversations and are excluded from setup counts and scanning.
Supported formats still require source approval, privacy review and upload
eligibility; format compatibility does not establish licensing rights.

## Claude Code transcripts

Claude Code scanning reads every session transcript under `~/.claude/projects`,
including sub-agent transcripts (`<session>/subagents/agent-<id>.jsonl`) and
workflow sub-agent transcripts
(`<session>/subagents/workflows/wf_<id>/agent-<id>.jsonl`). Each sub-agent is its
own trace keyed by its agent id and linked to its parent session. Workflow
sidecars that are not conversations, such as `journal.jsonl`, are skipped.

## Codex and Gemini transcripts

Codex scanning includes both active and archived rollouts, including Zstandard
compressed `.jsonl.zst` files. Decompression streams into the transcript reader;
no plaintext copy is saved. A corrupt compressed file appears in scan issues.

Setup counts file-backed sources by supported transcript paths before parsing
content. These are candidate transcript-file counts, not a guarantee of valid
or uploadable conversations. Gemini CLI counts only session files in
`~/.gemini/tmp/**/chats`; settings, logs, and Antigravity artifacts are excluded.

## Cursor stores

Cursor scanning checks `~/.cursor/state.vscdb` plus the global and workspace
stores in Cursor's user directory for the platform:

| Platform | Stores |
| --- | --- |
| macOS | `~/Library/Application Support/Cursor/User/{globalStorage,workspaceStorage/*}/state.vscdb` |
| Linux | `$XDG_CONFIG_HOME/Cursor/User/{globalStorage,workspaceStorage/*}/state.vscdb` (default `~/.config`) |
| Windows | `%APPDATA%\Cursor\User\{globalStorage,workspaceStorage\*}\state.vscdb` |

Cursor also discovers the JSONL transcript mirrors under
`~/.cursor/projects/*/agent-transcripts`, including nested subagents. These
mirrors contain user/assistant text and tool call inputs. Cursor omits tool
outputs, model metadata, and native timestamps from this format; the CLI keeps
those fields unknown (unknown dates use the epoch). JSONL mirrors use the
existing `cursor_sqlite` source label and `cursor` approval policy. See
[Cursor's transcript example](https://forum.cursor.com/t/jsonl-format-should-fully-record-the-tool-use-information/154777)
and [Cursor's explanation of omitted tool outputs](https://forum.cursor.com/t/accessing-the-full-agent-transcript-in-cursor/157311/5).

Cursor SQLite and OpenCode scanning use the system `sqlite3` command. If `sqlite3` is
missing, or a store cannot be read, the CLI skips that store instead of uploading
partial unknown data and names it under `scanIssues` in `upload --dry-run --json`
(and in the human-readable plan). `selltraces doctor` reports whether `sqlite3` is
available.

OpenCode reads top-level sessions separately and batches their message/part
rows by bytes and row count. Oversized individual SQLite values are read in
bounded slices, including Cursor composer values. Cursor discovers composer keys first, then
reads and yields one conversation before loading the next; direct conversations
and header/bubble conversations can coexist in the same store. Unknown
timestamps use the epoch so repeated scans preserve the reviewed payload.
Subprocess buffer limits and
timeouts are reported immediately without retrying the same oversized query.

SellTraces does not discover or ingest `~/.traces/traces.db`; that path is not a
supported source policy value. The SellTraces-owned local store under
`~/.selltraces/traces.db` is used only for local trace-index and repeat-sync
state.

## Trace size

Each trace must fit, on its own, inside one upload request (4 MB of serialized
JSON, under the platform's 4.5 MB request limit). A longer session is not
skipped: while its transcript is read line by line, it is split at message
boundaries into consecutive segments of at most 3.5 MB of messages, uploaded as
`<session id>#1`, `#2`, and so on, so a very large session is never loaded whole.
Earlier segments stay the same as a session grows, so a later upload sends only
the segment that changed. A single message too large for one upload keeps a
prefix of its text ending with `[selltraces truncated N characters]`.
`upload --dry-run --json` reports `segmentedSessionCount`, `segmentCount`, and
`truncatedMessageCount`.

## Scan resource use

Scanning defaults to at most two concurrent workers and leaves a CPU core for
progress and uploads. For a machine with spare memory, set
`SELLTRACES_SCAN_WORKERS=4` to raise the cap. Set it to `1` for one task at a time;
`0` disables worker threads. The override still respects available CPU cores.
Larger values can increase memory and CPU use when histories contain large
sessions.

## Source policy

The saved policy lives at:

```text
~/.selltraces/config.json
```

It records:

- approved sources
- approved projects
- projects kept private
- case-insensitive blocked terms

The policy is applied by `upload`, `upload --dry-run`, onboarding history
uploads, and the compatibility `preview`/`sync` commands.

## Filtering order

Every upload plan applies local controls in this order:

```mermaid
flowchart LR
  A["discovered trace"] --> B["source approved?"]
  B --> C["blocked term match?"]
  C --> D["local PII preflight"]
  D --> E["already synced?"]
  E --> F["duplicate source/content?"]
  F --> G["upload chunk"]
```

Source-policy filtering happens before blocked-term and PII checks so the reported skip reason reflects the earliest control boundary.

## Repeat uploads

Successful uploads are recorded in:

```text
~/.selltraces/traces.db
```

The SQLite ledger stores preflighted content hashes, source labels, source ids,
token counts, and preliminary local value estimates. Later runs skip identical
traces as `already synced` while still allowing changed ongoing sessions to be
reconsidered. Older installs may have `~/.selltraces/sync-state.json`; that file
is legacy state migrated into the SQLite ledger on first open.
