claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] `--fork-session` flag ignored when using `--resume` with TUI session picker

Open Elijas opened this issue 2 months ago • 4 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using claude --resume --fork-session without specifying a session ID, the interactive TUI picker opens as expected. However, after selecting a session from the picker, the session is resumed directly instead of being forked. The --fork-session flag is silently ignored.

What Should Happen?

When --fork-session is passed alongside --resume, selecting a session from the TUI picker should create a fork of that session (new session ID, preserving conversation history) rather than resuming the original session directly.

Error Messages/Logs

No error messages - the flag is silently ignored. The session resumes with the original session ID instead of creating a new forked session.

Steps to Reproduce

  1. Have at least one existing session (run claude and have a conversation, then exit)
  2. Run claude --resume --fork-session
  3. TUI picker appears - select a session
  4. Check /status - the session ID is the same as the original session, not a new forked session

Expected: New session ID (fork created) Actual: Same session ID (resumed directly, fork flag ignored)

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Workaround: Specify the session ID explicitly: claude --resume <session-id> --fork-session

This works correctly and creates a fork. The bug only occurs when the TUI picker is used (no session ID specified).

Elijas avatar Dec 29 '25 14:12 Elijas

Experiencing this issue as well.

But even worse, claude --resume <session-id> --fork-session also does not work for me. It does not create a new session.

Version: 2.0.76

magiusdarrigo avatar Dec 31 '25 16:12 magiusdarrigo

Done! Fix going out with the next release:

claude --resume --fork-session

bcherny avatar Dec 31 '25 17:12 bcherny

@bcherny I actually had Claude Code build a temporary picker while the fix was being rolled out.

The thing I love the absolute most about Claude Code implementation is that the primitives are exposed (like ~/.claude/projects)

Therefore I can use Claude Code itself to build bug workarounds or customize Claude Code capabilities by building on top (yes I know that it's unstable API to build on, upkeep cost is acceptable - just don't close it out)

Please keep this, this is so so valuable

Elijas avatar Jan 01 '26 13:01 Elijas

Is there a way to fork a session until this is fixed?

Jihad avatar Jan 12 '26 12:01 Jihad

Is there a way to fork a session until this is fixed?

I use https://github.com/Elijas/claude-fork-picker

Elijas avatar Jan 12 '26 15:01 Elijas