Skip to content

Local Session History and Context Persistence for Claude Code #12646

Description

@apuetzevape

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

When working with phpStorm for example and Claude Code via CLI on complex development tasks, the conversation
context is completely lost if the session is interrupted (IDE crash, system restart,
switching projects). Unlike the web chat interface which maintains full history,
Claude Code has no persistent session storage. This forces developers to lose all
context about decisions made, code changes discussed, and solutions explored.
For iterative tasks like refactoring, debugging, or architecture changes, this is
highly frustrating and reduces productivity significantly.

Proposed Solution

Claude Code should optionally persist conversation history locally within each project:

  1. On startup or reconnect, Claude detects previous sessions and asks: "Should I
    continue the last session from [timestamp]?" (Yes/No)

  2. If accepted, Claude loads the full conversation history and resumes work with
    complete context

  3. Sessions are stored in .claude/sessions/ directory at project root (can be
    gitignored or committed as needed)

  4. Format: Structured JSON logs containing all conversation turns, file modifications,
    and decisions made

  5. Multiple sessions can be kept for different work streams within the same project

Alternative Solutions

Currently, developers either manually copy-paste conversation history into new chats,
take manual notes of progress, or avoid interrupting their IDE sessions. None of
these are satisfactory solutions for real-world development where interruptions happen.

Priority

High - Significant impact on productivity

Feature Category

Developer tools/SDK

Use Case Example

No response

Additional Context

Scenario: I'm refactoring a critical PHP payment module in my e-commerce application.
Claude Code and I have discussed the architecture, identified issues with the current
implementation, and started making changes. We've completed about 30% of the work.

Current behavior: My IDE crashes due to a memory issue. I restart the IDE, reopen Claude Code,
and have no idea what we were doing, what decisions we made, or which files we modified.

Desired behavior: Claude Code asks "Continue previous session from 14:30?" I click yes.
Claude loads our entire conversation, reminds me "We were refactoring the payment processor
and had just completed the validation layer. Next step: error handling." I can continue
exactly where we left off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions