<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aditya Ghadge</title>
    <description>The latest articles on DEV Community by Aditya Ghadge (@adityashipshq).</description>
    <link>https://dev.to/adityashipshq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2071225%2F25c09df9-6fda-4206-8970-e7d12f11606e.jpg</url>
      <title>DEV Community: Aditya Ghadge</title>
      <link>https://dev.to/adityashipshq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adityashipshq"/>
    <language>en</language>
    <item>
      <title>Claude Code sessions disappeared? It deletes them after 30 days</title>
      <dc:creator>Aditya Ghadge</dc:creator>
      <pubDate>Sun, 11 Oct 2026 19:16:34 +0000</pubDate>
      <link>https://dev.to/adityashipshq/claude-code-sessions-disappeared-it-deletes-them-after-30-days-2887</link>
      <guid>https://dev.to/adityashipshq/claude-code-sessions-disappeared-it-deletes-them-after-30-days-2887</guid>
      <description>&lt;p&gt;if an old claude code session is missing from &lt;code&gt;/resume&lt;/code&gt;, there are two possible reasons. it was deleted, or it's still there and the picker just can't find it&lt;/p&gt;

&lt;h2&gt;
  
  
  1. claude code deletes old sessions after 30 days
&lt;/h2&gt;

&lt;p&gt;claude code saves every session as a &lt;code&gt;.jsonl&lt;/code&gt; file under &lt;code&gt;~/.claude/projects/&lt;/code&gt;, one folder per project&lt;/p&gt;

&lt;p&gt;there's a setting called &lt;code&gt;cleanupPeriodDays&lt;/code&gt;. by default it's 30. claude code regularly deletes session files that haven't been touched in that many days, without any message. no warning, no recycle bin. (sessions you started or last continued in the claude desktop app are exempt since v2.1.248, unless your company's managed settings set cleanupPeriodDays. then they get deleted too, and your own 3650 won't override it)&lt;/p&gt;

&lt;p&gt;this is about the files on your machine, not claude.ai chats&lt;/p&gt;

&lt;p&gt;i checked my own machine. my prompt history goes back to march, but every session older than 30 days is just gone. 86 of them&lt;/p&gt;

&lt;p&gt;to stop it, open &lt;code&gt;~/.claude/settings.json&lt;/code&gt; and set a big number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cleanupPeriodDays"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3650&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;that's about 10 years. 0 doesn't mean "keep forever", it fails validation (older versions used to stop saving sessions entirely with 0). so just use a big number&lt;/p&gt;

&lt;p&gt;sessions that were already deleted are gone. nothing on your machine has them anymore&lt;/p&gt;

&lt;h2&gt;
  
  
  2. it's still there, the picker just doesn't show it
&lt;/h2&gt;

&lt;p&gt;if the session is under 30 days old (or you already raised the setting), it's probably still on disk. &lt;code&gt;/resume&lt;/code&gt; misses it for two reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it only shows sessions from the project you're in. press &lt;code&gt;ctrl+a&lt;/code&gt; in the picker to see every project&lt;/li&gt;
&lt;li&gt;typing in the picker only matches session titles, not what you actually said. titles are usually your first message, like "fix this" or "look at the error"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;so if you remember the topic but not the folder or the first message, the picker won't help much&lt;/p&gt;

&lt;h2&gt;
  
  
  3. search inside the sessions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;manual way.&lt;/strong&gt; grep the files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-ril&lt;/span&gt; &lt;span class="s2"&gt;"payload size"&lt;/span&gt; ~/.claude/projects/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it works, but you get raw json, you have to work out which session the file is, and then &lt;code&gt;cd&lt;/code&gt; to the right folder and run &lt;code&gt;claude --resume &amp;lt;id&amp;gt;&lt;/code&gt; yourself&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what i use.&lt;/strong&gt; i got tired of that and built &lt;a href="https://github.com/Aditya-A-G/ccback" rel="noopener noreferrer"&gt;ccback&lt;/a&gt;, a free open-source cli:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; ccback
ccback payload size
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it searches everything you and claude wrote in every session across all your projects (by words and by meaning), shows the matching message, and enter reopens that session in its original folder&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvd6eueiz97cwq1mlepf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvd6eueiz97cwq1mlepf.gif" alt="ccback demo" width="600" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;one honest note: ccback reads the same files, so it can't bring back sessions claude code already deleted. raise &lt;code&gt;cleanupPeriodDays&lt;/code&gt; first&lt;/p&gt;

&lt;h2&gt;
  
  
  tldr
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;sessions older than 30 days get deleted on startup. set &lt;code&gt;"cleanupPeriodDays": 3650&lt;/code&gt; in &lt;code&gt;~/.claude/settings.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/resume&lt;/code&gt; shows one project and matches titles only. &lt;code&gt;ctrl+a&lt;/code&gt; shows all projects&lt;/li&gt;
&lt;li&gt;to search what was actually said: &lt;code&gt;grep -r&lt;/code&gt; in &lt;code&gt;~/.claude/projects/&lt;/code&gt;, or &lt;code&gt;ccback&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>productivity</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
