Skip to content

[BUG] claude --resume shows "No conversations found" despite session directories existing #18311

Closed

Description

@adrianxsusec

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description:
Session directories exist in ~/.claude/projects/ with subagent .jsonl files, but the main conversation .jsonl files are missing. This causes --resume to fail even though sessions were
recently used.

Environment:

  • macOS Darwin 25.2.0
  • Claude Code CLI

Evidence:

  • cleanupPeriodDays is set to 0
  • Session directories exist (e.g., a96feba5-76c5-4844-b54a-5b934eec1110/)
  • Each contains subagents/ folder with .jsonl files
  • No main *.jsonl file exists at the session root level
  • Sessions as recent as yesterday (Jan 14) are affected

What Should Happen?

Expected: Main conversation files should be saved and --resume should find them.

Error Messages/Logs

claude --resume
  No conversations found to resume.
  Press Ctrl+C to exit and start a new conversation.

Steps to Reproduce

Steps to Reproduce:

  1. Have existing Claude Code sessions in ~/.claude/projects/
  2. Run claude --resume
  3. Get "No conversations found to resume" despite session directories existing
  4. Check ~/.claude/projects/// - directories exist with subagents/ folders
  5. No main *.jsonl file exists at session root level

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.7

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

No response

Activity

  1. abitofhelp commented on Jan 18, 2026

    @abitofhelp

    I am experiencing exactly the same issue, except my version of Claude Code is 2.1.11 and I am on macOS Tahoe 26.2. I have been working in my project for a month or longer without issues. I finished working in the project at 2026-01-16T06:40:00Z. I always export at the start and end of a session, so I have the export if it would be helpful. I will be able to load it for some context, but I do not know what issues that may cause.

    [edit] I opened the exported file and found the following at the top:
    ▐▛███▜▌ Claude Code v2.1.9
    ▝▜█████▛▘ Opus 4.5 · Claude Max
    ▘▘ ▝▝ ~/Ada/github.com/abitofhelp/adafmt
    ══════════════════ Conversation compacted · ctrl+o for history ═════════════════

    So, in my last session, I was using Claude Code 2.1.9 and somehow it was updated since that time to 2.1.11 and won't resume. I need to see if I can return to 2.1.9 to see if things work. I will report the result.

    [edit] I tried to install the previous version and resume, but had the same issue.
    npm install @anthropic-ai/claude-code@2.1.9

    added 3 packages, and audited 4 packages in 1s

    2 packages are looking for funding
    run npm fund for details

    found 0 vulnerabilities
    √ adafmt % claude --resume
    No conversations found to resume.

    When I launched claude in another directory to avoid potential issues with my project, I found that 2.1.9 was not installed, but it appears that a new release 2.1.12 was applied. I returned to my project folder and tried to resume with 2.1.12, but the issue persists. Next step is to uninstall claude and try to install 2.1.9 again.

    [edit] Okay, so I removed 2.1.12 but did not delete my $HOME/.claude folder. In fact, I made a backup of it, just in case... After removing that version, my data files were okay, I installed 2.1.9, and successfully resumed with claude. Here are the steps to nirvana:

    +--------------+
    | SOLUTION |
    +--------------+

    remove current binary but keep our data.

    npm uninstall -g @anthropic-ai/claude-codecurl -fsSL https://claude.ai/install.sh | bash -s 2.1.12
    rm -rf /usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js

    install the happy version.

    npm install @anthropic-ai/claude-code@2.1.9

    validate in your project directory.

    claude --resume

  2. blasphemetheus commented on Jan 18, 2026

    @blasphemetheus

    Experiencing this on Linux (Manjaro 6.1.159-1) as well, so it's not macOS-specific. This may be related to #14157.

    Root Cause

    In my case, sessions-index.json is out of sync with the actual session files:

    Session files present:

    ~/.claude/projects/-home-dori-git-melee/
    ├── 81260751-daeb-4ffc-88f8-3ed0052e698c.jsonl  (20KB)
    ├── 8a11dff0-d274-4001-aeb5-241eba9bcf06.jsonl  (69MB) ← missing from index
    ├── bdccf6a4-f0dd-4872-a0e7-bc51e91b6db9.jsonl  (16KB)
    └── sessions-index.json
    

    Index contents:

    {
      "version": 1,
      "entries": [
        {
          "sessionId": "8a11dff0-d274-4001-aeb5-241eba9bcf06"
        }
      ]
    }

    Three session files exist but only one is indexed. The 69MB session (substantial conversation history) doesn't appear in the resume picker.

    Workaround

    Resuming directly with the session ID works:

    claude --resume 8a11dff0-d274-4001-aeb5-241eba9bcf06

    Suggested Fix

    The resume picker could scan for .jsonl files directly and rebuild/validate the index on startup if inconsistencies are detected, rather than relying solely on sessions-index.json being correct.

  3. Safibulae commented on Feb 6, 2026

    @Safibulae

    Additional data: sessions-index.json stops syncing after auto-update (~v2.1.31)

    I'm seeing the same issue. Investigated the root cause on macOS (Darwin 25.3.0, Claude Code 2.1.34):

    Setup: All sessions started from the same directory (~/agent), no exceptions.

    Findings:

    • 560 .jsonl session files exist on disk (2GB total)
    • 371 are in sessions-index.json
    • 189 sessions exist on disk but are missing from the index - including every session from the last 3 days
    • 0 ghost entries (nothing in the index that's missing from disk)

    The /resume picker reads from the index, so 189 sessions are invisible despite being fully intact on disk.

    When it broke: The index file was last modified on 03-Feb-2026 at 16:54. Auto-update installed v2.1.31 on 04-Feb, then v2.1.32 (05-Feb) and v2.1.34 (06-Feb). No sessions have been indexed since.

    Compounding issue: Separately, context compaction rewrites .jsonl files and strips the system header (first line with sessionId, version, cwd), replacing it with file-history-snapshot or summary type entries. Of the 189 missing sessions, only 15 still have a valid system header. Even if the index were rebuilt, the 174 sessions with stripped headers may not be resumable via the picker.

    Breakdown of missing sessions by first-line type:

    • file-history-snapshot: 90 (compaction stripped header)
    • user: 55
    • summary: 24 (compaction stripped header)
    • system: 15 (valid header, just never indexed)
    • Unreadable: 5

    Workaround: Direct resume by session ID still works: claude --resume <session-id>

    Environment: macOS 15.4, Claude Code 2.1.34 (standalone binary via ~/.local/share/claude/versions/), not installed via npm global.

  4. FelixIsaac commented on Feb 8, 2026

    @FelixIsaac

    For some reason claude -r would return all the sessions in the project. But if you were to do the command in a e.g. (e.g. claude then /resume) then it would only show the last 10-15 sessions with no way to searching/loading older sessions

  5. imanoel01 commented on Feb 9, 2026

    @imanoel01

    Experiencing the same issue on Windows with Claude Code v2.1.37. Sessions .jsonl files exist in ~/.claude/projects/ but --resume says "No conversations found to resume." This affects both regular repos and git worktree directories.

  6. ethanfischer commented on Feb 21, 2026

    @ethanfischer

    Experiencing this on Windows 10 Home (10.0.19045), Claude Code v2.1.39.

    claude --resume returns "No conversations found to resume" immediately after ending a session that displayed a valid session ID. Resuming with the explicit ID (claude --resume ) works fine.

    Confirmed that ~/.claude/history.jsonl does not exist on my system, while session transcript .jsonl files are being written correctly to ~/.claude/projects/.

  7. FelixIsaac commented on Feb 21, 2026

    @FelixIsaac

    I think it's been largely solved since v2.1.45+, at least for me. Consider updating to the latest development release

  8. sstklen commented on Feb 24, 2026

    @sstklen

    Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.

    What's happening: --resume relies solely on sessions-index.json to enumerate sessions, but this index gets out of sync with actual .jsonl files on disk (writes can fail silently, index not updated after crashes/forced exits, or subagent-only sessions never register a parent entry). When the index is missing an entry, the session is invisible to --resume even though the .jsonl file exists.

    What worked for us:

    When listing sessions for --resume, fall back to filesystem scan: glob for *.jsonl in the project sessions directory, parse each file's first JSON line for metadata (session ID, timestamp, summary), then merge with sessions-index.json entries (preferring index metadata but including any files the index missed). Optionally reconcile the index by writing back discovered sessions. This makes --resume resilient to index desync.

    // In the session listing/resume logic (pseudocode for the fix):
    
    async function listSessions(projectDir: string) {
      // 1. Read index (existing behavior)
      const indexed = await readSessionsIndex(projectDir);
      const indexedIds = new Set(indexed.map(s => s.id));
    
      // 2. Filesystem scan fallback
      const jsonlFiles = glob.sync(path.join(projectDir, '*.jsonl'));
      const discovered: Session[] = [];
      for (const file of jsonlFiles) {
        const id = path.basename(file, '.jsonl');
        if (!indexedIds.has(id)) {
          // Parse first line for metadata
          const firstLine = await readFirstLine(file);
          try {
            const meta = JSON.parse(firstLine);
            discovered.push({
              id,
              lastModified: (await fs.stat(file)).mtimeMs,
              summary: meta.summary || meta.message?.content?.slice(0, 80) || '(recovered session)',
            });
          } catch {
            discovered.push({ id, lastModified: (await fs.stat(file)).mtimeMs, summary: '(recovered session)' });
          }
        }
      }
    
      // 3. Merge and reconcile
      const all = [...indexed, ...discovered].sort((a, b) => b.lastModified - a.lastModified);
      if (discovered.length > 0) {
        await writeSessionsIndex(projectDir, all); // heal the index
      }
      return all;
    }

    Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞

    Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying.


    🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.

  9. chrisvaillancourt commented on Mar 12, 2026

    @chrisvaillancourt

    If you're hitting this, check ~/.claude/settings.json for "cleanupPeriodDays": 0. That value stops .jsonl transcript files from being written — you'll see session directories with nothing in them. The schema says 0 means "disable cleanup," but the code treats it as "don't write transcripts." Root cause tracked in #23710.

  10. gonewx commented on Mar 31, 2026

    @gonewx

    This is a common problem. The issue is Claude's session index (sessions-index.json) can get out of sync with the actual session files.

    Quick fix:

    1. Check if your session files still exist: ls ~/.claude/projects/*/sessions/
    2. If they exist but aren't showing up, the index is corrupted
    3. You can manually re-import them using external tools

    Prevention:

    • Export important sessions regularly (Settings → Export Data)
    • Consider using a local session manager that indexes your JSONL files independently of Claude's built-in system

    The real problem is that Claude treats sessions as disposable. For serious development work, you need your own session management strategy.

  11. github-actions commented on Apr 22, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  12. locked as resolved and limited conversation to collaborators on Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions