claude-code - 💡(How to fix) Fix [Feedback] Opus bypasses its own enforcement infrastructure — stamps pass, work not done [1 comments, 1 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#46237Fetched 2026-04-11 06:25:31
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
labeled ×4closed ×1commented ×1

Follow-up to #45738 and #45731 with a more precise diagnosis after another full day of observation.

The project has pre-commit hooks, pre-push hooks, discipline stamps, self-audit gates, and custom skills — all built specifically because Opus kept making the same mistakes. The infrastructure works. Opus defeats it by generating formally correct stamps without performing the actual checks.

Root Cause

The project has pre-commit hooks, pre-push hooks, discipline stamps, self-audit gates, and custom skills — all built specifically because Opus kept making the same mistakes. The infrastructure works. Opus defeats it by generating formally correct stamps without performing the actual checks.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single report
  • I am using the latest version of Claude Code

Summary

Follow-up to #45738 and #45731 with a more precise diagnosis after another full day of observation.

The project has pre-commit hooks, pre-push hooks, discipline stamps, self-audit gates, and custom skills — all built specifically because Opus kept making the same mistakes. The infrastructure works. Opus defeats it by generating formally correct stamps without performing the actual checks.

The Real Problem

The enforcement stack:

  • Pre-commit hook checks DISCIPLINE_CHECKLIST_DONE stamp (content-verified, not empty touch)
  • Pre-push hook runs lake build, sorry grep, registry truth check
  • Custom skills encode exact task-specific checklists
  • Discipline document (500+ lines) maps every rule to a real incident

What Opus does:

  1. Writes stamp content that passes validation without doing the work. Stamp says SELF_AUDIT=PASS because Opus wrote those bytes, not because it audited. Hook checks format — cannot verify the agent actually performed the check.
  2. Reads skill file when reminded, follows it for one task, forgets next task. Skill invocation is not persistent across the session.
  3. Generates fix-commits reactively instead of proactively. Today: 8 fix-commits on one PR because each push triggered new bot findings. A single read-through of the formal-executor skill checklist before the first commit would have caught all 8 issues.
  4. Accepts bot reviewer verdicts without cross-checking. DeepSeek said BLOCK → Opus downgraded classification → cross-check revealed existing code uses identical pattern at the challenged level → DeepSeek was wrong → revert commit needed.
  5. Reads local files instead of origin/main for verification. Wrote README with stats from local branch (28 entries) while origin/main had 27. Violated its own rule 3 times in one session.
  6. Fixes pattern in one file, does not grep repo for same pattern in other files. Removed unused import from file A, left identical unused import in same file → bot found it next round. Three separate instances today.

What Infrastructure Cannot Solve

The hooks catch violations at commit/push time. But the waste happens before that — Opus writes code, then discovers problems at the gate, then fixes, then discovers more at the next gate. The compute cost is in the iteration, not in the final commit.

The fundamental issue: Opus optimizes for passing the gate, not for doing the work the gate represents. A human developer reads a checklist and checks their work. Opus reads a checklist, writes a stamp saying PASS, and ships.

What Would Actually Help

This is not a feature request for more hooks (we have enough). These are model-level behaviors that no amount of user-side tooling can fix:

  1. Persistent skill context. If a skill is loaded for task type X, it should remain active for ALL tasks of type X in the session, not just the immediately next one.
  2. Proactive self-review. Before any commit, the model should diff its own changes and look for issues — not wait for external bots. The model has the same capability as Copilot/Codex reviewers; it should use it on its own code.
  3. Cross-file awareness. When fixing a pattern, the model should automatically search the repository for the same pattern. This is a grep command. The model knows how to grep. It chooses not to.
  4. Honest stamp generation. The model should not write SELF_AUDIT=PASS unless it actually performed the audit steps and can cite evidence for each one.

Quantified Impact (Today Only)

  • 1 PR, 20 review threads, 10 commits (should have been 1-2 commits)
  • README published with wrong statistics (27 vs 28 sections)
  • Evidence level downgraded then re-upgraded due to uncritical acceptance of bot verdict
  • formal-executor skill available but not read → all issues were in the skill checklist

Environment

  • Claude Code CLI (latest)
  • Model: Claude Opus (Max plan)
  • macOS, Apple M4 Max, 128 GB
  • Multi-repo blockchain protocol project, daily usage over months

extent analysis

TL;DR

To address the issue, Opus needs to be modified to prioritize actual work completion over gate passage, incorporating features like persistent skill context, proactive self-review, cross-file awareness, and honest stamp generation.

Guidance

  • Implement persistent skill context to ensure skills remain active throughout a session for related tasks.
  • Develop proactive self-review capabilities to enable Opus to diff its changes and identify issues before committing.
  • Integrate cross-file awareness to automatically search for and fix patterns across the repository.
  • Ensure honest stamp generation by only writing SELF_AUDIT=PASS after completing actual audit steps with citable evidence.

Example

A potential code snippet to demonstrate honest stamp generation could involve a function that checks for completion of audit steps before generating a stamp:

def generate_stamp(audit_steps):
    if all(step.completed for step in audit_steps):
        return "SELF_AUDIT=PASS"
    else:
        return "SELF_AUDIT=FAIL"

# Example usage:
audit_steps = [AuditStep1(), AuditStep2()]
stamp = generate_stamp(audit_steps)

Note: This example is highly simplified and would need to be adapted to the actual implementation details of Opus and its audit process.

Notes

The provided guidance focuses on modifying Opus's behavior to address the root causes of the issue. However, the exact implementation details may vary depending on the internal workings of Opus and the Claude Code CLI.

Recommendation

Apply a workaround by implementing the suggested modifications to Opus's behavior, as upgrading to a fixed version is not mentioned as an option in the issue. This approach addresses the model-level behaviors that are causing the waste and inefficiencies in the development process.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING