[BUG] Auto-compact not accounting for web search results

Resolved 💬 5 comments Opened Dec 5, 2025 by bguezzie Closed Feb 6, 2026

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?

I think there is an issue with auto-compact detection and web search. I noticed that before a web search the context had no warnings about nearing auto-compact, but then immediately after the search Claude Code was unable to compact (auto or via /compact) due to the context being too long. Going back in history may work, but I'm always really nervous I'm going to lose some important part of the
conversation.

What Should Happen?

Claude should determine if the web search results have extended the context beyond the compaction limit, and if so compact from the point before the search, then replay the search action from memory (no need to actually issue the search again) to ensure all behavior is within the bounds of the context.

Error Messages/Logs

Steps to Reproduce

I do not have a set of steps that will work every time. I only know that my context had no percent-remaining-until-auto-compact shown in claude-code, then I issued a prompt that triggered a web search. That web search got 10 hits, and then claude-code tried to auto-compact and failed. Manual compaction failed as well.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.55

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

PyCharm terminal

Additional Information

_No response_

View original on GitHub ↗

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