DigestAI news desk

Cut through the AI noise.

Agents & Tools5 min read

Claude Code deletes local coding sessions after 30 days

Coding agent session histories contain valuable data on failed attempts, cost drivers, and correction patterns, but they are often ephemeral. The author argues that these transcripts are essential for debugging agent behavior and auditing billing, yet they face automatic deletion. Claude Code’s default settings remove local session records older than 30 days, including tool calls and results. If…

1 source

Key points

  • Claude Code automatically deletes local session files older than 30 days by default.
  • Session transcripts reveal cost drivers and failure patterns that final diffs hide.
  • Users can extend Claude Code retention to 365 days via settings.json.

The article highlights specific cases where session data revealed issues that metrics alone missed. For instance, a benchmark attempt cost 9x more than baseline due to a plugin rewriting commands, a detail only visible in the trajectory. Similarly, LangChain improved its agent’s pass rate from 52.8% to 66.5% by analyzing session logs to fix repeated failures. The author also notes that forgotten model configurations, such as using an older model version, can skew usage data and costs.

To prevent data loss, the author recommends backing up session files to off-device storage. For Claude Code users, changing the cleanupPeriodDays setting to 365 in settings.json can extend retention, though independent backups are still necessary to guard against accidental deletion or hardware failure. The post includes specific file paths for macOS, Linux, and Windows to help users locate and secure these records.

Full story from kotrys.dev · by Bartosz Kotrys · via Reddit AI communitiesOpen source ↗

Your agentic coding sessions are a treasure

kotrys.dev · 2 November 2026

Loading the full article…

This text was published by kotrys.dev and written by Bartosz Kotrys. It is reproduced here with attribution so you can read it in full; the rights remain with the publisher. Read it at the source ↗

Coverage and discussion

1source
Topics · follow one to build your own front page

The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.

Comments

via GitHub Discussions

More in Agents & Tools

All →

Related stories