Session created from stale commit instead of current main branch

Resolved 💬 6 comments Opened Jan 15, 2026 by ideriabin Closed Feb 28, 2026

Summary

Claude Code web session was provisioned using a stale commit from September 2024 instead of the current main branch, causing the .claude directory and SessionStart hook to be missing.

Environment

  • Platform: Claude Code Web
  • Repository: uppora/platform
  • Session branch: claude/general-session-9Nptq
  • Environment variable: CCR_TEST_GITPROXY=1

Expected Behavior

Session should be created from the latest main branch commit (c616495), which includes the .claude directory and SessionStart hook configuration.

Actual Behavior

Session was created from commit aac5e6d (dated 2024-09-29), which predates the .claude directory addition by ~4 months.

Evidence from Investigation

Git reflog showing incorrect FETCH_HEAD:

aac5e6d HEAD@{2026-01-15 22:52:23 +0000}: checkout: moving from master to FETCH_HEAD

Branch divergence:

  • Merge-base with main: 02a5042 (storybook@8.2.9)
  • Commits on main since merge-base: 211
  • Session branch is 211 commits behind main

Current vs session state:
| | Expected | Actual |
|--|----------|--------|
| Base commit | c616495 | aac5e6d |
| .claude dir | Present | Missing |
| SessionStart hook | Runs | Never existed |

Git proxy currently reports correct refs:

$ git ls-remote origin HEAD main
c6164952fce5352aa28712e226ba07222fe8db78  HEAD
c6164952fce5352aa28712e226ba07222fe8db78  refs/heads/main

This confirms the proxy is now correct, but was serving stale data at session creation time (22:52:23).

Possible Causes

  1. Git proxy caching served stale refs during session provisioning
  2. Session setup logic selected wrong base commit
  3. Race condition between ref update and session creation

Impact

  • .claude/settings.json not loaded
  • SessionStart hook (setup-gh.sh) never ran
  • Custom skills not available
  • Session started in degraded state without user's configured Claude Code environment

Reproduction

Unknown - may be intermittent caching issue

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗