Where 10 Popular AI Coding Tools Store Your Pasted Secrets on Disk

December 3, 2026 · Tool: vssinghh/leaktap (v0.4.3, MIT Rust CLI) · Companion: Top 20 MCP Server Audit · Check your setup

Tools like Gitleaks and TruffleHog guard your git history, so they never look inside ~/.claude, ~/.codex, ~/.continue, or your editor's state.vscdb SQLite databases. When you paste a .env file, a production database URL, or a curl command with a bearer token into an AI coding tool while debugging, that secret gets written straight into local session transcripts, prompt histories, and SQLite Write-Ahead Log (-wal) files.

To measure how widely this happens and what survives cleanup, I audited the local storage behavior of the 10 most widely used AI coding tools: Claude Code, Codex CLI, Cursor, Gemini CLI, Windsurf, Cline, Aider, OpenCode, Continue, and Goose. Findings for the 7 open-source codebases come directly from pinned commits and exact file:line checks in their GitHub repositories. Findings for the 3 closed-source clients (Claude Code, Cursor, and Windsurf) come from official vendor documentation, public issue trackers, and documented on-disk storage formats.

Summary Results

Summary of local secret-storage checks across 10 AI coding tools (verified December 3, 2026)
Check Across 10 Tools Count Share Why It Matters on a Developer Machine
Redacts pasted secrets before writing to disk 0 / 10 0% Zero tools scrub API keys or .env output pasted into prompts or returned by tools before saving them locally. Codex CLI still carries a literal // TODO: check `text` for sensitive patterns above its history.jsonl write.
Stores primary chat history in plaintext 9 / 10 90% Only Windsurf encrypts primary Cascade conversation files (~/.codeium/windsurf/cascade/*.pb) per conversation UUID. The other 9 write unencrypted JSONL, JSON, Markdown, or SQLite WAL files.
Keeps transcripts or prompt history forever 8 / 9 89% 7 plaintext tools have zero automatic expiration. Claude Code sweeps session transcripts at 30 days but keeps ~/.claude/history.jsonl forever unless HIPAA org settings apply. Only Gemini CLI defaults to 30-day chat retention (its sweep still skips shell_history).
Enforces owner-only Unix mode (0600 / 0700) 3 / 9 33% OpenCode (0600 on .db, -wal, -shm), Goose (0700 on sessions/), and Claude Code (0600 on transcripts, with an open gap on workflow journals). Codex locks history.jsonl to 0600 but leaves rollout-*.jsonl at default umask (0644).
Uses SQLite WAL where deleted rows can linger 4 / 10 40% Cursor (state.vscdb), OpenCode (opencode.db), Goose (sessions.db), and Codex (state_5.sqlite, logs_2.sqlite). Without PRAGMA secure_delete = ON and VACUUM, deleted rows remain recoverable in free pages or uncheckpointed -wal frames.

Check your setup

OS:
Tools:
Claude CodePlaintext JSONL & JSON

Paths (macOS): ~/.claude/projects/<proj>/<id>.jsonl, ~/.claude/history.jsonl, ~/.claude/paste-cache/, ~/.claude.json

Offline read-only scan command for your selection:

npx leaktap@0.4.3

Read-only by default, zero telemetry, offline after npm download. On macOS/Linux you can also install via brew install vssinghh/tap/leaktap.

Key Findings

1. Zero of the 10 tools redact pasted secrets before writing to disk

None of the 10 tools scan user prompts or tool stdout for API keys, private keys, or database passwords before persisting conversation logs:

2. Deleting a chat in the UI does not always remove the secret from disk

Even if you realize you pasted a production key and immediately delete the chat in your editor or CLI, shadow copies and unvacuumed SQLite pages can keep the secret on disk:

3. Even the two tools with 30-day default retention leave forever-files behind

Seven of the 9 plaintext tools (Codex CLI, Cursor, Cline, Aider, OpenCode, Continue, and Goose) keep local chat history indefinitely by default. Codex CLI spawns a background worker (codex-rs/rollout/src/compression.rs:26,51) that compresses cold rollouts into .jsonl.zst archives rather than expiring them, and defaults history.jsonl to HistoryPersistence::SaveAll with max_bytes: None (codex-rs/config/src/types.rs:241-258).

The only two plaintext tools with automatic 30-day cleanup enabled out of the box still have gaps worth knowing:

4. Unix file permissions range from hardened 0600 (OpenCode) to world-readable 0644

On multi-user Linux workstations, bastion hosts, CI runners, or shared macOS machines, default umask (0022) creates files with mode 0644 (readable by any local user who can traverse the directory):

5. Windsurf is the one tool of the 10 that encrypts local chat history

To keep this audit fair, Windsurf deserves credit on local transcript confidentiality: Cascade conversations saved under ~/.codeium/windsurf/cascade/*.pb (and rolled-over sessions in ~/.codeium/windsurf/implicit/*.pb) are stored as high-entropy binary Protocol Buffer files encrypted per conversation UUID, not plaintext JSON or SQLite text. Raw grep, text editors, and offline secret scanners (including leaktap) cannot read those .pb transcripts. Plaintext artifacts in Windsurf remain limited to user-authored rules (~/.codeium/windsurf/memories/global_rules.md, .windsurf/rules/), MCP config (~/.codeium/windsurf/mcp_config.json), manually exported trajectories, and standard editor state.

Full 10-Tool Comparison Matrix

On-disk storage paths, retention, permissions, and verified gotchas across 10 AI coding tools (scroll horizontally on small screens)
Tool Primary On-Disk Storage Paths Format Redacts? Default Retention Unix Mode Key Verified Gotcha leaktap v0.4.3 Coverage
Claude Code ~/.claude/projects/<proj>/<id>.jsonl, ~/.claude/history.jsonl, ~/.claude/paste-cache/, ~/.claude.json Plaintext JSONL & JSON No 30d transcripts, history.jsonl forever 0600 transcripts (workflow journal.jsonl omits 0600) Official docs exempt history.jsonl from cleanupPeriodDays unless HIPAA config applies (#98575). Desktop/Cowork transcripts and auto-memory also exempt. Auto-scanned & scrubbed (~/.claude, ~/.claude.json minus login/MCP keys)
Codex CLI ~/.codex/history.jsonl, ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl (+ .zst), ~/.codex/{state_5,logs_2,memories_1}.sqlite Plaintext JSONL, .zst, SQLite WAL No Forever (SaveAll, compresses cold rollouts to .zst) Split: history.jsonl 0600, rollout-*.jsonl 0644 Literal // TODO: check `text` for sensitive patterns at lib.rs:119. Rollouts world-readable (#21660). Auto-scanned & scrubbed (plain .jsonl & SQLite, skips .jsonl.zst)
Cursor <AppConfig>/Cursor/User/{global,workspace}Storage/state.vscdb, ~/.cursor/projects/*/agent-transcripts/*.jsonl SQLite WAL + plaintext JSONL No Forever (no automatic cap or TTL) Default umask (0644) Sidebar deletion can leave orphaned agentKv blobs and unvacuumed pages until running Developer: Delete Old Chats... and Developer: GC Agent KV Blobs. Auto-scanned & scrubbed (state.vscdb + -wal + ~/.cursor, lock-checked)
Gemini CLI ~/.gemini/tmp/<proj>/chats/session-*.jsonl, logs/session-*.jsonl, tool-outputs/, shell_history Plaintext JSONL & text No 30d (sessionRetention.enabled: true) Default umask (0644) Strongest default chat expiry among plaintext tools (session-management.md:159), but sweep skips shell_history and sets no 0600 mode. Auto-scanned & scrubbed (~/.gemini)
Windsurf ~/.codeium/windsurf/{cascade,implicit}/*.pb, plaintext memories/global_rules.md, mcp_config.json, Windsurf/User/*/state.vscdb Encrypted binary .pb (plaintext rules/configs) N/A for .pb, No for rules/configs Rolls older threads to implicit/ (~20 active) Default umask (.pb encrypted per UUID) Only tool of 10 encrypting chat logs at rest. Plaintext rules, .windsurf/rules/, and mcp_config.json remain unencrypted. Auto-scanned for plaintext rules, MCP configs & IDE state (cannot read .pb)
Cline ~/.cline/data/sessions/ (messages.jsonl, manifest.json), tasks/taskHistory.json, legacy VS Code globalStorage/saoudrizwan.claude-dev/tasks/ Plaintext JSONL & JSON No Forever Split: secrets.json 0600, sessions 0644 VS Code migration copies into ~/.cline/data/ while leaving old VS Code storage intact (storage.md). Session writes omit 0600. Auto-scanned for VS Code saoudrizwan.claude-dev, pass ~/.cline/data explicitly for new store
Aider <git-repo-root>/.aider.chat.history.md, <git-repo-root>/.aider.input.history Plaintext Markdown & text CLI flags only Forever (append-only) Default umask (0644) Written inside every git repo root and added to .gitignore (main.py:164). scrub_sensitive_info (main.py:750) does not scrub chat history. Auto-scanned & scrubbed in current working directory
OpenCode ~/.local/share/opencode/opencode.db (+ -wal, -shm, respects XDG_DATA_HOME) SQLite WAL No Forever 0600 on .db, -wal, -shm Best Unix permission hygiene among plaintext tools (database.ts:86-99), still unencrypted plaintext in SQLite WAL forever. Explicit path: scan ~/.local/share/opencode, pass opencode.db directly to clean
Continue ~/.continue/sessions/<id>.json, ~/.continue/dev_data/0.2.0/chatInteraction.jsonl Plaintext JSON & JSONL No Forever Default umask (0644) UI delete only removes sessions/<id>.json (history.ts:60-84), leaving full prompts forever in always-on dev_data/0.2.0/chatInteraction.jsonl (log.ts:95-106). Auto-scanned & scrubbed (~/.continue, including sessions/ and dev_data/)
Goose ~/.local/share/goose/sessions/sessions.db (+ -wal, Windows %APPDATA%\Block\goose\data\sessions\sessions.db) + legacy .jsonl SQLite WAL + legacy JSONL No Forever 0700 on sessions/ Locks sessions/ to 0700 (session_manager.rs:1094), but delete_session() skips VACUUM (L2618-2639) and leaves legacy .jsonl unmanaged. Explicit path: scan ~/.local/share/goose/sessions, pass sessions.db directly to clean

<AppConfig> resolves to ~/Library/Application Support on macOS, ~/.config (or $XDG_CONFIG_HOME) on Linux, and %APPDATA% on Windows.

Pinned Commits & Primary Sources

Every open-source line link in this report is pinned to the exact commit verified on December 3, 2026:

Pinned commits and official references verified on December 3, 2026
Tool Repository / Source Stars Verified Commit / Reference
OpenCodeanomalyco/opencode230,7201a8580d778bd8ebadd12a66ee0c36790b87ebadb (dev)
Claude Codeanthropics/claude-code157,942Official .claude directory docs, #98575, #109279
Codex CLIopenai/codex137,152c4c02a3b7aadb7e6ad5b2ad1f27c0851dc80943b (main), #21660
Gemini CLIgoogle-gemini/gemini-cli109,542d2d10b90a3213704c77c31b58cbb5669cfdadecd (main)
Clinecline/cline72,038fa6a3452b84b64cf6b04c59aebdb42f1386c540a (main)
Gooseaaif-goose/goose57,26360ff58bfce225d74828bf45834d1f8a4e221e67c (main)
AiderAider-AI/aider50,3425dc9490bb35f9729ef2c95d00a19ccd30c26339c (main)
Continuecontinuedev/continue36,6105522c6f44ca0ac3528b37244818fbfa39b5af470 (main)
CursorClosed-source editorN/AOfficial Cursor docs/forum (state.vscdb cursorDiskKV, agent-transcripts/*.jsonl, Command Palette GC commands)
WindsurfClosed-source editorN/ACodeium/Windsurf local Cascade storage (~/.codeium/windsurf/cascade/*.pb per-UUID encrypted protobufs, plaintext rules/MCP configs)

Practical Hardening Checklist (Built-In Controls First)

You can tighten local secret retention on every tool right now without installing anything extra:

  1. Claude Code: Lower cleanupPeriodDays in ~/.claude/settings.json (minimum 1, setting 0 fails validation), set CLAUDE_CODE_SKIP_PROMPT_HISTORY=1 in sensitive environments to stop writing transcripts and history.jsonl, and periodically prune ~/.claude/history.jsonl manually.
  2. Codex CLI: Add [history] with persistence = "none" (or set max_bytes) in ~/.codex/config.toml, and tighten rollout permissions on shared Unix machines with chmod -R go-rwx ~/.codex/sessions.
  3. Cursor: Run Developer: Delete Old Chats... and Developer: GC Agent KV Blobs from the Command Palette, and prune ~/.cursor/projects/*/agent-transcripts/ after sensitive debugging sessions.
  4. Gemini CLI: Shorten general.sessionRetention.maxAge (for example "7d") in ~/.gemini/settings.json and clear ~/.gemini/tmp/*/shell_history separately.
  5. Continue: After deleting sensitive threads in the History UI, also clear ~/.continue/dev_data/0.2.0/chatInteraction.jsonl.
  6. Aider: Pass --chat-history-file /dev/null when working near credentials, or remove .aider.chat.history.md and .aider.input.history from project directories.
  7. Goose & OpenCode: After deleting a sensitive session, compact the database with sqlite3 ~/.local/share/goose/sessions/sessions.db "VACUUM;" (or opencode.db) while the tool is closed so deleted pages and -wal frames are cleared. On Goose, also check ~/.local/share/goose/sessions/ for unmanaged pre-v1.10 .jsonl files.
  8. Cline: Tighten permissions on ~/.cline/data/sessions (chmod -R go-rwx ~/.cline/data/sessions) and remove legacy VS Code globalStorage/saoudrizwan.claude-dev/tasks/ if you migrated to ~/.cline/data/.

Audit and Scrub Your Own Machine

If you do not want to dig through hundreds of JSONL logs and SQLite -wal files by hand, run leaktap (v0.4.3, single 6 to 8 MB MIT Rust CLI, zero telemetry, offline after download):

# 1. Read-only scan across the 8 auto-discovered tools (Claude Code, Codex, Cursor,
#    Gemini CLI, Windsurf configs/rules, VS Code Cline, Aider, Continue) + MCP configs
npx leaktap@0.4.3

# 2. Scan OpenCode, Goose, and Cline's newer ~/.cline/data directory explicitly
npx leaktap@0.4.3 scan ~/.local/share/opencode ~/.local/share/goose/sessions ~/.cline/data

# 3. Preview local log and SQLite redactions (dry run, modifies nothing), then scrub in place
npx leaktap@0.4.3 clean
npx leaktap@0.4.3 clean --apply

# 4. Scrub explicit SQLite databases outside default auto-discovery (pass the .db file directly)
npx leaktap@0.4.3 clean ~/.local/share/opencode/opencode.db
npx leaktap@0.4.3 clean ~/.local/share/opencode/opencode.db --apply
npx leaktap@0.4.3 clean ~/.local/share/goose/sessions/sessions.db --apply
Terminal session running leaktap v0.4.3 to block an outgoing Stripe key, catch outbound MCP startup hosts, and scan local Claude, Cursor, and MCP files
Live secret blocking, MCP startup wiretapping, and offline disk scan with leaktap v0.4.3.

Pass --backup with --apply only if you want 0600 .leaktap.bak copies before editing (off by default so raw secrets are not left behind in backup files). On macOS or Linux you can also install once with brew install vssinghh/tap/leaktap and run leaktap directly instead of npx leaktap@0.4.3.

Honest limitations: leaktap v0.4.3 cannot inspect Windsurf's encrypted .pb Cascade files or decompress Codex CLI's cold .jsonl.zst archives on disk. Close open editors before running clean --apply on state.vscdb, opencode.db, or sessions.db (if a database holds an active lock, leaktap skips it safely rather than risking corruption). Scrubbing local disk only cleans up local exposure. Rotate any credential that was already sent to a model API or pushed to git.