[FEATURE] Suggest memory rules from repeated user corrections
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I correct Claude about the same project-specific things across sessions, for example:
- "use
pnpm, notnpm" - "don't edit generated files under
src/gen/" - "tests go next to the source, not in
__tests__"
Memory and CLAUDE.md solve this, but only if I stop what I'm doing and write the rule. In practice most corrections never make it into memory, so I repeat them next week.
Claude Code already sees the signals: a denied tool call with feedback, a rejected edit, a rewind followed by a rephrased prompt, or a message that immediately contradicts the last action.
Proposed Solution
- Spot corrections. Detect correction signals during the session, as listed above.
- Suggest a rule at a quiet moment: at the end of a session, or when the same correction comes up a second time.
> You corrected me twice about using pnpm instead of npm.
> Save this rule? → [Project CLAUDE.md] [User memory] [Dismiss]
>
> Proposed text: Use pnpm for all package commands; never npm or yarn.
- Never save silently. Always show the exact text and the target file. Dismissed suggestions are not offered again.
Alternative Solutions
- Writing rules by hand with
#or/memory: works, but depends on me remembering in the moment. - A Stop hook that parses the transcript: possible, but it can't reliably tell a correction from normal back-and-forth without the harness's own view of denials and rewinds.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
- On Monday Claude runs
npm installand I deny it: "we use pnpm". - On Wednesday it happens again in a new session.
- Claude Code suggests saving the rule to the project's
CLAUDE.md. I accept, and it never happens again, for me or for teammates who use the same repo.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗