[BUG] Claude Code automatically reverts user code changes without permission
(claude --version)
⎿ 1.0.60 (Claude Code)
Environment
- Platform (select one):
- Anthropic API
- AWS Bedrock
- Google Vertex AI
- Other:
- Claude CLI version: 1.0.60 (Claude Code)
- Operating System: Linux 6.14.2-300.fc42.x86_64 (Fedora)
- Terminal: bash
Bug Description
Claude Code automatically reverts legitimate user code changes without
permission or configuration. When editing TypeScript/React files,
intentional code modifications get automatically changed back to a
"preferred" format, preventing legitimate development work.
Steps to Reproduce
- Open a Next.js TypeScript project in Claude Code
- Edit a file to change className="h-screen pt-20" to
className="h-[calc(100vh-80px)]"
- Save the file or wait briefly
- Observe that the file content automatically reverts to the original
h-screen pt-20
- System reminders appear stating "file was modified, either by the user or
by a linter"
Expected Behavior
User code changes should persist unless explicitly formatted through
user-initiated commands. Development tools should not automatically modify
code without explicit user permission or configuration.
Actual Behavior
Files are automatically modified back to a "preferred" format, overriding
intentional user changes. This happens even when:
- No Prettier configuration exists
- ESLint is disabled (eslint.config.mjs renamed to .disabled)
- Next.js ESLint integration is disabled
- No VS Code format-on-save settings found
- No git hooks or pre-commit tools detected
Additional Context
- This blocks legitimate CSS class modifications needed for layout fixes
- Behavior persists across multiple file edits and tool restarts
- No user configuration found that controls this auto-formatting
- Violates fundamental principle that IDEs should not modify code without
consent
- Impact: Unable to use Claude Code due to automatic code
reversion
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗