Skip to content

Feature Request: Session Resumption for Claude Code CLI #1340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
metaColin opened this issue May 26, 2025 · 8 comments
Open

Feature Request: Session Resumption for Claude Code CLI #1340

metaColin opened this issue May 26, 2025 · 8 comments
Labels
area:core enhancement New feature or request

Comments

@metaColin
Copy link

metaColin commented May 26, 2025

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.

@github-actions github-actions bot added enhancement New feature or request area:core labels May 26, 2025
@hesreallyhim
Copy link

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.

@StephenBadger
Copy link

StephenBadger commented May 27, 2025

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

@hesreallyhim
Copy link

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
Copy link
Author

metaColin commented 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
Copy link

Same, I remember something about --continue but 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
Copy link

It says in the system prompt that Claude is not allowed to visit the Anthropic docs site.

@skerit
Copy link

skerit commented 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 /resume or /load-session maybe?

@hesreallyhim
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants