Where 6 AI coding CLIs hide your session logs

lines of HTML codes

Every AI coding CLI you run is writing the full conversation to disk. Lucian Ghinda has six of them installed and spent time in July 2026 tracking down exactly where each one stores its session files, what format it uses, and whether anything ever gets cleaned up automatically.

The short answer: only one tool deletes old sessions for you, only two document where the files live, and one of those 2.6 GB log files belongs to opencode.

The quick reference table

ToolPathFormatAuto-deletion
Claude Code~/.claude/projects/<project>/<session>.jsonlJSONL30 days default (cleanupPeriodDays)
Codex CLI~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl (undocumented)JSONLNone for rollouts
Cursor CLI~/.cursor/chats/<id>/<uuid>/store.db (undocumented)SQLiteNone
Amp CLI~/.local/share/amp/threads/T-*.json plus server copyJSON per threadServer side only, 30 days after deletion
opencode~/.local/share/opencode/opencode.dbSQLiteNone
pi~/.pi/agent/sessions/--<cwd>--/<ts>_<uuid>.jsonlJSONL, tree-shapedNone
black flat screen computer monitor

Five things worth knowing

  • Transcripts are plaintext. As Claude Code’s own docs state, OS file permissions are the only protection. If an agent ever read a .env file during a session, those values are now sitting unencrypted in your home directory.
  • Only Claude Code auto-deletes. Its cleanupPeriodDays setting defaults to 30 days (minimum 1). Every other tool accumulates sessions until you manually intervene. Ghinda’s opencode log file hit 2.6 GB with no size cap in place.
  • The Codex [history] config is a trap. Setting persistence = "none" in the [history] section stops writing ~/.codex/history.jsonl but does not stop the full rollout files in sessions/. Those keep landing regardless.
  • Cursor CLI and the IDE use separate stores that do not sync. ACP-mode sessions go to a third location, ~/.cursor/acp-sessions/. None of this is documented. The ~/.cursor/chats path was confirmed by Cursor staff on a forum post, not in the official docs.
  • Environment variables move these paths silently. XDG_CONFIG_HOME relocated Ghinda’s entire Cursor chat store. CLAUDE_CONFIG_DIR, CODEX_HOME, and PI_CODING_AGENT_DIR do the same on purpose. Check your env before trusting any path.

The two honest outliers

Amp stores the real copy on its servers and syncs a local mirror to ~/.local/share/amp/threads/. Deleted thread data is removed within 30 days of deletion on the standard plan. Zero data retention is an Enterprise feature.

pi is the best-documented tool in the group. It publishes the path, the deletion flow, and the complete on-disk format. Its /share command exports the session to HTML and uploads it as a secret GitHub gist in your own account. No vendor server holds the data.

The practical check to run today

Look at whether these directories fall inside anything you sync or back up. Dropbox, iCloud, and Time Machine will copy plaintext transcripts of every session you have ever run, and nothing in the setup prompts you first.

Full breakdown with paths, schema details, and the opencode SQLite migration notes at the source link.

Stay on top of AI & Automation with BizStack Newsletter
BizStack  —  Entrepreneur’s Business Stack
Logo