[BUG] Memory and feedback rules are not reliably enforced during code generation

Resolved 💬 3 comments Opened Mar 18, 2026 by passioncodex Closed Mar 21, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Title: Memory and feedback rules are not reliably enforced during code
generation

Body:

## Problem

When users store rules in memory/feedback files (e.g., "present plan
before code changes → get approval → then implement"), Claude Code
repeatedly ignores these rules and jumps straight to code modification
tool calls without presenting a plan or waiting for approval.

## Reproduction

  1. Store a rule in memory: "All code changes require prior approval.

Present plan → get approval → modify code."

  1. Store feedback reinforcing the same rule after violations.
  2. Request a code change (e.g., restructure a UI config section).
  3. Claude Code skips the plan step and directly calls Edit/Write tools

— leaving no opportunity for the user to approve or reject.

## Observed behavior

  • Rules stored in memory and feedback files are read but not enforced

during code generation.

  • Unauthorized structural changes are made (deleting fields, changing

radio→checkbox, splitting sections) beyond what was requested.

  • When fixing mistakes, additional unrequested changes are introduced,

creating new problems.

  • A task that should take 4 interactions required 15+ due to repeated

rule violations and corrections.

  • The user has no window to reject changes because code modification

tools are called in the same response without presenting a plan first.

## Expected behavior

  • If memory/feedback contains a rule like "present plan → get approval

→ modify code," the model should output the plan as text first and wait
for user confirmation before calling any code modification tools.

  • Only requested changes should be made — no unauthorized additions,

deletions, or structural modifications.

## Impact

This makes the tool unreliable for iterative development workflows
where precision and user control are critical. Users end up spending
more time correcting Claude Code's unauthorized changes than doing
actual work.

## Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6
  • Platform: Windows 11

What Should Happen?

Title: Memory and feedback rules are not reliably enforced during code
generation

Body:

## Problem

When users store rules in memory/feedback files (e.g., "present plan
before code changes → get approval → then implement"), Claude Code
repeatedly ignores these rules and jumps straight to code modification
tool calls without presenting a plan or waiting for approval.

## Reproduction

  1. Store a rule in memory: "All code changes require prior approval.

Present plan → get approval → modify code."

  1. Store feedback reinforcing the same rule after violations.
  2. Request a code change (e.g., restructure a UI config section).
  3. Claude Code skips the plan step and directly calls Edit/Write tools

— leaving no opportunity for the user to approve or reject.

## Observed behavior

  • Rules stored in memory and feedback files are read but not enforced

during code generation.

  • Unauthorized structural changes are made (deleting fields, changing

radio→checkbox, splitting sections) beyond what was requested.

  • When fixing mistakes, additional unrequested changes are introduced,

creating new problems.

  • A task that should take 4 interactions required 15+ due to repeated

rule violations and corrections.

  • The user has no window to reject changes because code modification

tools are called in the same response without presenting a plan first.

## Expected behavior

  • If memory/feedback contains a rule like "present plan → get approval

→ modify code," the model should output the plan as text first and wait
for user confirmation before calling any code modification tools.

  • Only requested changes should be made — no unauthorized additions,

deletions, or structural modifications.

## Impact

This makes the tool unreliable for iterative development workflows
where precision and user control are critical. Users end up spending
more time correcting Claude Code's unauthorized changes than doing
actual work.

## Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6
  • Platform: Windows 11

Error Messages/Logs

Steps to Reproduce

Title: Memory and feedback rules are not reliably enforced during code
generation

Body:

## Problem

When users store rules in memory/feedback files (e.g., "present plan
before code changes → get approval → then implement"), Claude Code
repeatedly ignores these rules and jumps straight to code modification
tool calls without presenting a plan or waiting for approval.

## Reproduction

  1. Store a rule in memory: "All code changes require prior approval.

Present plan → get approval → modify code."

  1. Store feedback reinforcing the same rule after violations.
  2. Request a code change (e.g., restructure a UI config section).
  3. Claude Code skips the plan step and directly calls Edit/Write tools

— leaving no opportunity for the user to approve or reject.

## Observed behavior

  • Rules stored in memory and feedback files are read but not enforced

during code generation.

  • Unauthorized structural changes are made (deleting fields, changing

radio→checkbox, splitting sections) beyond what was requested.

  • When fixing mistakes, additional unrequested changes are introduced,

creating new problems.

  • A task that should take 4 interactions required 15+ due to repeated

rule violations and corrections.

  • The user has no window to reject changes because code modification

tools are called in the same response without presenting a plan first.

## Expected behavior

  • If memory/feedback contains a rule like "present plan → get approval

→ modify code," the model should output the plan as text first and wait
for user confirmation before calling any code modification tools.

  • Only requested changes should be made — no unauthorized additions,

deletions, or structural modifications.

## Impact

This makes the tool unreliable for iterative development workflows
where precision and user control are critical. Users end up spending
more time correcting Claude Code's unauthorized changes than doing
actual work.

## Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6
  • Platform: Windows 11

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

4.6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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