spiracha
v2.15.0
Published
Browse and expose local Codex, Claude Code, Command Code, Grok, Grok Bot, Kiro, Qoder, Cursor, Antigravity, FX, MiniMax Code, and OpenCode conversation history through a local UI and stable data API.
Maintainers
Readme
spiracha
Spiracha is a Bun package with a local TanStack Start UI, a small CLI, and a direct data client for browsing and exporting agent conversation history from Codex, Claude Code, Command Code, Cline, Grok, Grok Bot, Kiro, Qoder, Cursor, Antigravity, FX, MiniMax Code, and OpenCode.
The legacy exporter, MCP server, and Codex plugin surfaces were removed in the 2.0 hard cut. Spiracha now exposes the UI, a stable local data API, and the API-driven CLI below; client-specific workflows such as review collection belong in the client that calls the API.
See the documentation index for API/client references, configuration, privacy, recovery, and contributor guides.
Quick Start
To run the packaged app:
bunx spiracha serveThe production command serves the bundled UI and API on 127.0.0.1:3000 (or the PORT you set).
For repository development:
bun install
bun startOpen the local URL printed by Vite.
The local CLI, UI server, and spiracha/client require Bun 1.4.2 or newer. The spiracha/payload converter uses standard Web APIs and also runs in Node.js 22+, modern browsers with Web Crypto, and Cloudflare Workers. Set PORT to choose a different port, for example PORT=4100 bunx spiracha serve.
Local security
Spiracha binds to loopback 127.0.0.1 and is intended for same-user local access; it does not provide remote authentication or rate limiting. Browser requests that send an Origin must match the server origin or another loopback spelling on the same scheme and port; Origin: null is rejected. Runtime cache and export directories are private owner-only directories, and symlinked or non-regular export files are rejected.
CLI
The packaged CLI is a thin client over Spiracha's normalized conversation API. The bare spiracha examples below assume its binary is on your PATH; after the Quick Start, use bunx spiracha in place of spiracha for the same commands. With no arguments, it prints help:
spirachaUse these commands:
spiracha serve
spiracha list [--cwd <path>]
spiracha list --source grok-bot
spiracha get <ref>
spiracha export <ref> [--raw] [--output <path>]
spiracha evidence <ref> --lens <file> [--output <path>]
spiracha timings <ref> [--format json|md] [--output <path>] [--spans <file>]
spiracha outline <ref> [--from <id>] [--to <id>] [--format md|json]
spiracha spans --type <type> [--format md|json|csv]<ref> may be a Spiracha or native source link. spiracha/client is the public Bun SDK for scripts and applications; import it instead of shelling out to the CLI when integrating Spiracha.
Install the SDK in another Bun application with bun add spiracha. list and get write JSON; export and evidence write Markdown to stdout unless --output is provided. timings reports provider-neutral turn, plan-step, commit, tool, and reader-span wall-clock timings; outline prints a collapsed time-ordered outline for picking span boundaries, and spans --type <type> compares spans across span files as JSON (default) or Markdown tables; the Analytics page renders the same result for any conversation ref. See docs/analytics-measurements.md. export --raw writes the original source JSON/JSONL/blob bytes and does not accept message selection. Run spiracha --help for filtering and pagination options.
What It Does
- Browse local conversations across Codex, Claude Code, Command Code, Cline, Grok, Grok Bot, Kiro, Qoder, Cursor, Antigravity, FX, MiniMax Code, and OpenCode.
- Import exported ChatGPT, Claude, Gemini, Grok, Qwen, GLM, Amazon Nova, DeepSeek, Mistral, Perplexity, and compatible web conversations by dropping JSON files onto the Web page.
- Group each integration into workspace inventories with local search and source-specific export/delete actions where supported.
- Search Codex projects from the app shell, with results delegated to the shareable
/codex?q=...inventory filter. - Inspect source-specific detail pages with transcript, tool, reasoning, metadata, raw event, export, and delete flows where supported by the source. Transcript controls can filter user messages, commentary, tools, extra events, raw JSON, and text matches. Codex thread detail includes optional live updates isolated from page-loading connections, a tool-focused activity view, recorded goals, and sandbox policy.
- Export transcripts from the UI as Markdown, text, or zip bundles with source-specific commentary/final-answer filtering. The last submitted export choices persist across dialog openings; canceled drafts do not.
- Export source-independent focused evidence: bounded failure/retry/tool episodes selected by a reusable JSON lens, with trace IDs and an omission ledger.
- Review project-scoped Codex analytics, including token and tool distributions plus deterministic optimization findings for context leakage, repeated work, broad reads, timed-out waits, and delegation patterns.
- Adjust transcript path conversion and username redaction from Settings; the app shell also provides light/dark theme controls.
- Expose a stable API for local clients that need normalized conversation metadata and message payloads.
- Resolve Spiracha UI links and native source links into normalized
{ source, id }references for cross-thread context lookup.
Large bodies are loaded behind the lightweight metadata path where needed. Cursor and Antigravity detail routes fetch transcript/artifact documents after browser hydration; imported Web detail routes fetch normalized transcript events after hydration; and oversized Codex rollouts expose a deferred preview/full-load choice instead of inflating the initial route payload.
Web chat imports
Open /web and drop one or more JSON exports. Spiracha parses mapping-based ChatGPT-style envelopes, native Claude and Grok exports, and ordinary role/content message arrays at runtime. Provider detection uses content and model metadata before the file name, and recognizes ChatGPT, Claude, Gemini, Grok, Qwen, GLM, Amazon Nova, DeepSeek, Mistral, and Perplexity hints. Assistant reasoning remains separate from the answer, and embedded research/tool activity becomes normalized tool events where the source exposes enough structure. A single parsed conversation opens directly; multiple conversations remain in a searchable, paginated list and link to /web-chats/:conversationId.
Unsupported or malformed files return per-file errors while valid files in the same import remain available. Web conversation detail pages expose the normalized transcript, metadata, transcript controls, and Parsed JSON; they do not export or delete the original source file.
Each file is limited to 25 MB, with at most 20 files and 100 MB per import. Spiracha retains normalized conversations in server memory using a 128 MiB input-byte accounting budget, not an exact JavaScript heap limit, and evicts the oldest retained entries first; imports disappear when evicted or when the Spiracha server stops. See Web import behavior for identity, limits, and fidelity. Each detail route uses a generated opaque ID and keeps the original provider conversation ID separately when one is present. Web imports are a UI workflow and are not added to the stable data API, CLI, or stable source registry.
Stable Data API
The API is served by the local UI server under /api/v1. Start the packaged server with spiracha serve.
spiracha serveCommon read endpoints:
GET /api/v1/sources
GET /api/v1/conversations?cwd=/absolute/project&include_messages=true
GET /api/v1/conversations?source=grok-bot
POST /api/v1/conversation-query
GET /api/v1/conversations/:source/:id
GET /api/v1/conversations/:source/:id/export
GET /api/v1/conversations/:source/:id/raw
HEAD /api/v1/conversations/:source/:id/raw
POST /api/v1/conversations/:source/:id/evidence
POST /api/v1/conversation-payload
DELETE /api/v1/conversations/:source/:id
POST /api/v1/conversations/delete
POST /api/v1/conversations/export
GET /api/v1/resolve?ref=<url-or-deeplink>The default list selector is last_final_answer, which keeps clients fast and small. Use message_selector=all when a client needs the full normalized thread. Claude Code and Kiro lists coalesce recognized compacted continuations under the parent conversation ID. Reading, exporting, generating focused evidence for, or deleting that parent operates on the complete lineage. A direct child-segment ID remains available as a physical-session lookup and affects only that segment.
POST /api/v1/conversation-payload accepts { "payload": <JSON-or-JSONL>, "source": "<optional-source>", "file_name": "<optional-name>", "message_selector": "<optional-selector>" } and returns the same { "data": ConvertedConversation[] } shape as the in-memory SDK converter. The artifacts entries and their Markdown content are returned unchanged.
Conversation lists use opaque keyset cursors ordered by update time, source, and conversation ID. Pass meta.next_cursor unchanged with the same filters to request the next page. The 2.0 offset cursor format is intentionally unsupported; clients must begin a fresh traversal after upgrading.
List requests accept a positive limit up to 200, optional updated_after_ms and updated_before_ms windows, source filters, and include_messages. Message bodies are omitted unless include_messages=true; the list default remains last_final_answer when bodies are requested. Grok Bot inventories are roster-only even when include_messages=true; open a detail route for transcript messages. Workspace sources require cwd; global sources such as Grok Bot are listed without cwd. An ordinary all-source request with cwd never mixes in global chats.
Workspace matching is lexical and performs no filesystem reads, so missing and network-mounted transcript paths cannot delay collection. Symlink aliases are intentionally not resolved; callers that require alias equivalence should pass the canonical workspace path recorded by the source.
Batch delete requires an explicit source and ID list. Non-throwing mixed results return deletedIds, missingIds, and per-ID results in a 200 body; an all-missing batch returns 404. An adapter exception can instead return 500 after some deletions have committed; batch deletion is not transactional. Inspect source state and recovery records before retrying. See Deletion safety and capabilities, including the Cursor-only scope of delete_session_files=false. Batch export also requires an explicit source and ID list, but is atomic: any missing ID returns an error instead of a partial archive. Cursor deletes accept delete_session_files=false on the single-delete query string or batch-delete JSON body. This removes Cursor database records while preserving its transcript directories; preserved source files can make the conversation discoverable again. The Cursor UI exposes the same choice and keeps transcript deletion selected by default. Cursor must be closed before a write; workspace cleanup failures can return a bounded, single-use retry token while filesystem paths remain server-side.
Example:
curl 'http://localhost:3000/api/v1/conversations?cwd=/Users/me/workspace/fgh&include_messages=true'Abbreviated response envelope (required nullable fields and message identity/order metadata are omitted for readability; see ConversationDetail and ConversationMessage in src/lib/conversation-data/types.ts for the complete contract):
{
"data": [
{
"source": "codex",
"id": "019ecbfc-8a84-7421-ab3b-35653feb7896",
"title": "Review thread",
"workspacePath": "/Users/me/workspace/fgh",
"messages": [
{
"role": "assistant",
"phase": "final_answer",
"text": "Final review result..."
}
],
"deepLinks": {
"ui": "/threads/019ecbfc-8a84-7421-ab3b-35653feb7896",
"native": "codex://threads/019ecbfc-8a84-7421-ab3b-35653feb7896",
"spiracha": "spiracha://conversation/codex/019ecbfc-8a84-7421-ab3b-35653feb7896"
}
}
],
"meta": {
"has_next": false,
"next_cursor": null
}
}For direct access from Bun scripts and CLIs, use the public spiracha/client Bun SDK rather than shelling out. Local mode reads the source data without starting the UI server:
import { createConversationClient } from 'spiracha/client';
const client = createConversationClient({ mode: 'local' });
const page = await client.listConversations({
cwd: process.cwd(),
includeMessages: true,
messageSelector: 'last_final_answer',
});Library and CLI use is quiet by default. Set SPIRACHA_TRANSCRIPT_LOAD_LOGS=1 or
SPIRACHA_OPENCODE_DB_LOGS=1 only when diagnosing loader or OpenCode database timing.
Malformed local records emit aggregated or first-sample warnings rather than one warning per record, so repeated list/detail loads do not flood stderr. Incompatible OpenCode table or column layouts fail with OPENCODE_DB_INCOMPATIBLE instead of appearing as empty history.
The public client exposes the same operations in local and HTTP modes: source listing, scoped listing, detail reads, raw/Markdown/evidence/zip exports, source-owned deletes, and reference resolution.
client.exportConversationRaw({ source, id }) returns { blob, fileName, mimeType } (or null when unavailable); blob contains the original source JSON/JSONL/blob bytes, with the native filename and MIME type in local mode. The HTTP /raw endpoint and UI downloads preserve the sanitized native filename and extension, such as .jsonl or .blob, together with the original bytes and MIME type. Raw ZIP members use deterministic, extension-preserving collision suffixes. The UI transports small single raw downloads as base64-decoded bytes, not UTF-8 text; large single downloads and batches use the private ZIP download lifecycle. Consumers must use the returned filename instead of assuming <source>-<conversation-id>.json. Raw exports never parse, filter, normalize, or reserialize the source file. Grok Bot exports the account-scoped .blob replica byte-for-byte. Grok Bot chat detail pages include a Raw tab for normalized chat and transcript-event JSON, and the normal export dialog supports JSON, Markdown, text, and zip downloads. Grok Bot deletion goes through the authenticated gateway and leaves local app persistence untouched; the app synchronizes the deletion (see Grok Bot deletion). Sources whose conversation exists only inside a shared database, or which have no standalone JSON transcript, return null from the client and 404 from HTTP rather than synthesizing a replacement. The UI export dialog still offers those sources (currently OpenCode) a separate JSON (normalized) download: Spiracha's normalized conversation plus the session's complete stored rows (session, project, messages, parts and other session-scoped tables) with their original timestamps. It is not the source's original bytes, and it never includes share secrets.
Focused evidence is a deterministic, lossy Markdown export for qualitative DX analysis. It does not change full-transcript exports. See Focused evidence lenses for the complete lens schema, bounds, local and HTTP examples, UI workflow, privacy behavior, omission accounting, and performance limits.
Convert supplied JSON or JSONL
convertConversationPayload is an in-memory SDK function for data your application already holds. Import it from spiracha/payload for portable conversion; this subpath ships compiled JavaScript and TypeScript declarations in the same spiracha package. Existing Bun callers can also use the export from spiracha/client. It accepts a parsed JSON object/array or the text of a JSON/JSONL export. It does not read source applications, follow file paths, contact a server, or retain imports in the Web UI.
import { convertConversationPayload } from 'spiracha/payload';
const conversations = await convertConversationPayload({
payload: { model: 'gpt-5', messages: [{ role: 'assistant', content: 'Hello' }] },
messageSelector: 'all',
});
console.log(conversations[0].markdown);
const fromFile = await convertConversationPayload({
payload: await uploadedFile.text(), // A browser File, or supply JSON/JSONL text directly.
// Supply source when an export's structure cannot uniquely identify its origin.
source: 'codex',
});Each result contains the detected source, id, title, model ID when available, timestamps, workspace metadata, normalized messages, artifacts, and markdown. With no explicit source, the converter tries every native payload adapter first. Exactly one native match wins; multiple native matches are ambiguous and require a source hint, even if the generic Web parser could also accept the shape. Versioned dot exports are claimed before broad inference and fail closed on malformed records. Other native parser rejections are ignored during this inference pass; if no native adapter matches, the converter falls back to Web inference. Markdown uses the stable API's model labels and message selectors (all, last_assistant, last_final_answer). Embedded artifacts are included in Markdown and also returned separately; ChatGPT Deep Research reports preserve their exact report body, while Gemini reports include their numbered Works cited entries. Multiple Web conversations return multiple results.
The optional fileName supplies a Web provider hint; it is never opened. Payloads are limited to 25 MB. Invalid options, malformed JSON/JSONL, unsupported or ambiguous formats, and incomplete exports throw ConversationPayloadError with a machine-readable code. Versioned dot visible-transcript JSONL is supported as a payload-only format, with coverage and per-message provenance preserved; its current configured model is never backfilled onto historical messages. Raw Claude Code session JSONL is supported (one conversation per session ID); Command Code is explicitly unsupported. Claude Web exports remain supported. Stable local-source support does not imply supplied-payload support. Sources that store content in multiple files, databases, or encrypted binary data require a self-contained decoded JSON export, including any necessary message/tool bodies.
Use artifacts[].content for a standalone embedded report, including exact ChatGPT Deep Research bodies and Gemini Works cited; markdown is the entire conversation plus artifacts. createdAtMs and updatedAtMs are nullable Unix epoch milliseconds on the conversation. Individual artifacts do not have timestamps. model is an optional string, with display labels formatted in Markdown rather than separate provider/name/version fields.
See Payload conversion reference for current support, error codes, size checks, identity, and artifact behavior. The same conversion is available through POST /api/v1/conversation-payload for clients that already hold the JSON or JSONL payload but do not run the converter in process. It does not add Web imports to the stable source registry or UI import store.
Codex analytics
The /analytics view can scope results to one project or all projects. It reports thread and token totals, average and median thread size, archive and web-search counts, model/client/reasoning distributions, tool usage, retained tool-output bytes, full-context forks, and timed-out waits. Optimization findings are deterministic signals from local rollout records; they describe retained context and workflow patterns, not provider billing or automatic recommendations to apply.
Source Locations
| Source | Default location | Primary override |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Codex | shared Codex DB probe list | SPIRACHA_CODEX_DB |
| Claude Code | ~/.claude/projects | SPIRACHA_CLAUDE_CODE_DATA_DIR, SPIRACHA_CLAUDE_CODE_PROJECTS_DIR |
| Cline | ~/.cline/data (sessions below this directory) | SPIRACHA_CLINE_DATA_DIR |
| Grok | ~/.grok/sessions | SPIRACHA_GROK_HOME, SPIRACHA_GROK_SESSIONS_DIR |
| Grok Bot | ~/Library/Application Support/Grok Bot/sand-client-persistence | SPIRACHA_GROK_BOT_PERSISTENCE_DIR |
| Kiro | ~/Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent/workspace-sessions | SPIRACHA_KIRO_DATA_DIR, SPIRACHA_KIRO_WORKSPACE_SESSIONS_DIR |
| Qoder | ~/Library/Application Support/Qoder/User/globalStorage/state.vscdb, ~/Library/Application Support/Qoder/User/workspaceStorage, and ~/Library/Application Support/Qoder/SharedClientCache/cli/projects | SPIRACHA_QODER_USER_DIR, SPIRACHA_QODER_GLOBAL_STATE_DB, SPIRACHA_QODER_WORKSPACE_STORAGE_DIR, SPIRACHA_QODER_CLI_PROJECTS_DIR |
| Cursor | ~/Library/Application Support/Cursor/User on macOS | SPIRACHA_CURSOR_USER_DIR, SPIRACHA_CURSOR_PROJECTS_DIR |
| Antigravity | ~/.gemini/antigravity-ide, ~/.gemini/antigravity-cli, and ~/.gemini/antigravity | SPIRACHA_ANTIGRAVITY_DIRS, SPIRACHA_ANTIGRAVITY_DIR |
| FX | ~/.fx | SPIRACHA_FX_DATA_DIR |
| MiniMax Code | ~/.minimax/v2/sessions and ~/.minimax/v2/sqlite/runtime-state.sqlite | SPIRACHA_MINIMAX_CODE_DATA_DIR, SPIRACHA_MINIMAX_CODE_SESSIONS_DIR, SPIRACHA_MINIMAX_CODE_RUNTIME_DB_PATH |
| Command Code | ~/.commandcode/projects | SPIRACHA_COMMAND_CODE_DIR, SPIRACHA_COMMAND_CODE_PROJECTS_DIR |
| OpenCode | ${XDG_DATA_HOME:-~/.local/share}/opencode/opencode.db | SPIRACHA_OPENCODE_DATA_DIR, SPIRACHA_OPENCODE_DB |
| UI cache | ~/.cache/spiracha/ui-cache | SPIRACHA_UI_CACHE_DIR |
| UI exports | ~/.cache/spiracha/ui-exports | SPIRACHA_UI_EXPORT_DIR |
Cache and export lifecycle
Spiracha bounds temporary disk use by age and total retained bytes. Values are non-negative integer byte or millisecond counts; invalid values fail startup/request handling instead of silently falling back.
| Variable | Default | Purpose |
| ------------------------------------------ | -----------: | ------------------------------------------------------------------------------------ |
| SPIRACHA_UI_CACHE_BYPASS | 0 | Set to 1 to bypass UI JSON cache reads and writes during development. |
| SPIRACHA_UI_CACHE_MAX_AGE_MS | 86400000 | Maximum age of UI JSON cache entries. |
| SPIRACHA_UI_CACHE_MAX_BYTES | 268435456 | Total UI JSON cache ceiling; oldest entries are pruned first. |
| SPIRACHA_UI_EXPORT_MAX_AGE_MS | 86400000 | Maximum age of temporary downloadable exports. |
| SPIRACHA_UI_EXPORT_MAX_BYTES | 1073741824 | Total temporary export ceiling; oldest exports are pruned first. |
| SPIRACHA_UI_LARGE_EXPORT_THRESHOLD_BYTES | 134217728 | Size above which a single transcript export switches to a temporary zipped download. |
Codex fallback session indexes and rollout rows use bounded LRU caches. Claude Code, Kiro, and Cursor discovery use short-lived, bounded indexes with in-flight request coalescing and mutation invalidation. Kiro builds one validated session-ID index across execution storage, including nested layouts, instead of rescanning per session. Cursor indexes direct composer-id lookups instead of rescanning every workspace group. File identity metadata invalidates changed transcripts, source mutations invalidate affected entries immediately, and no raw source payload is persisted by these caches.
Cursor and Antigravity detail pages split metadata from large transcript/artifact documents. Codex thread metadata records whether a rollout is available, missing, or deferred; the UI can load a bounded preview, request the full transcript, or export directly. Temporary JSON cache and download files are created with private permissions under the user cache directory (~/.cache/spiracha/ui-cache and ~/.cache/spiracha/ui-exports by default) and pruned by age and total bytes.
Qoder live ACP hydration
Qoder detail/export reads first use persisted state and CLI transcript files. When those do not contain assistant messages and Qoder is running, Spiracha can connect to Qoder's local JSON-RPC ACP Unix socket, issue initialize and session/load, and collect the streamed session updates. The default socket is the Qoder SharedClientCache/qoder.sock; override it with SPIRACHA_QODER_SOCKET_PATH (or the legacy environment spelling SPIRACHA_QODER_SOCKET). Connection failures and timeouts fall back to the persisted transcript rather than preventing the session from loading.
Antigravity transcript contract
When an Antigravity conversation has a live trajectory database, Spiracha treats it as the authoritative transcript and merges any generated JSONL-only events by step index. This preserves early reasoning plus paired command inputs, call IDs, working directories, exit codes, and complete outputs that may be absent from generated logs. The same merged data powers the detail page, stable API, and Markdown/text exports.
Markdown transcript exports identify this parser contract with transcript_schema: antigravity-transcript/v2. The UI parser retains complete tool output in its event data and export, but bounds the rendered preview to 20,000 characters so a single large operation result cannot dominate the detail page.
Encrypted Antigravity transcripts use the macOS Keychain item Antigravity Safe Storage / Antigravity Key and the Electron-compatible saltysalt PBKDF2 derivation. Keychain access is reacquired for each protected server request; the raw secret is not stored in process-global state or returned to the browser. Non-encrypted transcripts do not require Keychain access, and other platforms report decryption as unsupported.
Codex Cloud login and analytics
Codex Cloud browsing uses the local Codex-managed ChatGPT login. SPIRACHA_CODEX_AUTH can select its auth file, and CODEX_BIN selects the Codex executable. After an HTTP 401, Spiracha asks the CLI to refresh once and rereads the login; the CLI may update its managed authentication file. Each Cloud HTTP attempt has a 30-second abort deadline. Missing CLI, failed refresh, timeouts, repeated 401, and malformed inventory errors are reported without including tokens or provider response bodies.
Agent-DX command metrics use conservative shell heuristics. Quoted examples, comments, and heredoc bodies do not count as executed gates or mutations; complex shell constructs can remain unclassified. Repository-after identities require recognizable Git command output. Missing CSV fields are empty cells; carriage returns are quoted and NUL bytes are rendered as printable escapes. Goal-span IDs encode an identity tuple as JSON and should be treated as opaque strings.
Codex browser database compatibility
Codex browser reads target the codex-state-5-thread-browse-v1 compatibility profile. The threads table and its browse columns are required; missing tables, missing columns, or invalid decoded row values produce an actionable compatibility error instead of a guessed result. The thread_dynamic_tools, thread_goals, and thread_spawn_edges tables are optional and are read when present, so older databases without those tables remain browseable.
Multi-table thread browse reads run inside one SQLite deferred read transaction. This gives each browse result a consistent database snapshot while allowing Codex's normal writers to continue; it does not claim crash-level atomicity across the main database, attached history databases, rollout files, or the session index. Destructive DB changes commit before optional session-file cleanup and synchronized session-index/Codex Desktop global-state cleanup. Global-state cleanup removes structural Recent/sidebar references, preserves unrelated prompt text, sets Codex's deleted-thread write-block flags, and reports what changed.
UI batch Codex exports use one batch browse pass and include a versioned spiracha-manifest.json in every successful archive. The manifest preserves requested ID order and records exported, missing, unreadable, and unstable entries. A batch succeeds when at least one selected thread is exportable; a single-thread export remains fail-fast. Active rollout files are copied to an attempt-local snapshot, checked by size, inode, and high-resolution timestamps, and retried once when they mutate during the copy.
Cursor SQLite access
SQLite retry boundaries return promises and use Bun.sleep between bounded attempts, allowing unrelated requests to progress during contention. Database callbacks remain synchronous: connections close and transactions complete or roll back before retry sleeps. Internal callers must await database reads and mutations; the synchronous helper contract has been removed.
Cursor reads use a retry-aware synchronous callback that opens a fresh read handle for each attempt and closes it before retrying. Cursor mutations use a same-database BEGIN IMMEDIATE transaction with the shared bounded SQLite retry policy and no stacked long busy_timeout. Missing writable databases fail closed instead of being created. Discovery is cached per user directory, coalesces concurrent scans, and maintains a composer-id index for direct detail lookup. Recovery and deletion keep cross-database compensation and filesystem cleanup outside retry callbacks; destructive discovery uses strict readers so exhausted locks cannot be mistaken for empty data. UI mutation entrypoints still require Cursor to be closed before writing because Cursor can rewrite its history on exit. Workspace cleanup can be retried with a short-lived opaque token after the database mutation has committed.
UI Routes
/for the Codex dashboard,/codexand/codex/$projectfor Codex inventory and project threads./threads/$threadIdfor Codex thread detail./claude-code,/command-code,/cline,/grok,/grok-bot,/kiro,/qoder,/cursor,/antigravity,/fx,/minimax-code, and/opencodefor source inventories.- Source detail routes include
/claude-code-sessions/$sessionId,/command-code-sessions/$sessionId,/cline-tasks/$taskId,/grok-sessions/$sessionId,/grok-bot-chats/$conversationId,/kiro-sessions/$sessionId,/qoder-sessions/$sessionId,/cursor-threads/$composerId,/antigravity-conversations/$conversationId,/fx-sessions/$sessionId,/minimax-code-sessions/$sessionId, and/opencode-sessions/$sessionId. /webfor JSON imports and a searchable in-memory list of imported conversations;/web-chats/$conversationIdfor parsed transcript, metadata, and normalized JSON.- FX workspace and detail pages support single, selected, and workspace-wide deletion. Deletion removes the session directory plus its session-index and latest-pointer entries while preserving workspace files and global FX command history.
- MiniMax Code workspace and detail pages support single, selected, and workspace-wide deletion. Deletion removes finalized session directories and authoritative runtime database rows while preserving generated workspace files and append-only observability logs.
/analyticsfor project-scoped Codex token totals, average and median thread size, archive counts, tool usage, model tokens, client sources, reasoning-effort breakdowns, and deterministic optimization findings./settingsfor transcript path conversion and username redaction. Export dialogs remember their own last submitted options, and focused-evidence lenses stay in the dialog rather than cookies.
Codex Live mode opens an SSE connection from the thread page. While connected, the server shares one bounded rollout-file monitor across every tab viewing that thread and releases it after the final client disconnects. The browser does not poll.
Development
bun test
bun run lint
bun run typecheck
bun run build
bun run coverage
bun run test:package
bun start
bun run test:uibun run coverage enforces at least 90% line coverage independently for the root Bun suite and the UI Vitest suite, and reports function coverage and per-file hotspots for follow-up.
Run one root test file with bun test src/lib/shared.test.ts. Run one UI test file with bun run test:ui --run src/ui/components/export-dialog.vitest.tsx.
bun run test:package launches the packaged bin/spiracha.ts entrypoint against an isolated fixture and checks the published UI boundary. bun run format applies all configured Biome formatting and lint fixes, including fixes classified as unsafe, such as Tailwind class sorting. Review the resulting diff. bun run lint checks without changing files.
bun start runs the UI development server. bun run build emits bundled client assets and a bundled server entrypoint; spiracha serve runs that built output. The published package ships the built client/server output, portable payload JavaScript/declarations, and the Bun SDK sources, not the UI source tree or Vite toolchain. Only fflate is a runtime dependency; the UI and build/test toolchain stays in devDependencies.
Spiracha has one application boundary: the stable API, server functions, browser route tree, and UI all resolve through one manifest and one dependency graph. Vite is a development/build tool; Vitest uses its normal Node runtime.
Package metadata is imported through the root #package-metadata package import alias and validated at module load. Server functions retain focused dynamic imports at the Bun-only boundary so database modules cannot leak into browser bundles; broad dynamic-import conversion is intentionally avoided.
Shared DTO, path, configuration, and error rules are documented in Data and runtime conventions.
TanStack Router generates src/ui/routeTree.gen.ts during development/build. Do not edit it manually; after adding or renaming route files, run bun run build (or start the dev server) and include the generated update.
Markdown and packaging
Spiracha's Markdown is deterministic generation and domain parsing. Bun 1.4's Bun.markdown was evaluated, but it is currently unstable for this contract, so Spiracha does not depend on it.
The hard-cut package keeps one spiracha bin, the stable spiracha/client, spiracha/types, and portable spiracha/payload exports, and the bundled UI/server runtime. It does not restore legacy CLI aliases, an MCP server, a Codex plugin, or a separate exporter package.
Breaking Consequences
- The only published
binentry isspiracha; no arguments show help,servelaunches the bundled local UI server, and the remaining commands call the stable local data client. - No
codex-chats,codex-chats-claude, or legacy export command remains. - CLI export/evidence flows use the stable normalized client and do not reintroduce source-specific exporter entrypoints.
- No MCP server or local Codex plugin remains.
- The internal Codex browser database module was split into focused database, query, dashboard, fallback-index, and mutation modules; the former monolith is not a supported import path.
- The former Qoder database module was split into storage, session-listing, and session-transcript modules; the former monolith is not a supported import path.
- Programmatic consumers should call the stable local HTTP API or import
spiracha/clientfrom Bun rather than shelling out. - Normalized conversation messages now always include
toolEvidence(nullfor non-tool messages); consumers that construct these DTOs must provide that explicit field.
Deletion recovery protocols: Codex, Cursor, Grok Bot, plus Command Code and Qoder receipts described in deletion safety. See concurrency for cancellation, source scheduling, and server tuning.
Grok Bot Markdown/text exports with metadata enabled include the roster creation date, last activity, roster update, replica save time, group description, participants, attachment names/sizes, and per-message timestamps. Dates use ISO 8601 UTC; unavailable dates are omitted. Replica save time is local persistence metadata, not conversation creation or message activity. The local replica may contain only part of the conversation history.
Source-adapter contract work
Start with the source-adapter contract specification; check current code and tests before treating any of it as implemented status. It distinguishes implemented foundations from target behavior. Current normalized-export defaults, deletion semantics, payload exclusions and source membership are unchanged by the seed. The target capability/error/default changes are not yet the runtime API. Grok Bot's global inventory now has the same row and batch export/delete actions as other source lists. Required-read, original-raw, and delete/batch-delete declarations are catalog-backed, including Cursor/FX native-file raw, OpenCode's no-native-file exception, and Qoder shared-store deletion with durable cleanup receipts. Command Code deletion now plans exact replica/sidecar identities, persists a projects-root receipt, and resumes after a vanished transcript. Batch deletion returns settled per-item outcomes (deleted, missing, cleanup_pending, failed, cancelled) so a later failure does not discard earlier successes. Remaining operation matrix, shared semantic/export migration, common UI action composition, and browser conformance remain planned work.
Source identity/routes/scopes/export aliases now come from the portable src/lib/conversation-data/source-catalog.ts. The adapter, icon and native payload-parser maps are exhaustive, with literal source-ID constraints and compiler-negative fixtures. Raw downloads no longer force native files to .json or decode original bytes as text. Full operation-capability enforcement, common UI actions and canonical export semantics are described in the source-adapter contract; the existence of a descriptor is not evidence of completed parity.
