# Xyvenra Code chat sync

Xyvenra Code keeps chat history in the current browser by default. A signed-in user can choose **Enable cloud sync** to copy saved conversation text to their Xyvenra account and make it available on another signed-in device after that device also enables sync.

## What is uploaded

- Up to 20 saved chats per account, with a combined limit of 1 MB of message content.
- The saved chat title, selected provider name, model name, and up to 40 user/assistant text messages per chat.
- Project files selected in the current session and provider API keys are not included automatically.

Chat text can include source code or secrets that were typed into the conversation. The opt-in confirmation warns users not to sync chats containing secrets. Records are private under account-scoped Supabase row-level security. Sync can be disabled on a device at any time; disabling stops future uploads but does not erase the account copy. Deleting a synced chat removes it from the current browser and the Xyvenra account.

The API is authenticated and same-origin only:

- `GET /api/code/chats` lists the signed-in user's saved chats.
- `PUT /api/code/chats` creates or updates one chat using its browser-generated UUID.
- `DELETE /api/code/chats/{chatId}` deletes that user's chat.

The database enforces ownership, message shape and size, and account quotas. This is an early access preview; it does not provide team sharing, retention controls, export of server copies that are not loaded in the current browser, or end-to-end client-side encryption.

## Exporting chats

Use **Search saved chats** to filter conversations by title, provider, model, or text in their saved messages. The search runs in the current browser over chats already loaded from local storage or opt-in cloud sync; the query is not sent to Xyvenra or an AI provider.

Choose **Export chats** to download the conversations currently visible in Code as a `xyvenra-code-conversation-export` JSON file. It includes the saved chats available in this browser (including synced chats loaded while account sync is enabled) and the active conversation, up to 40 recent text turns per chat. The export can be imported back into Xyvenra Code in another browser. It excludes provider API keys and selected project files. Conversation text can contain code or secrets, so the download confirmation warns users to keep the file private. This is a browser download; it does not upload another copy to Xyvenra.

Choose **Export current chat as Markdown** to download only the active conversation in a readable `.md` file. It includes up to 40 recent user and assistant text turns and the selected provider and model names. It does not include saved chats that are not active, provider API keys, or project files. Conversation text can contain code or secrets; the download asks for confirmation and does not upload the file to Xyvenra.

## Importing chat exports

The **Import chats** control accepts ChatGPT and Claude export ZIPs, supported `conversations.json` files, and the Xyvenra JSON format described above. **Import Google Gemini** separately accepts the Google Takeout ZIP or `MyActivity.json`. To export Gemini chats, select **My Activity → Gemini Apps** in Takeout (and optionally select **Gemini** separately for Gems), then download a ZIP archive. Google's activity export can omit replies and attachments; Xyvenra groups readable request/response entries by the conversation URL and preserves chronological text. Takeout's observed JSON variants are supported on a best-effort basis and may change. The ZIP is inspected in the browser; only matching conversation JSON entries are unpacked. ChatGPT imports follow the active conversation branch; Claude imports follow the active message branch when the export includes one. Other branches and non-text tool/reasoning blocks are omitted. Imported chats are text-only local browser history, with up to 20 recent conversations added subject to the existing 20-chat and 2.4 MB browser-storage limits. Each imported conversation keeps up to its latest 40 user/assistant text turns and each message is capped at 64 KB. Tool messages, attachments, images, and platform settings are not transferred. Claude project instructions, project documents, and memories are not transferred by chat import; use [Claude project import](./xyvenra-code-claude-project-import.md) for those. The app does not send imported data to Xyvenra during import. If cloud chat sync is already enabled, opening an imported chat can cause the usual chat auto-save to sync its text under that prior opt-in. Importing does not create a new provider key or incur model usage.

To create a ChatGPT export, use **Settings → Data controls → Export data**. ChatGPT can include `conversations.json` or numbered conversation JSON files. See [OpenAI's export instructions](https://help.openai.com/en/articles/7260999-exporting-your-chatgpt-history-and-data).

To create a Claude export, use **Settings → Privacy → Export data** in Claude on the web or desktop. Anthropic sends a download link by email; then select the ZIP in Xyvenra Code. See [Anthropic's export instructions](https://support.anthropic.com/en/articles/9450526-how-can-i-export-my-claude-data). This imports a local reference copy; it does not delete or alter the original platform data.

To export Gemini activity, use [Google Takeout](https://takeout.google.com/), select **My Activity**, then select only **Gemini Apps** inside **All activity data included**, and create a ZIP. Google's [Gemini export guide](https://support.google.com/gemini/answer/16920332?hl=en) explains these choices. Chat activity may be absent when it was not saved to the Google account; some exports contain prompts without their replies. The import is a copy and does not modify the Google account.

## Stopping a response

Choose **Stop generating** while Code is streaming a chat response or preparing an edit proposal. Xyvenra aborts the browser request and signals the provider connection to stop. Any text already received stays in the chat; an incomplete edit proposal is discarded and is never applied. Provider billing may include usage accrued before the stop reached the provider.
