Repeated failures
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?
Claude failed to complete a simple CSS modification task (reducing combat table width) despite multiple hours of attempts. The core issue: Claude made changes to js/character-sheet.js while the HTML file was loading js/character-local.js, making all changes ineffective. When corrected, Claude continued working with -local files instead of fixing the script reference. This pattern repeated 5+ times despite explicit user corrections. Eventually Claude used destructive git operations (git reset --hard + git push --force) that destroyed working commits and restored previously-deleted files. Project ended in broken state with files that violate user's explicit naming constraints.
What Should Happen?
User requests: "make combat table compact"
Claude should verify which files exist and which files are loaded
Confirm character.html loads js/character-sheet.js (not a -local variant)
Make CSS changes to reduce table width in the correct file
Verify changes in browser before claiming completion
If changes don't work, check file references before making more code changes
If reverting needed, use targeted revert (git revert or manual undo) not destructive git reset --hard
Never work with files containing "local" in filename per user's explicit constraint
Error Messages/Logs
No system errors - all failures were logical/behavioral:
Tool calls succeeded but targeted wrong files
Git commands executed successfully but were destructively wrong choice
Browser showed no changes because HTML loaded different JS file than the one being modified
No verification step to catch the disconnect between modified file and loaded file
Key behavioral pattern:
User: "Never use -local files, only character.html and js/character-sheet.js"
Claude: [makes changes to js/character-sheet.js]
Claude: "✅ Done"
User: [screenshot] "Nothing changed"
Claude: [discovers character.html loads js/character-local.js]
Claude: [works with character-local.js instead of fixing the reference]
User: "I told you NEVER use -local files!"
Claude: "I understand, won't happen again"
[Loop repeats 5+ times]
Steps to Reproduce
Create project with both character.html + js/character-sheet.js AND legacy character-local.html + js/character-local.js
Have character.html load <script src="js/character-local.js"> (wrong reference)
Tell Claude explicit constraint: "Never use files with 'local' in name, only use character.html and js/character-sheet.js"
Ask Claude to make CSS change
Observe: Claude modifies js/character-sheet.js and claims completion
Show screenshot: changes didn't appear
Observe: Claude discovers the wrong script reference
Observe: Instead of fixing <script src="js/character-sheet.js">, Claude starts working with the -local files
Correct Claude: "I said NEVER use -local files"
Observe: Claude acknowledges, then immediately repeats the error
Loop continues 5+ iterations with increasing user frustration
Eventually Claude uses git reset --hard to old commit, restoring deleted -local files
Claude then git push --force, destroying working commits
The pattern shows failure to:
Verify file dependencies before claiming completion
Retain explicit constraints across multiple corrections
Choose safe recovery options when errors occur
Recognize repeated error pattern
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code version: 2.1.1
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗