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.

$ uvx ranwhat sources
Install
$ uvx ranwhat sources

Paths are the ones ranwhat reads, checked against vendor documentation where it exists (see Sources). Published .

01 / Where

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%.

AgentWhereFormatRetention
Claude Code ~/.claude/projects/<project>/<session-id>.jsonl JSONL 30 days by default. Full guide
Codex (CLI, IDE extension, desktop app) ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, 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/tmp/<project>/chats/, or under $GEMINI_CLI_HOME JSONL (v0.39.0 and later), JSON before that 30 days by default (general.sessionRetention)
GitHub Copilot CLI ~/.copilot/session-state/<session-id>/events.jsonl, or under $COPILOT_HOME JSONL None documented; removal is manual
Cursor (editor and cursor-agent) Cursor/User/globalStorage/state.vscdb under ~/Library/Application Support (macOS), ~/.config (Linux) or %APPDATA% (Windows); and ~/.cursor/chats/*/*/store.db SQLite, undocumented None documented
Windsurf ~/.codeium/windsurf/cascade/*.pb, and ~/.windsurf/transcripts/*.jsonl when its transcript hook is on Encrypted protobuf; JSONL for the hook copy The hook copy keeps the newest 100 files
Cline <editor>/User/globalStorage/saoudrizwan.claude-dev/tasks/<task>/, and ~/.cline/data JSON None documented
Roo Code <editor>/User/globalStorage/rooveterinaryinc.roo-cline/tasks/<task>/ JSON, text None documented
Continue (IDE and cn) ~/.continue/sessions/<session>.json, 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.

02 / Contents

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.

Prompts What you typed, with timestamps. Codex also keeps typed prompts in history.jsonl, and Aider in .aider.input.history.
Files read Tool results hold file contents. Windsurf's transcript steps record the content of each file viewed and the before and after text of each edit.
Command output Shell output is stored with the call that ran it. Large outputs can spill to separate files: Copilot CLI and Roo Code both do this.
Secrets Anything in the three above that was a credential. A key you pasted to ask for help is in the file the same way as one printed by a command.
Codex extras A snapshot of your shell's exported variables under shell_snapshots/, and a SQLite index of threads.

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.

03 / Size

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.

04 / Limit

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.

Claude Code cleanupPeriodDays, and claude project purge. Both are in the Claude Code history guide.
Gemini CLI Set general.sessionRetention in settings.json: enabled, maxAge (default "30d"), maxCount and minRetention (default "1d"). Deleting a session removes its tool outputs and logs too.
Codex The docs give [history] persistence = "none" in config.toml to stop saving history, and history.max_bytes to cap it. They do not say whether the rollout files under sessions/ follow it, so check the folder after a new session. To delete, remove the files.
Copilot CLI Deleting ~/.copilot/session-state/ removes the history and you can no longer resume those sessions. Synced sessions are stored separately: delete or hide them on GitHub.com.
Cursor Delete the chat in Cursor. ranwhat reads these databases and never writes to them.
Windsurf Remove ~/.windsurf/transcripts/ and turn the hook off. The encrypted Cascade files are Windsurf's own.
Cline, Roo, Continue Delete the task folders or session files you no longer need.
Aider Delete .aider.chat.history.md and .aider.input.history. AIDER_CHAT_HISTORY_FILE and AIDER_INPUT_HISTORY_FILE move them.

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.

05 / ranwhat

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.

$ uvx ranwhat sources
Install

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.