Skip to content

[FEATURE] VS Code Extension: Add setting to configure "Past Conversations" time limit #13064

Closed as not planned

Description

@ccalvop

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The VS Code Extension's "Past Conversations" panel has a hardcoded time limit (~30 days from creation date) that cannot be configured. Conversations older than this limit disappear from the UI even though:

  1. The JSONL files still exist and are intact in ~/.claude/projects/
  2. The conversations are fully accessible via claude --resume <session-id> in terminal
  3. Third-party extensions (like Claude Code Assist) can read and display these conversations

I'm aware that cleanupPeriodDays exists in ~/.claude/settings.json and controls file retention for the CLI. However, this setting has no effect on the VS Code Extension's "Past Conversations" filter. The extension should respect this setting or have its own equivalent.

Proposed Solution

Option A: Make the VS Code Extension respect cleanupPeriodDays from ~/.claude/settings.json

Option B: Add a dedicated extension setting:
"claudeCode.pastConversationsLimit": 90 // days, or 0 for unlimited

Option C: Allow resuming any conversation by session ID directly in the extension UI (similar to claude --resume <session-id>)

Alternative Solutions

Current workaround requires:

  1. Using third-party extensions (Claude Code Assist) to find the session ID
  2. Running claude --resume <session-id> in terminal
  3. Working in terminal instead of the VS Code Extension UI

This defeats the purpose of having a VS Code Extension.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

I'm working on a long-running documentation project. The conversation started on November 1st, 2025, and contains:

  • 1072 messages
  • 82 file changes
  • Accumulated context about project structure, decisions made, and pending tasks

Step-by-step scenario

  1. November 3st: I start a conversation in VS Code Extension to work on documentation
  2. November month: I continue working, the conversation appears in "Past Conversations"
  3. December 4th (today): The conversation disappears from "Past Conversations" (older than ~30 days from original creation in early November context)
  4. I check ~/.claude/projects/ - the JSONL file (9.4MB) is there.
  5. I run claude --resume <session-id> in terminal - it works.
  6. But I cannot access it from the VS Code Extension UI anymore

Expected: If terminal can show and resume the conversation, the VS Code Extension should too.

Additional Context

Activity

  1. github-actions commented on Jan 7, 2026

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  2. ccalvop commented on Jan 7, 2026

    @ccalvop
    Author

    still occurring

  3. ccalvop commented on Feb 6, 2026

    @ccalvop
    Author

    Update: Root cause identified: sessions-index.json has a hard cap

    After more investigation, I found a mechanism causing limitation:

    The sessions-index.json file caps at ~65 entries, while actual session files on disk are fully preserved.

    Session .jsonl files on disk:    655
    Entries in sessions-index.json:   65  ← this is what the VS Code dropdown reads
    

    The VS Code "Past Conversations" dropdown reads exclusively from ~/.claude/projects/<project>/sessions-index.json, not from the actual .jsonl files. So even with cleanupPeriodDays: 999 in ~/.claude/settings.json (which correctly preserves all files on disk), the UI only shows what's indexed.

    Additional finding: CLI /resume is even worse:
    The terminal claude --resume only displays ~10 recent conversations. So neither interface exposes the full history.

    Evidence:

    • sessions-index.json: 65 entries, oldest from Nov 19, 2025
    • Actual .jsonl files: 655 files, oldest from Nov 17, 2025
    • All older sessions are intact on disk but invisible to both VS Code and CLI interfaces

    This means the fix may need to address two things:

    1. Indexing: sessions-index.json should index all sessions (or at least respect cleanupPeriodDays)
    2. UI pagination: Both VS Code dropdown and CLI /resume need pagination or real search to handle larger histories

    The current situation: cleanupPeriodDays controls file retention but nothing controls index retention. The index appears to be rebuilt with a limited scope, making the retention setting only half-effective.

    Environment: Pop!_OS 22.04, VS Code Extension, Claude Code latest version.

  4. ccalvop commented on Feb 17, 2026

    @ccalvop
    Author

    Deep dive: Source code analysis and empirical testing (CLI v2.1.44, VS Code Extension v2.1.44)

    After inspecting the bundled source code (cli.js, 11.5MB) and running practical tests, here are the concrete findings:

    1. CLI /resume picker is hardcoded to 10 sessions

    In the source code, the session listing function is called with a literal 10:

    // TT6(10) - hardcoded limit, no setting to override it
    return ZT6 = TT6(10).then((q) => {
      return sd1 = q.filter((K) => {
        if (K.isSidechain) return false;
        if (K.sessionId === A) return false;
        if (K.summary?.includes("I apologize")) return false;
        // ...additional filters reduce the list further

    This means even with hundreds of sessions on disk, the CLI interactive picker will never show more than 10.

    2. VS Code dropdown has a fixed slot cap (not a time-based filter)

    The VS Code "Past Conversations" dropdown reads from sessions-index.json and displays a fixed number of sessions. Empirical evidence:

    • sessions-index.json contains 82 entries
    • VS Code dropdown shows significantly fewer (estimated ~40-50 after filtering)
    • Sessions are filtered out if: they are sidechains, have empty summaries ("No prompt"), contain error messages, or are the current session

    Critical finding through testing: When I "refreshed" an old session by opening it via CLI (claude --resume SESSION_ID), it appeared in the VS Code dropdown, but the previously oldest visible session disappeared. This confirms it's a fixed number of slots, not a time window. The dropdown behaves like a fixed-size queue: new/refreshed sessions push out the oldest ones.

    3. cleanupPeriodDays only controls file deletion

    var yDz = 30; // default value
    // eY1() - cleanup cutoff calculation, ONLY used for file deletion at startup
    ((settings.cleanupPeriodDays ?? 30) * 24 * 60 * 60 * 1000)

    Setting cleanupPeriodDays: 999 preserves .jsonl files on disk indefinitely. However, nothing else in the system respects this value. The index cap and UI limits are completely independent.

    4. /resume SESSION_ID does NOT work in VS Code

    Testing revealed that typing /resume SESSION_ID in the VS Code prompt box does not resume by ID. Instead:

    • /resume opens the dropdown picker (which has the same limited view)
    • The dropdown search bar does not accept session IDs
    • Typing /resume SESSION_ID as a message just sends it as text input

    The only way to resume an arbitrary session is via CLI: claude --resume <full-session-id>

    5. Workaround: CLI resume "refreshes" sessions into VS Code dropdown

    Running claude --resume SESSION_ID in terminal:

    1. Opens the session successfully (regardless of age)
    2. Updates the session's mtime
    3. Causes the session to appear in VS Code's dropdown on next refresh
    4. But pushes out the oldest visible session from the dropdown (fixed slot behavior)

    This workaround lets you access any session, but requires knowing the session ID beforehand (by inspecting ~/.claude/projects/<project>/ files manually).

    Numbers from my setup

    Layer Count Configurable?
    .jsonl files on disk (non-empty) 282 Yes (cleanupPeriodDays)
    Entries in sessions-index.json 82 No
    Sessions visible in VS Code dropdown ~40-50 (after filters) No
    Sessions visible in CLI /resume 10 hardcoded No

    Proposed improvements

    1. Make the CLI picker limit configurable - The hardcoded 10 is unnecessarily restrictive. Even raising it to 50 would help, or making it a setting.
    2. Index all sessions within cleanupPeriodDays - If a user sets cleanupPeriodDays: 999, the index and UI should expose all preserved sessions, not just a subset.
    3. Support /resume SESSION_ID in VS Code - Allow resuming by session ID directly in the VS Code prompt box, bypassing the dropdown entirely. The code already has the pattern (/resume ${q.sessionId}) but it doesn't work in practice.
    4. Add session search by ID - The dropdown search should accept session IDs, not just text matching on titles/summaries.
    5. Remove the fixed slot cap in the dropdown - Or at minimum, make it configurable and significantly larger.

    Environment: Pop!_OS 22.04, Claude Code CLI v2.1.44, VS Code Extension v2.1.44.

  5. ccalvop commented on Feb 17, 2026

    @ccalvop
    Author

    Update: additional finding + workaround tool

    New finding: /compact destroys conversation titles

    The index's firstPrompt field gets overwritten after /compact with a mid-conversation message instead of the user's original first message. VS Code's dropdown still reads the correct title from the .jsonl file directly, but any tool relying on the index shows the wrong text.

    What I'd like to see improved (updated summary):

    1. Remove or raise the session listing limits - The CLI's hardcoded 10 and the dropdown's ~50 fixed slot cap should at minimum match all sessions within cleanupPeriodDays. If a user sets cleanupPeriodDays: 999, the UI should expose all preserved sessions, not just a subset.

    2. Support /resume SESSION_ID in VS Code - Currently it doesn't work. This would be the simplest fix - let users type a session ID directly in the prompt box.

    3. Preserve firstPrompt across compaction - The original first message is valuable as a conversation title. /compact should not overwrite it.

    Workaround tool

    In the meantime, I published a zero-dependency bash tool that works around these limitations: claude-sessions. It can search, browse, read, and resume any session stored on disk - including those not visible in the UI. The README also documents the full technical analysis of how session storage works internally.

  6. github-actions commented on Mar 17, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  7. github-actions commented on Mar 26, 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.

  8. locked as resolved and limited conversation to collaborators on Mar 26, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions