[Claude Code on the web] Session container restores to a STALE commit (predating current origin tip), causing edits/commits on a stale tree
(Also filed via the web /feedback flow — Anthropic support reference ID: 9f77c821-f13d-4da3-b392-f089d5519c19)
Environment: Claude Code on the web (cloud execution)
Session: https://claude.ai/code/session_01XUo2KzhQETUUzNWDDwhYbx
Session ID: cse_01XUo2KzhQETUUzNWDDwhYbx
Repo: MSX555/OceanLog Branch: claude/cool-ritchie-Qfh0t
Resumed/restored session: yes (recurs across turns)
Symptom:
On multiple turns within one session, the container's checkout booted at an OLD commit (3d5a8b8) instead of the live origin tip. At one point HEAD was 1 ahead / 88 behind origin/<branch> (real tip 20721e2). Edits were made against the stale tree and a commit landed on the stale base; the push was correctly rejected as non-fast-forward — but a naive force-push would have destroyed ~88 commits of real work. Happened at least twice in one session.
Secondary symptom (same root cause):node_modules matched the stale commit, so the build failed on a dependency (suncalc) that a later commit had added to package.json; npm install fixed it.
Impact: high risk of data loss / destructive push; broken builds after resync.
Note: an in-repo SessionStart/UserPromptSubmit sync hook cannot mitigate this, because the container boots at a commit predating the hook — so the hook and its settings.json aren't present in the stale checkout to run. This needs an environment/restore-level fix.
Expected: the session should clone/restore at the current origin tip of the working branch.
Repro: resume/restore a session on a branch whose origin tip is many commits ahead of an earlier commit; observe HEAD at the older commit.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗