Part of the AI coding agent security checklist
Where each AI coding agent keeps your conversation history
Claude Code, Codex, Gemini CLI, Copilot CLI, Cursor, Aider, Windsurf, Cline and Continue all record your sessions on your own disk. Where each one puts them, what format they are in, how long they stay, and how to see how much you have.
Paths are the ones ranwhat reads, checked against vendor documentation where it exists (see Sources). Published .
Where each agent keeps its sessions
Most terminal agents write one file per session under a dot folder in your home directory. Editor-based agents tend to use a database inside the editor's own data folder. On Windows, ~ is %USERPROFILE%.
| Agent | Where | Format | Retention |
|---|---|---|---|
| Claude Code | ~/.claude/ |
JSONL | 30 days by default. Full guide |
| Codex (CLI, IDE extension, desktop app) | ~/.codex/, archived_sessions/ and history.jsonl, or under $CODEX_HOME |
JSONL, one thread per file; .jsonl.zst once a thread has been idle for a week |
None documented for sessions. history.max_bytes caps the file the docs name |
| Gemini CLI | ~/.gemini/, or under $GEMINI_CLI_HOME |
JSONL (v0.39.0 and later), JSON before that | 30 days by default (general.sessionRetention) |
| GitHub Copilot CLI | ~/.copilot/, or under $COPILOT_HOME |
JSONL | None documented; removal is manual |
Cursor (editor and cursor-agent) |
Cursor/User/ under ~/Library/Application Support (macOS), ~/.config (Linux) or %APPDATA% (Windows); and ~/.cursor/ |
SQLite, undocumented | None documented |
| Windsurf | ~/.codeium/, and ~/.windsurf/ when its transcript hook is on |
Encrypted protobuf; JSONL for the hook copy | The hook copy keeps the newest 100 files |
| Cline | <editor>/User/, and ~/.cline/data |
JSON | None documented |
| Roo Code | <editor>/User/ |
JSON, text | None documented |
Continue (IDE and cn) |
~/.continue/, or under $CONTINUE_GLOBAL_DIR |
JSON | None documented |
| Aider | .aider.chat.history.md and .aider.input.history in the repository you ran it in, or the folder you ran it from |
Markdown, plain text | None; every session is appended to the same file |
<editor> is the editor's data folder, such as
Code for VS Code, under the same parent as
Cursor's above. None documented means the vendor
publishes no retention period that ranwhat or this page could find,
not that nothing is ever deleted. Cursor, Windsurf and Cline publish
no storage format, so what ranwhat reads there was worked out from
open-source readers and real dumps, and can change with an update.
ranwhat also reads Antigravity, GitHub Copilot in VS Code, Kilo Code, OpenCode, Goose, Zed, Warp, Amazon Q, Qwen Code, CodeBuddy, Grok Build, Droid, Kimi Code, Kimi CLI, Pi, Oh My Pi, Muse Code, Mistral Vibe, DeepSeek Harness and OpenClaw. The README has each path.
What is in them
More than the chat. A session file is a record of everything the agent saw and did: your prompts, the contents of every file it opened, the output of every command it ran, and anything you pasted. If the agent ran cat .env, the values are in the file.
Why plaintext matters
Apart from Windsurf's Cascade files, which are encrypted, ranwhat reads every store in the table as plain JSON, text or SQLite, so file permissions are the only protection. Anything that runs as you can read them, and so can whatever backs up or syncs your home folder. Aider is the odd one out: its history sits in the repository, so a careless git add . can commit it. A secret printed once by a tool can sit in several of these files, for as long as the tool keeps them. For what infostealers now collect, see the Claude Code history guide, and for the wider habits, Developer OPSEC.
How much you have on your machine
A folder that does not exist means that agent is not on this machine, or keeps its history somewhere else. Each command below prints a size.
# Claude Code, Codex, Gemini CLI, Copilot CLI, Continue du -sh ~/.claude/projects du -sh ~/.codex/sessions ~/.codex/archived_sessions ~/.codex/history.jsonl du -sh ~/.gemini/tmp/*/chats du -sh ~/.copilot/session-state du -sh ~/.continue/sessions # Windsurf du -sh ~/.codeium/windsurf/cascade ~/.windsurf/transcripts # Cursor on macOS (Linux: ~/.config/Cursor/User/globalStorage) du -sh ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb ~/.cursor/chats # Cline and Roo Code in VS Code on macOS (Linux: ~/.config/Code/User/globalStorage) du -sh ~/Library/Application\ Support/Code/User/globalStorage/saoudrizwan.claude-dev/tasks du -sh ~/Library/Application\ Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/tasks # Aider leaves its files in each repository, so look for them find ~ -maxdepth 4 -name '.aider*history*' 2>/dev/null
ls -lt on a folder shows the newest first. On Windows, use the same folders under %USERPROFILE% and %APPDATA%. Cursor's database holds every chat in one file, so its size is the total, not one project's.
How to limit or delete them
Only some of these agents give you a setting. For the rest, the history is a file or a database you delete yourself.
Deleting a file removes your local copy and nothing else. What the model provider kept is governed by your account's terms with that provider. If a session held a credential, rotate it first, then decide whether to delete or mask.
Let ranwhat list what it can find
sources prints every agent ranwhat reads, the folders it checked on this machine, and whether it found any history there. It changes nothing and does not read the contents.
To see what is inside, run uvx ranwhat check. It reads the sessions of every agent it finds and lists the risky actions and the credentials sitting in the files, each with the agent and project. It reads files, and rewrites nothing unless you then run ranwhat clean with --apply. clean masks a value only in a plain JSONL, JSON or text file; for the databases (Cursor, OpenCode, Goose and others) it reports and leaves them untouched.
ranwhat sources where it looked, what it found ranwhat check actions and secrets, nothing changed ranwhat check --source codex one agent (repeatable) ranwhat check --path codex=~/work/.codex history kept somewhere else
The default window is 30 days (--days). Zero found is not a clean machine: sources tells you whether the folder was missing or empty.
Sources
Paths and formats are as ranwhat reads them, from its source. Where a vendor documents a location or setting, that page is listed. Cursor, Cline, Roo Code, Continue and Windsurf's encrypted files have no vendor page for storage, so no retention is claimed for them.
- Gemini CLI: session managementchats folder, general.sessionRetention and its defaults
- Codex: advanced configurationCODEX_HOME, history persistence, history.max_bytes
- Copilot CLI: config directory referencesession-state, COPILOT_HOME, deletion and synced sessions
- Aider: options referencehistory file names and their environment variables
- Windsurf: Cascade hookstranscript path, JSONL, 0600, 100 file cap
- Continue: FAQsthe ~/.continue data folder
- ranwhat READMEthe table of agents, paths and formats
- cursor.pyCursor databases and how they were checked
- codex.pyrollout files, .zst, history.jsonl, SQLite
- gemini.pyJSONL and JSON layouts, 30 day default
- copilot_cli.pyevents.jsonl and tool output files
- windsurf.pyencrypted Cascade files, hook transcripts
- cline.pytask folders and the Cline data folder
- roo.pyRoo Code task folders, command output files
- continue_dev.pysession files and CONTINUE_GLOBAL_DIR
- aider.pyhistory file locations and format