Skip to content

[BUG] Autocompact is thrashing: the context refilled to the limit within 3 turns of the previous compact, 3 times in a row. #82131

Description

@rahul-kulkarni105

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Autocompact is thrashing: the context refilled to the limit within 3 turns of the previous compact, 3 times in a row. A file being read or a tool output is likely too large for the context window. Try reading in smaller chunks, or use /clear to start fresh.

Claude Vscode extension version: 2.1.220

What Should Happen?

I should not get this warning and the agent should not keep compating every prompt when the context is not large at all.

Error Messages/Logs

Steps to Reproduce

  1. I got this warning while doing a heavy context operation with a large file.
  2. Since then i have restarted vscode, reinstalled the extension, used /clear.
  3. I am getting this warning even for a much smaller and routine prompts. Almost like there is a cache which is still not clearing the threshold for the warning to clear.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.220`

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions