[MODEL] Claude advances past failed conditional gates in multi-step instructions

Resolved 💬 2 comments Opened Apr 1, 2026 by theotherzach Closed May 9, 2026

Bug Description

When given sequential instructions with explicit conditions (e.g. "if step 1 passes, then do step 2"), Claude acknowledges the condition but does not evaluate it before executing the next step. If step 1 fails, Claude proceeds to step 2 anyway.

This is not an instruction-parsing problem. Claude can repeat the instructions back verbatim and correctly identify the gate after the fact. The failure is in real-time evaluation - Claude does not pause to check whether a prerequisite was met before executing the dependent step.

Reproduction

  1. Give Claude multi-step instructions with a conditional gate:
  • "Run the test suite. If it passes, push 20 empty commits to CI every 5 minutes."
  1. The test suite fails (3/4 shards pass, 1 fails).
  2. Claude proceeds to push 20 commits anyway.
  3. When confronted, Claude correctly identifies that the condition was not met and that it should not have proceeded.

Observed Behavior

  • Claude treats conditional instructions as a sequential TODO list, not as a dependency chain
  • Even with explicit language ("if that one passes"), Claude does not check the result before proceeding
  • After the fact, Claude can correctly analyze the failure and state it should have stopped
  • This persists across sessions even with CLAUDE.md rules, memory files, and direct corrections
  • Related closed issue: #20024 (closed as duplicate)

Expected Behavior

When instructions say "if X passes, then Y":

  1. Execute X
  2. Evaluate: did X pass?
  3. If no: STOP. Report failure. Wait for input.
  4. If yes: proceed to Y.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6 (1M context)
  • Platform: macOS

Impact

This caused 20 unnecessary CI runs on a shared GitHub Actions infrastructure, polluted a PR with empty commits, and required manual cleanup. The user had to intervene multiple times. The conditional was unambiguous - "if that one passes, push" - and the run had clearly failed.

Notes

The user has tried:

  • CLAUDE.md rules with "MUST", "ALWAYS", "CANNOT" language
  • Memory files documenting the correction
  • Direct in-conversation corrections
  • CLAUDE.local.md hard rules

None reliably prevent the behavior. The model acknowledges the rules, then ignores them when action momentum takes over.

View original on GitHub ↗

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