← Claude Code Hub
✦ Tip #125 Jul 5, 2026

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.

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.

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

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.
Free guide

The 51 essentials, as a guide.

One page per tip. Five chapters. What I actually use daily in production. No theory, no fluff.

  • I. Getting started 10 tips
  • II. Awareness 3 tips
  • III. Mastery 22 tips
  • IV. Autonomy 10 tips
  • V. Comparison 6 tips
Are you a professional Web developer?

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

of 51
#

Wmedia · 51 Tips
Free guide · 51 tips · 5 chapters

The 51 essentials, as a guide.

Are you a professional Web developer? · Unsubscribe anytime
Workshop for teams

Multiply your team's output without sacrificing quality: a 6 to 8 hour AI First workshop, online, on the Claude platform.

See the workshop

Want the 51 Claude Code essentials as a guide?