Prevent stale Clone Loop auto-resume#15
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CLO-46.
Fixes the Clone Loop ghost-loop safety bug reported in Slack and tracked as CLO-46: stale
.claude/clone-loop.local.mdcan no longer auto-resume in a new Claude Code session.Slack report: https://cloneisyou.slack.com/archives/C0AQUR7PBFW/p1779431888914289
Linear issue: https://linear.app/cloneisyou/issue/CLO-46/ghost-loop-auto-resumes-from-stale-local-state
Root cause
The Stop hook treated the presence of
.claude/clone-loop.local.mdas sufficient proof that a loop was active. Onsession_idmismatch it patched the state file to the new session and continued, which let a stale local state file inject fabricated user prompts into an unrelated new session.Changes
session_idto match the statesession_id.loop-startevent in.claude/clone-loop.history.local.jsonl.Validation
node --test tests/post-tool-use-capture.test.mjs tests/stop-hook-v2.test.mjs tests/ask-user-question-hook.test.mjs-> 27/27 passclone--v0.14.1/later patch releases.Acceptance mapping for CLO-46
.claude/clone-loop.local.mdin a brand-new session: blocked by strictsession_idmatch.loop-start: blocked and stale state removed.