[BUG] Claude FORGETS everything after compact sessions...

Resolved 💬 3 comments Opened Oct 20, 2025 by JoMiPeCa Closed Oct 24, 2025

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?

When I'm working with Claude Code, I have noticed that EVERY time the context is autocompacted, it lose EVERY detail that I have explained and wrote on CLAUDE.md, even when I told claude to review his config files, even when it has instructions to check CLAUDE.md each time he loses context, or to read whole MD. he keep losing whole configuration and I need to lose more than 20k tokens trying to configure Claude each time. Plus each time autocompact happens around 180k so at end my available tokens per session are very few.

What Should Happen?

Claude should READ the claude.md file after every restart of session (compact/clear) and DONT lose the configuration if its still in the same project folder as when it started.

Error Messages/Logs

Steps to Reproduce

  1. Open a new session.
  2. Work with Claude
  3. Run commands to connect to ssh servers
  4. Run Jenkins pipes
  5. Run Fixes on code
  6. Run anything else

-- Oh no, Context is done! New session starting

  1. Ask to run a jenkins pipe.... Claude will start looking for past builds, or will make his own url and try to run them failing... Then ask him to review MD file with Jenkins structure he made few days ago, he will lose 5k tokens in this process.
  2. Ask to check logs on server. He will try to connect first over sshpass, then he will ask you the password (even if after 50 sessions he used in all sessions pem files because you teach him how to use pem files and wrote in Claude.md about pem files). Then you tell Claude to use pem files, and he will use wrong pem file, Give claude the right location to pem files and "Oh right! We have pem files here, I'm going to use those files to connect now" and he start working...

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.22

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Please solve this... It's very annoying to have claude learning everuything at everytime and he doesnt read his CLAUDE.md file... I need to remind him to read it, and then to read it again slowly because he only focus on important things...

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗