You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Session Resumption for Claude Code CLI #1340
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.
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 of jsonl files 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?
claude --help
Usage: claude [options] [command] [prompt]
Claude Code - starts an interactive session by default, use -p/--print for non-interactive output
Arguments:
prompt Your prompt
Options:
-d, --debug Enable debug mode
--verbose Override verbose mode setting from config
-p, --print Print response and exit (useful for pipes)
--output-format <format> Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming) (choices: "text", "json", "stream-json")
--mcp-debug [DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)
--dangerously-skip-permissions Bypass all permission checks. Only works in Docker containers with no internet access.
--allowedTools <tools...> Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit Write")
--disallowedTools <tools...> Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit Write")
--mcp-config <file or string> Load MCP servers from a JSON file or string
-c, --continue Continue the most recent conversation
-r, --resume [sessionId] Resume a conversation - provide a session ID or interactively select a conversation to resume
--model <model> Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-20250514').
-v, --version Output the version number
-h, --help Display help for command
Commands:
config Manage configuration (eg. claude config set -g theme dark)
mcp Configure and manage MCP servers
migrate-installer Migrate from global npm installation to local installation
doctor Check the health of your Claude Code auto-updater
update Check for updates and install if available
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.
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 /resume or /load-session maybe?
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?
For enhanced session resumption, #2112 proposes adding --session-name functionality 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.
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.
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.
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.
Activity
hesreallyhim commentedon May 27, 2025
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.StephenBadger commentedon May 27, 2025
Can't you just use continue and resume to do this?
hesreallyhim commentedon May 27, 2025
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.
metaColin commentedon May 27, 2025
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.
adriangalilea commentedon May 27, 2025
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.
hesreallyhim commentedon May 27, 2025
It says in the system prompt that Claude is not allowed to visit the Anthropic docs site.
skerit commentedon May 28, 2025
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?hesreallyhim commentedon May 28, 2025
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?bcherny commentedon May 29, 2025
Yep! You want
--continue/--resume. Docs: https://docs.anthropic.com/en/docs/claude-code/cli-usage#cli-flagshargup commentedon May 31, 2025
This works well, thanks!
gwpl commentedon Jun 15, 2025
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:
claude --resumeCommand #922 - Resume hanging bug (fixed)DnkNju commentedon Jul 18, 2025
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.
adriangalilea commentedon Jul 18, 2025
Yes, similar to tmux
hesreallyhim commentedon Jul 18, 2025
@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
github-actions commentedon Jul 29, 2025
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.