Don't let Claude Code delete your session logs
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Claude Code silently deletes your local session logs after 30 days unless you change one setting.
Claude Code is a programming assistant from Anthropic that runs on your computer. It secretly saves a full record of your conversations as files on your machine, but it deletes those files after 30 days by default and this cannot be switched off. The author says you can delay the deletion for 274 years by adding one line to a settings file. This affects anyone who uses Claude Code and wants to keep their history.
Anthropic's Claude Code coding agent automatically purges local session logs after 30 days by default, and this behavior cannot be fully disabled, a data-retention risk for teams relying on those logs for audits or documentation. The only mitigation is editing ~/.claude/settings.json to set cleanupPeriodDays to 99999, delaying deletion for roughly 274 years. The author's own logs totaled 379MB. Engineering teams should apply this setting now.
Claude Code writes full session transcripts as newline-delimited JSON to ~/.claude/projects/encoded-directory/*.jsonl; the author had 379MB accumulated. The known GitHub issue 4172 documents that these files are deleted after 30 days by default via the cleanupPeriodDays setting, which cannot be disabled entirely, maximum practical mitigation is 99999 days (~274 years) in ~/.claude/settings.json. The author also published a Python converter (claude_to_markdown.py) that transforms jsonl logs into readable Markdown.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Claude Code Anthropic Simon Willison Deepseek-OCR NVIDIA Spark GitHub
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.