Hammer Capsa

Where Claude Code stores its records, and when it deletes them

This page explains where Claude Code writes its session records on your machine, what they contain, and the 30 day deletion that removes them. Last updated August 5, 2026.

Where the records are

Every Claude Code session is written to your own disk as it happens. The transcripts live at ~/.claude/projects/, one folder per project directory you have worked in, one JSONL file per session, named by session id. The files are plaintext.

A transcript is a complete record of the session: every message you typed, every response, every tool the agent ran and what came back, timestamps, and the working directory. Alongside the transcripts, ~/.claude also holds a global history of your typed inputs across all sessions, file snapshots taken before edits, and shell output captures.

The 30 day deletion

By default, Claude Code deletes session files and other application data older than 30 days. The cleanup runs automatically at startup. The setting is called cleanupPeriodDays, it lives in ~/.claude/settings.json, and its default is 30.

For standard command line use there is no cloud copy. The local JSONL files are the only record of the session anywhere, so when the cleanup removes them the record no longer exists. The deletion is silent: no warning, no summary of what is about to be removed, and no trash to recover from.

What the built in tools cover

Claude Code has an /export command. It exports the current session only, rendered as readable text rather than the raw record. There is no official bulk export and no built in archive for sessions beyond the cleanup window.

You can extend the window by setting cleanupPeriodDays to a large number in ~/.claude/settings.json. The files then remain on one machine, in a hidden folder, in plaintext.

Keeping the record

The capsa command line tool copies your Claude Code records out of ~/.claude/projects and into a vault folder you own before the cleanup reaches them. It is free, the copy is byte for byte, and it takes one command:

pip install hammer-capsa
capsa

Running capsa again saves only what is new. An account at capsa.hammerai.ai adds a synced cloud archive with the same records browsable alongside your other AI tools. The local vault works on its own, with no account. On a default installation every session older than 30 days is already gone, and nothing recovers it.