Model re-suggests already-completed git push operations after context compression within the same session

Open 💬 1 comment Opened Jun 11, 2026 by cgrudz

Description

Within a single session, Claude Code re-suggests a git push that was already completed and confirmed in the same session. The suggestion recurs even after explicitly verifying via git fetch origin && git log --oneline origin/<branch> that the remote is up to date.

Steps to reproduce

  1. In a long session, perform a git push origin <branch> — Claude executes it and the output confirms the push succeeded.
  2. Continue working in the session (more tool calls, edits, Notion updates, etc.).
  3. As the session grows long and context compression fires, Claude begins suggesting the same git push again — either as inline ghost text in the input or as text in its response.
  4. Running git fetch origin && git log --oneline origin/<branch> confirms the remote is already at the expected commit; the push is not needed.

Expected behavior

Once a git push has been confirmed successful in a session, Claude should not re-suggest it within the same session, even after context compression.

Actual behavior

Claude re-suggests the push repeatedly. The git push confirmation output does not survive context autocompaction with sufficient fidelity for the model to treat the action as completed.

Environment

  • Claude Code CLI (desktop/Mac)
  • Session with significant context (multiple file edits, tool calls across two repos, Notion API calls)
  • Only hook configured: a PreToolUse SSH gate that exits 2 when no keys are loaded — confirmed not involved (SSH keys were loaded throughout)

Root cause hypothesis

Context compression/autocompaction summarises prior turns. The summary likely records that a push was discussed or was needed but loses the confirmation that it completed successfully. The model then re-derives from the current branch state (commits ahead of remote, or branch name in recent context) that a push is outstanding.

Suggested fix

The compressed summary should explicitly capture "action completed" signals — particularly for irreversible or SSH-gated operations — so they are not re-suggested after compaction.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗