Clear or delete your Claude Code, Codex, Gemini CLI, Qwen Code, OpenCode, Copilot CLI and Cursor session history
Deleting a session from a list is not deleting every copy. The local transcript (the saved conversation on disk), prompt history, exports, backups and cloud copies are separate records, and each tool treats them differently. This page covers local delete commands, automatic cleanup, and what each vendor keeps on its servers.
Delete is irreversible. Back up first, and test that the backup opens; a copy you have never restored is a guess.
Status, 27 October 2026: retention details below; server-side statements come from each vendor's own pages. Cursor's release notes name a bulk local cleanup command, but its docs describe no per-chat delete, and its storage paths are staff-reported.
Checked against each tool's documentation on 27 October 2026.
What `/clear` does, and what it does not#
/clear is a context command, not a delete command. It starts a fresh conversation so the model is no longer carrying the old turns. It does not remove the saved transcript, free disk space, or touch a server copy.
| Tool | What the command does | What survives |
|---|---|---|
| Claude Code | /clear starts a fresh conversation; Claude Code saves the previous session. | The old transcript, auto memory, prompt history, and any cloud or Remote Control copy. |
| Codex | /clear clears the terminal and visible transcript and starts a fresh chat in the same CLI session. Ctrl+L only clears the terminal view. | The old transcript. |
| Gemini CLI | /clear starts a new session and clears the visible terminal, history and scrollback. The previous session stays in the list. | The previous session's transcript, until retention or a delete. |
| Qwen Code | /clear (aliases /reset, /new) starts a new session and clears the visible conversation. It fires SessionEnd with reason clear. | The old transcript in chats/, its file-history backups, and any export or backup. |
| OpenCode | The V2 TUI documents /new rather than /clear; /new starts a new session. In opencode mini, Ctrl+L clears the screen. | The old session in the database. |
| GitHub Copilot CLI | /clear starts a new conversation. Copilot CLI closes the old session and fires its sessionEnd hooks, then keeps running. | The docs do not say whether the session folder remains. The open report says /clear discards it and /new preserves it; check /resume on your build before relying on it. |
| Cursor | In the CLI, /clear starts a new chat session; /new, /new-chat and /newchat are aliases. In the editor, a new chat tab starts a separate conversation. | The old chat is a separate conversation. Cursor's docs describe no delete on /clear; the chat stays in the history until you archive it or run a cleanup. |
In Claude Code, /resume still lists the cleared conversation, and /clear keeps a name set with --name or /rename. In Codex, the old chat remains resumable. In Gemini CLI, /clear starts a new session and leaves the old one in --list-sessions and /resume; /quit --delete or /exit --delete removes the current session's history and temporary files. In Qwen Code, /clear starts a new session and leaves the old transcript in chats/ and in /resume; /delete is the delete command. In OpenCode, /new leaves the previous session listed until you delete it. In Copilot CLI, the docs do not list /clear as a delete command; the 1.0.11 changelog says it abandons the current session entirely, while /new keeps the old session backgrounded. Use /session delete or /session delete-all for a documented delete. An open request says the help text does not make the /clear and /new difference obvious (#3569, open, 29 May 2026).
Delete one session#
The paths below are defaults; CLAUDE_CONFIG_DIR, CODEX_HOME, OPENCODE_DB and COPILOT_HOME move each tool's store.
Claude Code#
The CLI has no documented per-session delete command. A session is the .jsonl transcript plus an optional sibling folder for subagents and large tool outputs; delete both from the project directory:
rm ~/.claude/projects/<project>/<session-id>.jsonl
rm -rf ~/.claude/projects/<project>/<session-id>/ # if it existsclaude rm <id> is not that command. It deletes a background session from the running-session list, but the transcript stays on disk and remains available through claude --resume.
For a whole project, use claude purge, below. A cloud session is deleted in the claude.ai/code session list; that is permanent and does not touch the local CLI file.
Codex#
The Codex CLI has a per-session delete command:
codex delete <SESSION>It permanently removes the transcript and any spawned descendant sessions. --force skips confirmation only when you pass a session UUID; named sessions still ask. From inside a chat, /delete does the same.
codex archive (or /archive) is safer when you only want the chat out of the picker. It keeps the transcript and codex unarchive <SESSION> brings it back.
The delete is local; a Codex cloud task lives in ChatGPT, not $CODEX_HOME, so deleting a local session does not touch it.
Gemini CLI#
Run gemini --version first; this describes v0.65.0 (20 October 2026). The session docs give one command:
gemini --list-sessions
gemini --delete-session 2The index is one-based, oldest first. In the /resume browser, highlight a session and press x. To delete the session you are in, exit with /quit --delete or /exit --delete; that removes its chat recording and tool outputs.
Deleting a session also removes the data the docs list as associated with it: implementation plans, task trackers, tool outputs and activity logs. That is more than the .jsonl, so removing the file by hand from ~/.gemini/tmp/<project-id>/chats/ leaves those behind.
/clear is not a delete: it starts a new session, clears the screen and scrollback, and leaves the old session in the list.
Qwen Code#
Run qwen --version first. Inside a session, the /delete command opens the session picker. Select one session, or several before confirming; it refuses the session you are in. On success it removes:
- the session's
.jsonltranscript, including a copy inchats/archive/if it was archived; - its worktree and pull-request sidecars, prompt ledgers, and the
~/.qwen/file-history/<session-id>/rewind backups; - its prompt rows from the project-shared prompt history in the runtime
tmp/<project-hash>/logs.json.
It fires the SessionDelete hook after the files are gone (hooks); the hook is fire-and-forget and cannot undo the delete. It does not touch an /export file or a copy you made yourself.
There is no qwen sessions delete subcommand: qwen sessions has only list, ps and controllers. There is also no documented delete-all command. Selecting several sessions in /delete is the closest thing to a bulk delete.
Close every Qwen Code window that has the session open before deleting it. An open report on qwen serve says deleting a live session unlinks its transcript while the attached writer keeps running; the writer recreates the file from a record whose parent is gone, and the session is permanently degraded (#12091, open, 17 September 2026). The report is about the daemon's delete route, but the safe habit is the same in the CLI.
OpenCode#
In V2:
opencode session delete ses_abc123The command deletes the session and its child sessions. Ctrl+D in the session list does the same for the highlighted session. V1 uses the same opencode session delete <sessionID> command; its page documents the delete but does not mention child sessions, so check the list after deleting a parent.
Export it first if you may want it back:
opencode session export ses_abc123 > session.jsonThe JSON can be imported again; deleting the session does not delete an export or database backup.
GitHub Copilot CLI#
Run copilot --version first. The /session delete commands arrived in 1.0.35 (23 April 2026), and the Sessions tab's two-step confirmation in 1.0.88.
/session deletedeletes the current session and starts a new one in its place./session delete <session-id>shows a preview first; add--yesto confirm.- In the sidebar, highlight a session and press
xtwice. The docs are explicit: the session is permanently deleted, whether or not it was still running, and you cannot resume it afterwards. - In the Sessions tab,
xtwice. A local row is permanently deleted; a row backed by a server is only closed, and its conversation is left on the server (1.0.88).
/exit saves and closes the session; it does not delete it.
When the session has been synced to your GitHub account, /session delete asks whether to delete the synced copy too. Deleting it also removes the session from /chronicle insights and query results. Deleting the folder by hand does not touch the synced copy.
For a folder-level delete, remove the session directory:
rm -rf ~/.copilot/session-state/<session-id>/Then run /chronicle reindex so the session store is rebuilt from the folders that remain. Two open reports show the index can keep a deleted session: deleted sessions still appeared in /chronicle insights after a wipe (#3811, open, 15 June 2026), and deleting from the Copilot app left the row in session-store.db and VS Code history (#4094, open, 11 July 2026). Check the session list and /chronicle after a delete, not just the folder.
Cursor#
Run Cursor → About Cursor. 3.27 was the newest editor build on 27 October 2026, and the archive and delete actions have changed across 3.x.
The editor's docs describe no delete command for a single chat. Archive in the sidebar (also in the Cmd+K palette) hides an agent; it is reversible, and the Cursor 3.26 release notes say Cmd+Z (Ctrl+Z) brings an archived agent back. Archiving is not deleting.
The documented local cleanup is Developer: Delete Old Chats in the Command Palette (Ctrl/Cmd+Shift+P). The Cursor 3.25 release notes describe it as freeing space in Cursor's local database, with Rewrite Now to return the freed space to disk, and say cleanup removes leftover message data from deleted chats so they no longer reappear in the chat list. The notes do not say what counts as "old", or whether the command also removes the JSONL transcript files. Back up first, then check the chat list and the transcript folder.
A cloud agent is separate. The Cloud Agents API documents archive (reversible) and delete (permanent); a local cleanup command does not touch it.
A shared transcript is a third copy. A team or public share link lives on Cursor's side, so delete it from the dashboard's Shared Transcripts tab rather than assuming a local delete covers it.
If you need one specific chat gone now, the docs checked offer no supported single-chat delete. Archiving hides it, and Developer: Delete Old Chats is the bulk path. The Cursor chat history guide covers where the transcript sits and why the sidebar index is a separate problem.
Delete everything#
Claude Code#
claude purge is the documented bulk path. It takes a project path, or --all for every project. Preview one project first:
claude purge ~/work/my-repo --dry-run
claude purge ~/work/my-repoThe purge deletes the project's transcripts and auto memory under projects/, its per-session tasks/, debug/ and file-history/ entries, matching prompt lines in history.jsonl, and the project entry in ~/.claude.json. The command prints the plan and asks for confirmation; --yes skips the prompt for scripts.
To purge every project:
claude purge --all--all purges state for every project and deletes history.jsonl outright rather than filtering it. That removes prompt recall for projects you did not mean to touch, so use it deliberately.
Some copies survive. In current versions, images pasted into a session and each session's scratchpad live in the temp directory, not under ~/.claude; the purge does not remove them. On v2.1.274 and earlier, pasted images were saved in ~/.claude/image-cache/<session>/ instead. shell-snapshots/ and backups/ are not project-scoped and are left alone. Any .heapsnapshot file from /heapdump contains the full conversation and is not touched by the purge or the sweep. Cloud sessions are separate.
You can delete the application-data paths yourself; the docs list the costs. claude purge is the supported route because it shows the plan first.
Lowering cleanupPeriodDays to 1 makes the retention sweep act sooner, but it still runs at the start of a future session, not immediately. The minimum is 1 day; 0 fails validation.
Codex#
The docs describe no bulk delete command. codex delete works one session at a time.
For a clean transcript store, close every Codex surface, confirm the Codex home, and remove both session directories:
codex_home="${CODEX_HOME:-$HOME/.codex}"
rm -rf "$codex_home/sessions" "$codex_home/archived_sessions"
rm -f "$codex_home/history.jsonl"That is file-level cleanup, not a supported command, and irreversible. The last line removes prompt history, which codex delete does not touch; leave it out if you only want the transcripts gone. Copy a large store first.
The Codex docs are inconsistent here: advanced configuration calls history.jsonl a session transcript, while troubleshooting treats sessions/ as the transcript store and history.jsonl as prompt history. In practice, use sessions/ for transcripts; history.jsonl is the prompt-history file.
Codex also keeps a SQLite state database for resumable runtime state, at the path set by the sqlite_home setting; the two directories above are not the whole store. The documented route for the picker and state is codex delete per session.
Codex tasks in the cloud are in ChatGPT. Delete the chat there; the local command has no effect on it.
Gemini CLI#
The docs describe no delete-all command. gemini --delete-session takes one session at a time, and the /resume browser deletes one at a time with x. The documented bulk path is retention: set general.sessionRetention.maxCount to keep only the newest N, or shorten maxAge from its 30d default. Cleanup runs at startup, in the background, so it acts on the next launch rather than immediately.
For a file-level wipe of one project, with Gemini closed:
rm -rf ~/.gemini/tmp/<project-id>/chatsThat removes the session files only; plans, tool outputs and checkpoints under the same project directory stay. Removing the whole ~/.gemini/tmp/<project-id>/ also removes project memory (memory/), checkpoints and logs, so it is a bigger delete than "session history". There is no trash.
To keep everything, set general.sessionRetention.enabled to false; raising maxAge alone is not enough if maxCount is set — raise or remove maxCount too. The setting is in ~/.gemini/settings.json or .gemini/settings.json.
Qwen Code#
The docs describe no delete-all command. /delete with several sessions selected deletes them one at a time under the hood, still refuses the current session, and cleans each session's sidecars.
For a file-level wipe of one project, with Qwen closed (the paths assume the default ~/.qwen):
rm -rf ~/.qwen/projects/<sanitized-cwd>/chats
rm -rf ~/.qwen/file-history/<session-id>
rm -f ~/.qwen/tmp/<project-hash>/logs.jsonThe first line removes the transcripts only. The second removes one session's rewind backups; point it at ~/.qwen/file-history/ to remove every session's. The third removes this project's prompt history (the up-arrow list), so it loses prompts from every session, not just the deleted one. None of these is a supported delete, and none can be undone.
Removing the whole ~/.qwen/projects/<sanitized-cwd>/ also removes auto-memory in memory/, which is not session history.
Lowering general.cleanupPeriodDays does not delete transcripts; it only shortens file-history and debug-log retention. At 0, the docs describe a minimum of about one hour for those backups, not an immediate wipe.
OpenCode#
The docs describe no bulk delete command. opencode session delete <id> works one session at a time, and each delete also removes child sessions in V2.
V1's uninstall removes session data and configuration unless you pass --keep-data and --keep-config. V2's uninstall keeps session data, configuration and state, so uninstalling is not a cleanup path on V2.
Deleting the database file is not a documented bulk delete. It removes every project's history, and the docs warn against editing the database while troubleshooting. If you restore or replace it, stop the service first and keep the current file. On a remote server, sessions live in that server's database; deleting on your laptop does not remove them.
GitHub Copilot CLI#
The CLI has documented bulk commands, and they act on local sessions only:
/session delete-alldeletes all your local sessions except the current one. Add--yesto confirm; sessions in use by another process are skipped./session prune --older-than DAYSdeletes sessions older than the given number of days. Run it with--dry-runfirst to see the list./session cleanupshows a storage summary grouped by age and suggests commands. It does not delete anything.
To clear the local store by hand, delete everything under ~/.copilot/session-state/ with the CLI closed, then run /chronicle reindex; the docs say the reindex is required after that. None of these routes removes the synced copies in your GitHub account: /session delete-all and /session prune leave them too. Remove synced sessions on GitHub.com, as below.
Cursor#
The docs describe no delete-all command for local chats. Developer: Delete Old Chats is the documented bulk cleanup for old chats, not a documented wipe of everything.
For a file-level wipe, close Cursor and remove the staff-reported transcript tree at ~/.cursor/projects (#162757, 10 June 2026), and the User folder if you also want the sidebar index gone. That is not a supported delete, and deleting the whole ~/.cursor folder takes rules, MCP configuration, permissions and hooks with it. Copy anything you want to keep first.
Cloud agents and shared transcripts are separate stores; deleting local files does not delete either.
Automatic cleanup#
Retention is each tool's own age limit: how long it keeps a session.
| Tool | Setting | What the docs say |
|---|---|---|
| Claude Code | cleanupPeriodDays | 30 days by default, minimum 1; 0 is invalid. The sweep runs after a session starts, without a message, and removes transcripts and supporting data. Auto memory is not swept. desktopSessionCleanupPeriodDays adds a second limit for Desktop and Cowork transcripts; they are deleted only once older than both it and cleanupPeriodDays (with the 30-day default, 7 still keeps them 30 days). |
| Codex | None documented for session age | history.max_bytes caps and prunes history.jsonl, the prompt history, not the session store. codex archive hides a chat; it does not delete it. |
| Gemini CLI | general.sessionRetention | 30 days by default. maxAge takes durations like 24h, 7d, 4w; maxCount has no limit when unset; minRetention defaults to 1d and protects new sessions. Cleanup runs at startup, in the background. Deleting a session also removes its plans, task trackers, tool outputs and activity logs. |
| Qwen Code | None documented for session age | general.cleanupPeriodDays (30 days by default) retains ~/.qwen/file-history/ rewind backups and debug logs, not projects/*/chats. 0 means minimum retention, about one hour; changes need a restart. |
| OpenCode | None documented for session age | The V1 CLI lists OPENCODE_DISABLE_PRUNE as "Disable pruning of old data"; it does not say what is pruned or after how long, and the V2 CLI reference does not list it. |
| GitHub Copilot CLI | None documented for session age | /session cleanup reports storage grouped by age and suggests commands; /session prune --older-than DAYS deletes, with --dry-run to preview. Neither runs on its own, and prune affects local sessions only. |
| Cursor | None documented | No age-based session sweep is documented. Developer: Delete Old Chats is a manual command (Cursor 3.25 and later). |
To keep history, raise the period and keep a backup. To remove it, set the period short or delete explicitly. The absence of a documented sweep is not a guarantee that no build cleans up; the docs do not promise a period.
What the vendor keeps#
Local deletion and server retention are separate. Deleting a local file does not delete a cloud copy; deleting a cloud session does not delete the local file.
| Tool and surface | What is on the vendor's servers | How long |
|---|---|---|
| Claude Code, local CLI, IDE and desktop | Prompts and model outputs go to the model provider for inference; the transcript stays local unless you use Remote Control, a cloud session, or send feedback. | Local transcript: 30 days by default. Server side: by plan, below. |
| Claude Code, cloud session | The session transcript, so you can return to it. | By plan; deleting the session is permanent. |
| Claude Code, Remote Control | The transcript, while connected, to sync devices and reconnect. | Under the data usage policy below. |
| Codex, local CLI and desktop | The session stays in $CODEX_HOME; model requests go to the provider. | Until you delete it; no age sweep is documented. |
| Codex, cloud task | The task and its conversation live in ChatGPT. | The Codex docs checked do not state a conversation-retention period. |
| Gemini CLI, local CLI | The session stays under ~/.gemini/tmp; prompts and responses go to the Google service behind your sign-in (Gemini Code Assist, Gemini Developer API or Vertex AI). | Local: 30 days by default. Server side: the terms and privacy notice for that service apply; the CLI docs give no conversation-retention period. |
| Qwen Code, local CLI, Web Shell and IDE | The transcript stays under the project's chats/ directory. Prompts and responses go to the model provider behind your auth route; Qwen Code's privacy notice says the app does not train on them, and usage statistics are anonymous and separate. | Local: until you delete it; no age sweep documented. Server side: the provider's terms apply; the Qwen Code docs checked state no conversation-retention period. |
| OpenCode, local V1 and V2 | The database is local; OpenCode says it does not store code or context data. | Until you delete it; no period is documented. |
| OpenCode, a remote server | Sessions live in that server's database. | Controlled by whoever runs the server. |
| Copilot CLI, local and synced | The session folder locally, plus a copy in your GitHub account when syncing is on (the default). Synced sessions are view-only on GitHub.com and GitHub Mobile. | No period stated in the docs. Delete or hide the synced record on GitHub.com. |
| Copilot CLI, cloud agent | The task's log remains on GitHub.com; the ephemeral environment is destroyed when the session ends. Cloud agent sessions are shared by default with people who have repository access. | No period stated. The session-data table lists delete as unsupported for cloud agent sessions; archive is supported. |
| Cursor, local editor and CLI | The transcript stays on disk; prompts and context go to the model provider. | No retention period is stated in the docs; no age sweep is documented. |
| Cursor, shared transcript or cloud agent | A share link stores the full conversation, including tool calls and results; a cloud agent has its own transcript at cursor.com/agents. | Share links until deleted from the dashboard; cloud agents until permanently deleted; archived agents stay readable but cannot accept new runs until unarchived. No period stated. |
Claude Code#
Claude Code's data usage page gives the server-side numbers by account type. Checked 27 October 2026:
> Users who allow data use for model improvement: 5-year retention period to support model development and safety improvements. > > Users who don't allow data use for model improvement: 30-day retention period. > > Commercial users (Team, Enterprise, and API): Standard: 30-day retention period.
The same page says you can delete individual cloud sessions at any time, and that deleting a session permanently removes its event data. Qualified Enterprise accounts can enable zero data retention; it is not part of the standard plan. The page also says Claude Code clients store transcripts locally in plaintext under ~/.claude/projects/ for 30 days by default, adjustable with cleanupPeriodDays.
Remote Control is a third copy while it is connected. The Remote Control docs say the session transcript, including messages, responses and tool activity, is stored on Anthropic servers so it can sync across devices and reconnect after a drop; it is retained under the data usage policy. Disconnecting is not described as deleting that stored transcript.
Feedback is another long-lived copy. The data usage page says transcripts shared through /feedback, /bug or /share are retained for 5 years. The optional session-quality follow-up, if you choose Yes, uploads the transcript and any subagent transcripts and keeps them for up to 6 months. If you sent either, deleting the local session does not remove that copy.
Codex#
OpenAI's Enterprise privacy page covers ChatGPT Enterprise, Edu and Healthcare. It is not a statement about a personal Codex plan.
The Codex Cloud help article covers the cloud environment behind a Codex task, including saved virtual machine state and its recovery after a task. That is environment state, not conversation history.
For a personal ChatGPT plan, the data controls page covers ChatGPT's setting for whether new conversations are used to train models; check there whether it covers Codex tasks on your plan. It is a training control, not a deletion schedule.
The Codex docs checked state no conversation-retention period for cloud tasks.
Locally, Codex's docs describe no age-based cleanup. codex delete removes a transcript; codex archive does not. Prompt history is separate, in history.jsonl.
Gemini CLI#
Sessions are local. The docs put them under ~/.gemini/tmp/<project-id>/chats/ and describe no sync or cloud copy. Prompts and responses still go to Google for inference, through the service your sign-in selects, and the terms and privacy page maps each authentication method to its terms and privacy notice: Gemini Code Assist with a Google account, the Gemini Developer API with an API key, or Vertex AI. The page checked gives no conversation-retention period; the notice for your service is the one that governs it.
Two controls are separate from the transcript. /privacy displays the privacy notice and lets you choose whether your data is collected for service improvement. Usage statistics are a separate stream and can be turned off; the same page links the instructions.
Qwen Code#
Qwen Code is multi-provider, so there is no single server-side retention answer. Its terms and privacy notice maps the routes: Qwen OAuth (discontinued; the free tier ended on 2026-04-15 and it is no longer a selectable /auth entry), Alibaba Cloud Coding Plan, your own API key (the provider's terms), and Vertex AI (Google Cloud's). The notice says Qwen Code itself does not use prompts, code or responses for model training; the provider you authenticate with governs what it keeps.
The transcript is local. On the Qwen OAuth and Alibaba Cloud routes, usage statistics are on by default and sent to an Alibaba Cloud RUM endpoint, described as anonymous commands, performance metrics, error reports and feature usage; the notice says prompts, code and responses are not part of it. With your own API key or Vertex AI, the notice says Qwen Code collects no additional data beyond the provider. Opt out with privacy.usageStatisticsEnabled: false in settings or QWEN_USAGE_STATISTICS_ENABLED=false.
Deleting the local transcript does not delete any copy the provider holds. The Qwen Code docs checked state no conversation-retention period, so read the notice for your route.
OpenCode#
OpenCode's enterprise page says, checked 27 October 2026:
> OpenCode does not store your code or context data. All processing happens locally or through direct API calls to your AI provider.
That describes normal local use. Session sharing was the exception: it put a copy of a conversation behind a share link served from opncd.ai.
Status, 27 October 2026: a changelog entry says the retired session-sharing backend and the unavailable /share command were removed. The change that retired it turns the share service into a stub: POST /api/share returns a placeholder; POST /api/share/:id/sync and DELETE /api/share/:id return {}; every other route returns 410 "Session sharing has been discontinued." It does not say whether earlier shared conversations are deleted or still reachable. Treat an old share link as live until you confirm otherwise.
OpenCode's docs give no retention period for local sessions. OPENCODE_DISABLE_PRUNE is the only pruning control the V1 CLI names, and it only says "Disable pruning of old data"; the V2 CLI reference does not list it. If old sessions matter, back up the database.
GitHub Copilot CLI#
Session syncing is on by default, subject to your organization's policy. The remoteExport setting controls it, and --sync-session=off turns it off for one run. A synced session is tied to your account: the session data page says it is accessible only to you by default, and that enabling syncing does not give administrators access to its contents. Syncing is not sharing; sharing makes a session view-only for people with repository access.
Local and synced copies are deleted separately. /session delete offers the choice; /session delete-all and /session prune are local only; deleting the files under session-state/ is local only. You cannot delete the synced copy from the local store. On GitHub.com you can hide a synced session, which removes it from the session index so it stops appearing in history queries, or delete it, which removes it from your session list. Deletion there applies to sessions from Copilot CLI, VS Code and the GitHub Copilot app.
The docs checked state no retention period for synced sessions. Don't assume one, and don't treat the GitHub copy as a backup you control.
Copilot cloud agent is a third store. A task you delegate with /delegate runs in an ephemeral environment: the environment is destroyed when the session ends, but the log remains on GitHub.com and is shared by default with anyone who has repository access. The session-data table marks delete as unsupported for cloud agent sessions and archive as supported, so treat that log as outside your local cleanup.
Cursor#
Cursor's docs do not state a retention period for local chats. The transcript stays on disk until you delete it; no age sweep is documented. The local file is the record you control; the docs describe no server-side copy of a local chat.
Share is the server-side copy. The shared transcripts page says the full conversation, including tool calls and results, is stored behind a team or public share link, with best-effort secret redaction. The link is managed from the dashboard's Shared Transcripts tab; deleting it there removes that copy. Shared transcripts are Teams and Enterprise only, and unavailable in No Storage privacy mode.
Cloud agents run on Cursor's machines and have their own transcript view at cursor.com/agents. The Cloud Agents API documents archive and permanent delete. Cloud agent data is separate from the local chat store, and the docs checked state no retention period for the conversation.
If a secret was in the session#
Deleting is not revoking. If a key, token or password appeared in a prompt or a tool output, rotate it first, then remove every copy: the local session, exports, backups, a share link, and any cloud copy. A backup you keep for the code also keeps the secret.
The secrets guide covers how these values end up in transcripts and what to scan before you trust a backup.
Where to go next#
- Back up coding-agent sessions — a copy that survives the delete.
- Export a Claude Code conversation — a readable copy before you remove the original.
- Resume a Claude Code session — what
/clearleaves behind. - Resume a Codex session — archive, delete and the active-writer error.
- Where did my Gemini CLI session go? — the picker, the store, and what makes a session disappear.
- Resume an OpenCode session — the database, projects and imports.
- Where did my Copilot CLI session go? — the picker, the store, and what makes a session disappear.
- Where did my Cursor chat go? — workspace history, the Agents Window, and the separate CLI history.
- GitHub Copilot CLI guides — the rest of the Copilot CLI set.
- Gemini CLI guides — instructions, sessions, permissions and hooks.
- Qwen Code guides — instructions, sessions, permissions and hooks in the Gemini CLI fork.