GUIDE

Where Claude Code stores your prompt history

Claude Code saves every prompt you type to ~/.claude/history.jsonl in your home folder. Inside Claude Code, Ctrl+R searches it and claude --resume reopens a past session. Below: where each file lives, how long Claude Code keeps it, how to search it from the terminal, and where Codex and Cursor keep theirs.

The files

  • ~/.claude/history.jsonl holds every prompt you type, one JSON line each. display is the text, project the folder you were in and timestamp when you sent it.
  • ~/.claude/paste-cache holds text you paste into a prompt. Some pasted text is kept inside the history line; the rest goes here, and the line keeps only a reference to it.
  • ~/.claude/projects holds full session transcripts, one folder per project: your prompts, Claude’s answers and the tools it ran. This is what claude --resume reads.

How long Claude Code keeps it

Session transcripts in ~/.claude/projects are kept for 30 days by default and then deleted. The cleanupPeriodDays setting changes that. Pasted text isn’t kept for good either, so an old prompt can lose what you pasted into it.

Search it inside Claude Code

  • Up arrow steps back through your earlier prompts.
  • Ctrl+R searches the prompts you typed, as you type.
  • claude --continue (-c) reopens the most recent conversation in the current folder.
  • claude --resume (-r) shows a list of past sessions to pick from, or opens one by its ID or name.

Claude Code keeps input history per working directory. Up arrow, Ctrl+R and --continue find what you wrote in the project you’re in, not the prompt you wrote last month in another repository.

Search it from the terminal

history.jsonl is plain text, so grep works:

grep -i "migration" ~/.claude/history.jsonl

With jq, print only the project and the prompt:

jq -r '"\(.project)\t\(.display)"' ~/.claude/history.jsonl | grep -i "migration"

Text that went to the paste cache isn’t in history.jsonl, so search ~/.claude/paste-cache as well, and ~/.claude/projects for Claude’s answers.

Codex and Cursor keep their own

Codex writes each session to a rollout-*.jsonl file under ~/.codex/sessions (some are compressed, ending in .jsonl.zst). codex resume reopens a session, and codex resume --last the most recent one in the current folder.

Cursor keeps chats in a SQLite database, ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb, and has its own search for past chats. Cursor writes to it all the time and keeps recent changes in a separate -wal file, so open it read-only (sqlite3 "file:$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb?mode=ro") rather than copying the file on its own.

Search all three in one place

Each tool keeps its history in its own place and format. Repertoire is a Mac app that reads these files, read-only, and puts every prompt from Claude Code, Codex and Cursor in one list you can search by words, project, tool or date. It keeps each prompt after the tool deletes its copy, and its launcher pastes any of them where you’re typing with ⌘⇧Space. Your history stays on your Mac: see what Repertoire reads and stores.

Checked against the Claude Code and Codex documentation, and the files Repertoire reads, on 2 December 2026.

Free for 14 days. Then buy it once.

Download for Mac7 MB

macOS 15 or later · No account · No subscription