Guide
Where AI coding assistants store your prompts on disk
Yes, AI coding assistants store your prompts on disk, in cleartext, on the developer's own
machine. Each one keeps a conversation history file so it can resume a session, and that file
holds whatever was pasted into the prompt: an API key, a database URI, the contents of a
.env. The table below gives the exact path, file format and relocation variable for each of
the 15 assistants Skarn reads.
This is separate from what the vendor keeps server-side. A zero-retention or no-training setting governs the vendor's copy, not this one. The local file exists either way, it is readable by anything running as that user, and it is backed up by whatever backs up the home directory.
Last updated 2026-11-03.
The session store, per assistant
Paths are written as they resolve on macOS and Linux. On Windows, a
~/Library/Application Support or ~/.config prefix becomes
%APPDATA%. GitHub Copilot takes two rows because the CLI and VS Code agent mode keep
separate stores; they are one assistant in the count of 15. Copilot in
Code, the coding workspace of the Microsoft Copilot app, runs only on Windows, so its row gives the
Windows path, and it counts as an assistant of its own. Cowork and Claude Enterprise sessions reach
Skarn as a Compliance API export rather than a local store, so they have no row.
| Assistant | What it writes | Format | Relocate with |
|---|---|---|---|
| Claude Code | ~/.claude/projects/<dir>/*.jsonl |
JSONL transcript, one per session | CLAUDE_CONFIG_DIR |
| Codex CLI | ~/.codex/sessions/rollout-*.jsonl, also .jsonl.zst |
JSONL rollout, optionally zstd-compressed | CODEX_HOME |
| Gemini CLI | ~/.gemini/tmp/<dir>/chats/session-*.json or .jsonl, plus
logs.json |
Chat document and a separate prompt log | None |
| Grok Build (formerly Cursor) | ~/Library/Application Support/Cursor/User/state.vscdb,
~/.cursor/projects/*.jsonl, plus
~/.grok/agent-host-daemon/sessions/<id>/session.sqlite |
SQLite editor state, JSONL agent transcripts, plus one SQLite database per session from the desktop app 3.33 on macOS | GROK_HOME (session databases) |
| GitHub Copilot (VS Code) | ~/Library/Application Support/Code/User/state.vscdb, plus
workspaceStorage/*/GitHub.copilot-chat/transcripts/*.jsonl and the chat-session
journals beside it |
SQLite editor state, plus JSONL transcripts | None |
| GitHub Copilot CLI | ~/.copilot/session-state/<id>/events.jsonl |
JSONL event log | COPILOT_HOME |
| Copilot in Code | %LOCALAPPDATA%\Microsoft\Copilot\User Data\CopilotCodingHome\<profile>\session-state\<id>\events.jsonl |
JSONL event log, plus a SQLite session index | None |
| Grok Build CLI | ~/.grok/sessions/<dir>/<id>/chat_history.jsonl,
~/.grok/agent-host/sessions/<id>/session.sqlite, plus
prompt_history.jsonl |
JSONL transcript (1.x), one SQLite database per session (2.0, read on macOS), plus a per-directory prompt log | GROK_HOME |
| Grok Bot | ~/Library/Application Support/Grok Bot/sand-client-persistence/*.blob |
Cleartext transcript replica, one file per conversation | None |
| Kimi Code CLI | ~/.kimi-code/sessions/<dir>/<id>/agents/<agent>/wire.jsonl,
plus user-history/*.jsonl |
JSONL transcript per agent, plus a prompt log | KIMI_CODE_HOME |
| Antigravity | ~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript_full.jsonl,
plus ~/Library/Application Support/Antigravity/User/state.vscdb |
JSONL transcript, plus SQLite editor state | None |
| OpenCode | ~/.local/share/opencode/, both opencode*.db and stored JSON |
SQLite database and JSON storage | XDG_DATA_HOME |
| Cline | ~/.cline/data/sessions/<id>/<id>.messages.json, plus the pre-4.0
~/.cline/data/tasks/<id>/api_conversation_history.json and the same task tree under
~/Library/Application Support/{Code,Cursor,Windsurf}/User/globalStorage/saoudrizwan.claude-dev/tasks/<id>/ |
JSON message history, plus a compaction sidecar | CLINE_DATA_DIR or CLINE_DIR |
Each path is verified against the vendor's own source or documentation, or measured on the app itself, and re-checked on a schedule: a row older than 45 days fails Skarn's build. This is the same table the scanner discovers from, so a path that moves upstream is a bug in the product, not just in this page.
Why this matters more than vendor retention
Turning off training or buying a zero-retention plan changes what the vendor keeps. It does not stop the assistant writing the transcript to the developer's disk, because the assistant needs that file to resume the session.
gitleaks and trufflehog scan repositories and commit history. A key pasted into a chat and never committed never enters git, so it is invisible to them. Different surface, different tool. See the tools comparison.
The environment variables in the table move the store. They do not encrypt it or strip anything out of it. A credential in a transcript stays valid until somebody rotates it, wherever the file lives.
If a key reached a transcript, treat it as exposed and rotate it. Removing the transcript afterwards is housekeeping, not remediation.
How to check what is actually in there
Reading these files by hand does not scale past one machine, and grepping for
sk- finds the credential types you already thought of.
Skarn discovers every store in the table
automatically, parses each format, and runs 255 detection rules across 200-plus
credential types. The command is skarn check. It runs locally and makes no network call
by default.
Every reported secret is shown truncated, attributed to the exact session and message, and scored on a 0-100 risk scale. Output is text, JSON, or SARIF 2.1.0 for a SIEM.
Skarn surfaces the exposure. Your team rotates the credential and coaches the developer. In CI, gate on severity or risk score so a leak fails the build.
The free tier includes the full local product under a registered license, issued at getskarn.com/free. Install instructions are on the install page.