-
Notifications
You must be signed in to change notification settings - Fork 167
Description
What happened?
When an AI agent (Claude Code) commits and pushes in the same turn, the session checkpoint data is never included in that push. It's always one push behind.
Root cause: The post-commit hook sees the session in ACTIVE state (the agent hasn't finished its turn yet), so it defers condensation — transitioning to ACTIVE_COMMITTED and setting PendingCheckpointID. Condensation to entire/checkpoints/v1 only happens later when the turn ends (HandleTurnEnd). But by then, the pre-push hook has already pushed the stale entire/checkpoints/v1 branch.
Timeline:
- Agent calls
git commit→prepare-commit-msgadds trailer →post-commitfires - Post-commit: session is
ACTIVE→EventGitCommitemitsActionMigrateShadowBranch(notActionCondense) → transitions toACTIVE_COMMITTED - Agent calls
git push→pre-pushfires → pushesentire/checkpoints/v1→ stale data (current session not condensed yet) - Turn ends →
EventTurnEndonACTIVE_COMMITTED→ActionCondense→handleTurnEndCondense()writes toentire/checkpoints/v1 - Data is now on the local branch but not on the remote
This is the most common workflow for AI agents — they commit and push in the same turn.
Evidence
Local entire/checkpoints/v1 has 1 commit ahead of origin/entire/checkpoints/v1:
$ git log --oneline entire/checkpoints/v1 -5
220d61a2 Checkpoint: 02014f017e49 ← unpushed (our session)
9613e5b0 Checkpoint: d3e2e412302d
99ee6252 Checkpoint: 809f1211c49d
...
$ git log --oneline remotes/origin/entire/checkpoints/v1 -5
9613e5b0 Checkpoint: d3e2e412302d
99ee6252 Checkpoint: 809f1211c49d
...
Logs confirm condensation happens after the push:
18:23:48 prepare-commit-msg: agent commit trailer added (checkpoint_id: 02014f017e49)
18:23:48 phase transition: GitCommit, from: active, to: active_committed
[git push runs here — pre-push pushes stale entire/checkpoints/v1]
18:24:00 stop hook fires
18:24:02 session condensed (checkpoint_id: 02014f017e49) ← too late
18:24:02 shadow branch deleted (turn-end)
Entire CLI version
Entire CLI 0.4.2 (2a9998e) Go version: go1.25.6 OS/Arch: darwin/arm64
OS and architecture
Darwin 24.6.0 arm64
Agent
Claude Code
Strategy
manual-commit (default)
Terminal
zsh