[MODEL] Agent become considerably far less smart after several context compact
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude's behavior changed between sessions
What You Asked Claude to Do
After several context compact, the Claude is considerably far less smart. Forgotting things even 2 prompt before.
What Claude Actually Did
Example what the agent did:
1.
After several compact
- Prompt: Please create a new documents using @template
- Agent: Created a new document using referenced template
- Prompt: Not good, adjust the tone, delete the old document and create new document
- Agent: Deleted old template and create new template not using @template
2.
Before compact
- Prompt: Please create a new API endpoints
- Agent: Creating API in a long proses
Several compact happened
- Prompt: Please check why the build is having errors
- Agent: Checking the error. Find the errors, commented the API it just made completely, saying it's resulting in an error and need to be commented. Does nothing after that, not recognizing the initial task.
Expected Behavior
Example what the agent should do:
1.
After several compact
- Prompt: Please create a new documents using @template
- Agent: Created a new document using referenced template
- Prompt: Not good, adjust the tone, delete the old document and create new document
- Agent: Deleted old template and create new template using the correct @template
Expect: remember that just in 2 prompt ago the prompt to create new docs is using @template. this did not happen when the agent is fresh
2.
Before compact
- Prompt: Please create a new API endpoints
- Agent: Creating API in a long proses
Several compact happened
- Prompt: Please check why the build is having errors
- Agent: Checking the error. Find the errors, fix the error in the API it just made
Eexpect: Still remember well the initial task and what it just made
Files Affected
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
Do a long task that require several context compact
Claude Model
Sonnet
Relevant Conversation
Impact
Critical - Data loss or corrupted project
Claude Code Version
1.0.112
Platform
Anthropic API
Additional Context
I have to create a good memory system with multiple layer to handle this. The problem is that I have to refresh the agent memory system after every compact. Kinda not practical but works
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗