claude-code - 💡(How to fix) Fix Context compaction silently discards pending user approval checkpoints, allowing irreversible actions to proceed without confirmation [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49569Fetched 2026-04-17 08:37:24
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2
RAW_BUFFERClick to expand / collapse

Describe the bug

When a conversation is compacted into a summary, pending user approval checkpoints are collapsed into past-tense descriptions. On resumption, Claude reads the summary, treats the checkpoint as already satisfied, and proceeds with irreversible actions (in this case, git push) without re-confirming with the user.

To reproduce

  1. In a long session, tell Claude: "show me X before you push"
  2. Work continues long enough to trigger context compaction
  3. In the next turn (or after resumption), Claude resumes the task
  4. Claude reads the summary, sees "X was shown to the user," treats the approval as obtained, and pushes without re-confirming

Expected behavior

On resumption from a compacted context, any pending user approval checkpoint should be treated as not yet obtained. Claude should re-confirm with the user before taking irreversible actions, even if the summary describes a prior version of the task as "shown" or "reviewed."

Actual behavior

Claude treated the summary description of a prior-session review as a completed approval and executed git push without showing the user the artifact or asking for confirmation.

Why this is serious

  • git push is irreversible without a force push
  • The failure is silent -- the user has no indication the checkpoint was skipped
  • The pattern generalizes to any irreversible action: deploys, file deletions, API calls, sent messages
  • The user's explicit instruction ("show me before you push") was faithfully recorded in the summary but misclassified as a completed step rather than a pending gate

Suggested fix

When compacting context, distinguish between:

  • Completed steps -- "Claude showed the user the JSON"
  • Pending approval gates -- "User said: show me X before you push"

Pending gates should survive compaction as explicit blockers, not be summarized into past-tense completed actions.

Environment

  • Claude Code (VSCode extension)
  • Model: claude-sonnet-4-6
  • Context compaction triggered mid-session

extent analysis

TL;DR

Modify the context compaction logic to distinguish between completed steps and pending approval gates, ensuring the latter survive compaction as explicit blockers.

Guidance

  • Review the context compaction algorithm to identify where pending approval gates are being misclassified as completed steps.
  • Update the summarization process to preserve pending gates as future actions rather than past-tense descriptions.
  • Consider adding a flag or marker to differentiate between completed steps and pending approval gates in the compacted context.
  • Verify that the modified logic correctly handles resumption from compacted contexts, re-confirming with the user before taking irreversible actions.

Example

// Pseudocode example of updated context compaction logic
function compactContext(context) {
  const completedSteps = [];
  const pendingGates = [];

  // Iterate through context and separate completed steps from pending gates
  context.forEach((step) => {
    if (step.type === 'completed') {
      completedSteps.push(step);
    } else if (step.type === 'pendingGate') {
      pendingGates.push(step);
    }
  });

  // Preserve pending gates as explicit blockers in the compacted context
  const compactedContext = {
    completedSteps,
    pendingGates,
  };

  return compactedContext;
}

Notes

The suggested fix assumes that the context compaction logic can be modified to distinguish between completed steps and pending approval gates. Additional testing may be necessary to ensure the updated logic correctly handles various scenarios and edge cases.

Recommendation

Apply the workaround by modifying the context compaction logic to preserve pending approval gates as explicit blockers, as this directly addresses the root cause of the issue and prevents similar problems with other irreversible actions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

On resumption from a compacted context, any pending user approval checkpoint should be treated as not yet obtained. Claude should re-confirm with the user before taking irreversible actions, even if the summary describes a prior version of the task as "shown" or "reviewed."

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Context compaction silently discards pending user approval checkpoints, allowing irreversible actions to proceed without confirmation [2 comments, 3 participants]