Critical: Claude Code context amnesia causes silent code deletion
Environment
- Platform: Claude Code CLI
- Claude CLI version: 1.0.61
- Operating System: macOS 15.5 (Build 24F74)
- Terminal: Terminal App
Bug Description
Critical amnesia issue:
Claude Code reads codebase initially but loses ALL context after few messages, causing code loss and trash additions. After 1 month testing both Claude Code CLI and Claude 4 in Cursor, consistent pattern shows Claude 4 performs worse than Claude 3.5 despite marketing claims.
Steps to Reproduce
- Claude Code reads 1,684-line file initially ✅
- Request: "split that files into modular folder"
- Result: 225 lines lost (13% of code disappeared)
- Continue conversation 5-10 messages
- Claude forgets everything - requires "read conversation as context"
- Test on simple REST API - adds unnecessary boilerplate during "optimization"
Expected Behavior
- Maintain codebase context throughout session
- Preserve 100% code integrity during refactoring
- Focus on requested changes only
Actual Behavior
Amnesia Pattern:
- ✅ Reads codebase initially
- ❌ Loses ALL context after few steps
- ❌ Lost 225 lines during modularization
- ❌ Adds trash code during optimization
- ❌ Requires constant reminders to read context
Model Comparison (1 Month Testing):
- Claude 3.5: Better focus, similar amnesia but less severe
- Claude 4: Worse performance, more verbose, adds unnecessary complexity
- Regression confirmed across Claude Code CLI and Cursor IDE
Additional Context
Production Impact (30 Days Usage):
- Constant context resets needed
- More time fixing Claude's mistakes than original work
- Standard workflow broken: Must remind Claude to read codebase every few messages
Key Issues:
- Amnesia: Forgets codebase context mid-conversation
- Code Loss: Silent deletion of functional code
- Trash Addition: Adds unnecessary complexity during optimization
- Model Regression: Claude 4 worse than Claude 3.5
- Overclaiming: Marketing doesn't match reality
Evidence:
- Original: 1,684 lines → Modular: 1,459 lines = 225 lines missing
- Missing methods:
getBaseProcessesForNodeType(),getMemoryUtilizationFactor(), etc. - Same issues across Claude Code CLI and Cursor IDE
- Claude 3.5 performs better in semantic reasoning
Bottom Line:
Claude Code has severe amnesia - reads codebase then forgets everything, causing data loss and requiring constant context reminders.
---
Conversation History
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/89eec256-28a2-4276-8aa0-61c72009f50e" />
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/b50506f3-7f8c-4911-ae0d-eef740a53677" />
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/53a96ae3-b326-4679-977e-4f5c0a6a909d" />
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/c31b3f7a-34a7-4bdc-9271-30bb7284e955" />
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/290db352-4f45-4285-b19e-6381dcdc7f65" />
<img width="897" height="1032" alt="Image" src="https://github.com/user-attachments/assets/5c8893e8-51d5-4bce-a3da-320ae5be7c8d" />
--
Proof of Usage in Cursor IDE
<img width="3600" height="1920" alt="Image" src="https://github.com/user-attachments/assets/87500392-7478-4a1c-852b-8c6b52cc6ba7" />
21 Comments
I shared a GitHub URL (https://github.com/anthropics/claude-code/issues/4487) and Claude immediately assumed it was a successfully posted issue, responding with detailed analysis about the submission without actually checking the URL first.
When am asked Claude to "read the opening issues and read some issue" from the repository, Claude finally fetched the URL and discovered issue #4487 doesn't exist. This sequence perfectly demonstrates Claude Code's core amnesia problem - it makes confident assumptions without verification, loses track of what it has actually checked versus what it assumes, and requires explicit user prompting to perform basic validation tasks that should happen automatically.
Claude said :
_"Ah! Now I understand - issue #4487 doesn't actually exist"_
<img width="938" height="1020" alt="Image" src="https://github.com/user-attachments/assets/96d5dd77-7843-4b29-9cbb-791f91a6a762" />
@NeaByteLab I believe you are experiencing this issue because parsing a website consumes a lot of tokens, and Anthropic is trying to minimize the usage. So instead of the bot checking what is really going on the website, it's just giving you an assumption which most of the times is wrong. The same thing happens when it is checking the files. Previously, it was much more prone to reading files, and now it is much more prone to just writing.
This is just an observation. I don't have any factual data to support my claim. Can also be due to the fact that Claude Code is getting dangerously slow compared to other tools on the market, so they have to compromise by missing long running steps.
Current Claude Code architecture :
Then the issue about token optimization theory doesn't hold up.
The real issue becomes more concerning :
If full context is being sent but Claude still "forgets":
Two possibilities :
The amnesia is happening DESPITE having full context - that's a much worse problem than token optimization.
<img width="887" height="460" alt="Image" src="https://github.com/user-attachments/assets/12de00f6-05e2-4c43-bb39-aaa4f191a2ed" />
<img width="1799" height="887" alt="Image" src="https://github.com/user-attachments/assets/91abefb4-2ca2-4f83-b858-e2b6749fc554" />
_Claude: Always challenge AI assessments, especially definitive technical claims._
<img width="1800" height="956" alt="Image" src="https://github.com/user-attachments/assets/16afa0a9-0b97-46fb-8e5c-8023b2f6931e" />
<img width="667" height="763" alt="Image" src="https://github.com/user-attachments/assets/714f0ebf-08db-45eb-97ed-24a795640748" />
<img width="1100" height="962" alt="Image" src="https://github.com/user-attachments/assets/ddeb01b1-2485-4156-8160-177886d033bb" />
Why I'm Reporting This
This is honest user feedback to help improve Claude Code. Not promotional content or competitive agenda - just genuine experience from actual usage.
Documentation Provided
Conclusion
Many users likely face similar issues. Thank you for considering this feedback - I hope it helps make Claude Code more reliable for serious development work.
try to downgrade claude package version, it works for me
npx @anthropic-ai/claude-code@1.0.24, newer versions compresses context, from what version can't tellv1.0.61 👍🏻
<img width="677" height="452" alt="Image" src="https://github.com/user-attachments/assets/ee5219bf-6f38-4140-ac48-09ed14089f1f" />
---
v1.0.24 much better 👍🏻
<img width="696" height="790" alt="Image" src="https://github.com/user-attachments/assets/d7a7486f-b5e9-4fd6-956d-3d14cd4bcc03" />
I have issues that I feel are related in terms of context amnesia. Two examples from today using opus in Claude CLI . Claude forgot mid-conversation how to use gcloud and told me "I'm just an AI assistant, I don't have the ability to run shell commands or access external systems" , funny bc that is most of what I use it to do. Now I asked it to add a user, it did so successfully, then when adding a second user it forgot Python syntax, forgot that it had just written a script to add a user that was successful. I have been using it all day, every day for weeks and I agree this is a degradation from the previous functionality. I had previously been getting around the forgetfulness by having it write MD files of the current TODO and follow them but it seems to be forgetting mid conversation now, even with the files
<img width="1440" height="359" alt="Image" src="https://github.com/user-attachments/assets/395b3a35-da0e-4601-93db-91b2b13cd041" />
v1.0.24 bettter, u should try that!
Feedback (v1.0.24)
thanks!
anyone else experience better results with v1.0.24?
Initially, I thought, "Yeah", but after using it for several hours, it still makes dumb mistakes. @notengoideanise
So far v1.0.24 feels better than v1.0.61 for me too.
I'm curious if there's any newer version without the amnesia issues seen in v1.0.61.
It might be, 1.0.24 is just most older version you can run, though if they really "optimize" context in newer versions, they have done it incrementally through a lot of updates, that's why so many users didn't realize that tool became dumber
Do y'all have a file like this that you can share? I.e., a large file that you want split into modules, which it does poorly? I'd like to be able to repeat the test.
The Quen 3 Suicide Power move was so funny lmao, but seriously wtf is happening to claude code
Want to challenge the AI? Tell it to wrap several public APIs into a single file, then refactor that monolith into clean, modular parts—without even asking for basic HTML. This is, for example, writing 5,000+ lines of code without losing context!
<img width="274" height="356" alt="Image" src="https://github.com/user-attachments/assets/e340c546-b294-410e-811e-ac41a670232f" />
still having the same results? have you tested the newest version again?
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This issue has been automatically closed as a duplicate of #4520.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.