[BUG] Provide way to summarize all previous sessions into new prompt

Resolved 💬 2 comments Opened Jun 5, 2025 by lukehutch Closed Jun 15, 2025

After around 60 hours of wrangling with Claude Code to develop a very complex multi-language binding for a library, across many crashes, compactions, instruction redirections, iterative fixes, etc. Claude made the mistake of executing a git hard reset in the main directory of my project, not in a git submodule, and it wiped all the in-progress work that Claude had done, which (my bad) I didn't have a backup for.

Claude allows you to resume from a specific session, but each session is "blind" before the point of the last compaction, or the beginning of the session.

Request: There needs to be a way to create a prompt that contains complete context, drawn from all previous sessions (or at least sessions rooted in a given directory).

To achieve this, I had to copy the ~/.claude directory and ~/.claude.json file into a subdirectory claude_sessions of my current project, and run this following prompt:

Analyze all the Claude Code files in the recursive directory tree rooted at claude_sessions, and piece together a timeline in chronological order of my prompts and your responses. Try to understand why my prompts didn't work the first time, and why I had to keep asking you to fix things to get this binding right. Then write one long, very detailed prompt that would have made you do the right thing the first time around. Scan through what you have built so far, and adapt the prompt to work incrementally from what you have now, to achieve the final goals I had before you accidentally deleted a large number of files. Add significant detail about everything you did wrong along the way, or what didn't work, which required me to manually correct you on. Then show me the whole long prompt is that you wrote. Put together a plan to achieve everything in your prompt, and start doing the work.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗