Skip to content

Conversation

@gtrrz-victor
Copy link
Contributor

@gtrrz-victor gtrrz-victor commented Feb 3, 2026

Summary

Improves the session conflict warning experience when a second Claude Code session starts while another session has uncommitted checkpoints.

Key changes:

  • Moved session conflict detection from user-prompt-submit hook to session-start hook
  • Redesigned the warning message to be more user-friendly and actionable

New Warning Format

When a user starts a new session while an existing session has uncommitted checkpoints, they now see:

You have an existing session running (existing-session-id).                                                                     
Do you want to continue with this new session (new-session-id)?                                                                 
                                                                                                                                
Yes: Ignore this warning                                                                                                        
No: Type /exit, then either:                                                                                                    
  • Resume the other session: claude -r existing-session-id                                                                     
  • Reset and start fresh: entire reset --force && claude                                                                       
                                                                                                                                
To hide this notice in the future: entire enable --disable-multisession-warning                                 

Why This Matters

Previously, the conflict warning appeared at every prompt submission, which was disruptive. Moving it to session start means:

  1. Better timing - Users see the warning once at the start, not repeatedly
  2. Clear options - Users understand they can continue, resume the other session, or reset
  3. Actionable guidance - Includes exact commands to run for each option
  4. Dismissible - Users can permanently disable the warning if they prefer concurrent sessions

Note

Medium Risk
Behavioral change to when/how multi-session conflicts are detected and how hooks respond (new systemMessage JSON, Gemini no longer blocks), which could affect session workflows and any tooling/tests relying on the previous prompt-blocking semantics.

Overview
Moves multi-session conflict detection from per-prompt hooks to the session-start hook via a new shared handleSessionStartCommon/checkConcurrentSessions, and updates the warning to a more actionable message (including resume/reset commands) with agent-specific JSON output (Claude: systemMessage; Gemini: injects systemMessage without blocking).

Simplifies session ID handling by removing the persisted/legacy fallback logic and standardizing metadata paths on paths.SessionMetadataDirFromSessionID; removes ConcurrentWarningShown from session state and deletes the prior prompt-blocking/Gemini blocking-response flow plus related integration/unit tests, replacing them with a session-start warning-format test helper.

Written by Cursor Bugbot for commit 4593180. This will update automatically on new commits. Configure here.

@gtrrz-victor gtrrz-victor requested a review from a team as a code owner February 3, 2026 04:38
Copilot AI review requested due to automatic review settings February 3, 2026 04:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the session conflict warning system by moving the detection from the user-prompt-submit hook to the session-start hook, resulting in a better user experience.

Changes:

  • Moved session conflict detection to session-start hook, showing the warning once at session start instead of repeatedly on every prompt
  • Removed the ConcurrentWarningShown field from session state, as the warning is now shown once and doesn't need to be tracked
  • Redesigned the warning message to be more user-friendly with clear actionable guidance
  • Renamed SessionMetadataDirFromEntireID to SessionMetadataDirFromSessionID to reflect the direct use of session IDs

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/manual_commit_types.go Removed ConcurrentWarningShown field from SessionState struct
cmd/entire/cli/strategy/manual_commit_test.go Updated test to remove references to removed field
cmd/entire/cli/strategy/manual_commit_session.go Simplified session initialization by removing concurrent warning flag preservation
cmd/entire/cli/strategy/manual_commit_logs.go Updated function call to use renamed SessionMetadataDirFromSessionID
cmd/entire/cli/strategy/manual_commit_hooks.go Removed shadow branch conflict check from InitializeSession
cmd/entire/cli/strategy/manual_commit_git.go Updated function call to use renamed SessionMetadataDirFromSessionID
cmd/entire/cli/strategy/manual_commit_condensation.go Updated function call to use renamed SessionMetadataDirFromSessionID
cmd/entire/cli/strategy/manual_commit.go Removed ConcurrentWarningShown field from state conversion functions
cmd/entire/cli/state.go Updated function call to use renamed SessionMetadataDirFromSessionID
cmd/entire/cli/session/state.go Removed ConcurrentWarningShown field from State struct
cmd/entire/cli/paths/paths.go Renamed function from SessionMetadataDirFromEntireID to SessionMetadataDirFromSessionID
cmd/entire/cli/integration_test/setup_gemini_hooks_test.go Removed test for old session-start behavior
cmd/entire/cli/integration_test/session_conflict_test.go Added new test for session conflict warning message format at session-start
cmd/entire/cli/integration_test/rewind_test.go Removed test for old concurrent session behavior
cmd/entire/cli/integration_test/hooks.go Added SimulateSessionStartWithOutput helper for testing session-start hooks
cmd/entire/cli/integration_test/gemini_concurrent_session_test.go Deleted entire file - old Gemini concurrent session tests
cmd/entire/cli/integration_test/concurrent_session_warning_test.go Deleted entire file - old Claude concurrent session tests
cmd/entire/cli/hooks_handlers_test.go Deleted entire file - old currentSessionIDWithFallback tests
cmd/entire/cli/hooks_geminicli_handlers.go Removed checkConcurrentSessionsGemini function and simplified handlers
cmd/entire/cli/hooks_claudecode_handlers.go Removed checkConcurrentSessions, currentSessionIDWithFallback, and handleSessionInitErrors functions
cmd/entire/cli/hooks.go Added handleSessionStartCommon and checkConcurrentSessions functions

@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/alt-better-multi-session-flow branch from 9a27c19 to 7f302c3 Compare February 3, 2026 04:44
@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/alt-better-multi-session-flow branch from f092e6d to 1378ff1 Compare February 3, 2026 05:02
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

gtrrz-victor and others added 9 commits February 3, 2026 17:10
Entire-Checkpoint: 1755e38d324c
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Entire-Checkpoint: 2938d5d1ba71
Entire-Checkpoint: 2938d5d1ba71
@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/alt-better-multi-session-flow branch from 57c8368 to 020af9f Compare February 3, 2026 06:33
Copy link
Contributor

@khaong khaong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gtrrz-victor gtrrz-victor merged commit 52807f7 into main Feb 4, 2026
4 checks passed
@gtrrz-victor gtrrz-victor deleted the gtrrz-victor/alt-better-multi-session-flow branch February 4, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants