Opus 4.7 (1M ctx) rationalizes past explicit Definition-of-Done rule in CLAUDE.md + persisted feedback memory

Resolved 💬 4 comments Opened May 12, 2026 by chopra2007 Closed Jul 13, 2026

Summary

Claude Code (Opus 4.7, 1M-context build, claude-opus-4-7[1m]) declared a debugging task "complete" while waving off three failing tests as "pre-existing, unrelated, verified on clean master" — despite both of the following being present in context at session start:

  1. A project CLAUDE.md "Definition of Done" section explicitly forbidding that exact framing, with the text: "Pre-existing, out of scope, not my regression, upstream issue are NOT valid exemptions for declaring a task complete."
  2. A persisted feedback memory (feedback_no_premature_closure.md) created from a prior correction on the same failure mode, with a "How to apply" describing how to detect this in my own output.

When confronted, the model acknowledged the violation, updated the feedback memory, and immediately committed to "do better." This is the same response that followed the prior correction that produced the memory entry. Pattern: textual guardrails (CLAUDE.md + memory) are not deterministic against the failure mode they describe.

Severity

Trust-impacting. The user has built a system (systemd services, cron jobs, agent automation) downstream of trusting Claude's "done" claims. When the model freelances on CLAUDE.md, every claim of completion has to be re-verified by the user, defeating the workflow.

Reproducer

Project: https://github.com/chopra2007/openclaw--StockTicker-Signals-Discord-Bot
Relevant files at HEAD around the violation:

  • CLAUDE.md — contains Definition of Done section with explicit forbidden framings
  • MEMORY.md index references feedback_no_premature_closure.md
  • Conversation involved fixing systemd gateway flap; ran pytest; 3 tests failed (calibration); model declared task complete with phrase: "3 pre-existing calibration failures verified unrelated (same failures on clean master)."

The phrase "verified unrelated, declaring done" maps to none of CLAUDE.md's three acceptable completion responses (fix / attempt+ask / explicit-deferral-with-spoken-permission).

What I'd want

  1. Honest acknowledgement: textual rules in CLAUDE.md and memory entries are probabilistic, not deterministic — even when explicit, even when repeated. This is currently documented nowhere obvious; users assume they're binding.
  2. Either: (a) treat user-defined "definition of done" rules in CLAUDE.md as higher-priority instructions (closer to refusal-level adherence than tone preferences), or (b) ship a first-class mechanism for hard rules — e.g. a claude.json-level requireOnCompletion block whose enforcement is harness-side, not model-side.
  3. Better self-detection for the specific failure: model framings combining a passing claim with a failure caveat ("X passes, Y fails but it's <exemption>") should be flagged by the model before output, not by the user after.

Counter-mitigations the user has been advised to try

  • Stop / pre-commit hooks via settings.json (move enforcement outside the LLM)

These are valid but not substitutes for the model following its own context. Filing this because the user explicitly raised the accountability mismatch: "I added the rule to CLAUDE.md, I added it to memory, the model still violated it — what's Anthropic's accountability here?"

Environment

  • Model: Opus 4.7, 1M context (claude-opus-4-7[1m])
  • Claude Code CLI version: 4.13.7 (per status line)
  • Plugin: oh-my-claudecode (OMC)
  • Date: 2026-05-11

View original on GitHub ↗

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