← Claude Code Hub
Jul 5, 2026 · 3 min read ✦ Tip #125

The Claude Code folder that keeps everything you type, in plain text

Open `~/.claude/projects/` and count: every session you've had with Claude Code is there, in plain text, unencrypted. The prompts, the responses, and the token you pasted without thinking. 30 days by default.

Claude Code's ~/.claude/projects/ folder keeps every session as an unencrypted .jsonl: 548 conversations and 541 MB in plain text, with a pasted token in the clear, and the cleanupPeriodDays control to shorten the 30-day retention

TL;DR Every Claude Code session is saved as a .jsonl file in plain text under ~/.claude/projects/ (your prompts, the responses, and whatever you pasted, tokens included). By default they live 30 days. Shorten retention with cleanupPeriodDays in settings.json, or turn writing off entirely with CLAUDE_CODE_SKIP_PROMPT_HISTORY. It's the same data that powers --resume and Rewind.

I opened my ~/.claude/projects/ folder and found 548 conversations, 541 MB, 14 projects. All in plain text. Every prompt I've typed, every response, every secret I pasted without thinking, sitting there, unencrypted. It's not a bug: it's exactly what makes resuming a session and rewinding possible. But it's worth knowing where it lives and how long it stays.

Where it lives

~/.claude/projects/<project-path>/<session-id>.jsonl

One folder per project (the path's / turned into -), one .jsonl per session, and each line is a JSON event: your prompt, the response, every tool call. Unencrypted. It's what --resume and Rewind with checkpoints read from. It's also what Claude Code sizes up when, on Pro and Max, it shows you the resume dialog that shows what an old conversation costs your 5-hour limit. And when a session exits with "unrecoverable interface error" and not even --resume brings it back, this is the file you rename: ten causes, one update.

Long pastes live separately, under ~/.claude/paste-cache/, and this same sweep deletes them: how to expand a pasted text before it expires.

See it for yourself

du -sh ~/.claude/projects/                          # how much it takes up
find ~/.claude/projects -name '*.jsonl' | wc -l     # how many conversations

And because every event carries its token counters, the same file doubles as an audit trail: add them up and you can see how much of a session went into re-reading its own history, which is a number no command will give you.

What to do

1. Shorten retention

In ~/.claude/settings.json:

{ "cleanupPeriodDays": 7 }

Default 30 days, minimum 1 (0 is rejected with a validation error). At startup, it deletes the older transcripts. It applies on the next session, not live. That same number sets the expiry on the worktrees of subagents and background sessions, which take up far more room than a transcript. Sessions opened from Claude Desktop or Cowork don't expire under this setting: for those there's the /storage panel and desktopSessionCleanupPeriodDays.

2. Turn it off entirely

export CLAUDE_CODE_SKIP_PROMPT_HISTORY=1   # stop writing transcripts

In headless or the SDK, --no-session-persistence (or persistSession: false). Mind the tradeoff: with no transcripts you lose --resume and Rewind, because both read from there.

3. Delete what's already there

It's a normal folder. Remove the sessions you don't want to keep (carefully):

rm ~/.claude/projects/<project>/<session-id>.jsonl

To delete everything Claude Code keeps about a project at once (not just the conversations), use claude purge.

Reference

Control What it does
cleanupPeriodDays (in settings.json) Retention in days. Default 30, minimum 1
CLAUDE_CODE_SKIP_PROMPT_HISTORY=1 Stops writing transcripts (interactive session)
--no-session-persistence / persistSession: false Same thing, in headless or the SDK

Heads up:

  • It's a tradeoff, not a free switch: turning writing off kills --resume and Rewind.
  • The cleanupPeriodDays deletion runs at startup, so a freshly written transcript stays on disk until a later session crosses the cutoff.

This is the hidden side of Rewind with checkpoints: that feature is convenient because your history lives on disk; this tip is where it lives and how to control its lifetime.

Official docs: Settings (cleanupPeriodDays)

Related: Rewind: undo changes with checkpoints

Requirements

  • A settings.json in ~/.claude/ (user) or .claude/ (project). The change applies when the next session starts.

Found this useful? See more of wmedia.es in your Google results.

Add wmedia.es as a preferred source on Google
FREE GUIDE

Approve less, but better.

Ten minutes in, you're hitting yes without reading. That's not review, that's prayer. A 10-page guide with the five levers in order of risk.

  • 1. Rules the first match wins
  • 2. Mode a dial, not a switch
  • 3. Auto mode a classifier approves for you
  • 4. Sandbox a fence the OS puts up
  • 5. Bypass only inside a container
Are you a professional Web developer?

You'll receive the guide by email · You join the Gravitas newsletter · Unsubscribe anytime

of 10
#

Wmedia · 10 pages
FREE GUIDE · 10 pages · 5 levers

Approve less, but better.

Ten minutes in, you're hitting yes without reading. That's not review, that's prayer. A 10-page guide with the five levers in order of risk.

Are you a professional Web developer? · Unsubscribe anytime
How I use AI

My Claude Code workflow.

The skills, agents and instructions I use as a professional Software Engineer. It's called Craft, and it's a plugin you can install.

See the skills

Tired of approving permissions without reading?