Feature Request: Session Resumption for Claude Code CLI
Problem
Terminal crashes and disconnections currently result in complete loss of context and work progress in the Claude Code CLI. Unlike the web interface which offers the ability to resume a previous session, CLI users must start from scratch after any interruption, leading to significant productivity loss and frustration. CLAUDE.md is proving to be insufficient for re-teaching claude-code what it needs to know in order to effectively resume a prior session.
Proposed Solution
Implement a session resumption feature for Claude Code CLI that:
- Automatically saves session state at regular intervals
- Allows users to resume their most recent session after a crash or disconnection
- Provides a command to list and select from previous sessions (e.g., claude resume or claude sessions list)
- Preserves all context, including file reads, searches, and conversation history
User Impact
This would significantly improve the CLI experience by:
- Preventing loss of complex contextual knowledge about codebases
- Eliminating repetitive work explaining project requirements
- Making the CLI version equally resilient to the web version
- Supporting long-running development tasks that are prone to interruption
Technical Considerations
- Storage of session data should respect security and privacy constraints
- Session resumption should be lightweight and quick to initialize
- Consider offering configurable retention periods for saved sessions
Why This Matters
Power users who prefer CLI interfaces shouldn't have fewer features than web users. Session resumption is especially critical in terminal environments where disconnections and crashes are more common than in browser interfaces. Currently I am so frustrated by this oversight I am looking for a Claude-Code alternative but I wouldn't need one if Anthropic would introduce this feature.
15 Comments
I guess this is a hidden feature but there are logs of your convos per project in
~/.claude/projects/-Users-<YOUR-USERNAME>-<PATH>-<TO>-<PROJECT>/there's a bunch ofjsonlfiles i don't know how much of the history it preserves but if you lose something critical hopefully it helps.Can't you just use continue and resume to do this?
oh... yeah, i was assuming OP was talking about some kind of crash that caused the resume-session thing to fail. but if OP doesn't know about -r and -c, yeah that is the way to go.
It sounds like maybe this feature is included and I didn't realize it.
Ironically the first time I experienced a session crash, I re-opened my IDE's terminal invoked Claude-code and asked if there was a way we could resume our previous session.
Claude assured me there was not, lamented that the CLI lacked this feature even though it's available via the Web UI, suggested I open an issue, and helped me write this feature request describing what was missing.
So yea it's on me for not RTFM, but it's also on Claude for assuring me this feature did not exist and it would be valuable feedback for me to escalate this issue to the dev team.
Same, I remember something about
--continuebut at this pace I never know if I actually heard it or misremembering.Also asked Claude for the feature, he assured me no such feature exist and pointed me to various issues with feature requests.
Now here I realize that it is indeed existing, so the actual problem is that Claude should RTFM, and probably have it as a tool call.
It says in the system prompt that Claude is not allowed to visit the Anthropic docs site.
I didn't know about this feature until I read it in the CHANGELOG.md file.
Why can't this just also be a slash command inside the claude-code app?
Like
/resumeor/load-sessionmaybe?Maybe because it would take dev time to implement something that's basically already available by ending your session and typing
claude -r...? What's the difference?Yep! You want
--continue/--resume. Docs: https://docs.anthropic.com/en/docs/claude-code/cli-usage#cli-flagsThis works well, thanks!
For enhanced session resumption, #2112 proposes adding
--session-namefunctionality that would make it much easier to identify and resume the correct session after crashes or disconnections.This would work well with the automatic session state saving requested here - named sessions would be instantly recognizable in the resume picker.
Related session management improvements:
The ability to name a conversation is important so I can quickly select it when I want to continue the conversation. I look forward to adding this feature.
Yes, similar to tmux
@DnkNju https://github.com/iannuttall/claude-sessions what do you think? (not my repo i just googled it cuz of your question, has decent star count)
EDIT: Nevermind I don't think this correlates with Claude internal sessions
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.