[BUG] 'Update' tool on a large file loads the entire file into context exceeding the compactable amount causing the chat to become irrecoverable.

Resolved 💬 5 comments Opened Sep 23, 2025 by loic-cunningham Closed Feb 14, 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?

When working with a large file e.g abstracting it claude code will load the entire file into context (exceeding 222.9k tokens (111.4%) what should be possible causing /compact to fail due to size issues. This makes the entire conversation irrecoverable.

It seems to happen when running the 'update' tool call on a large file.

What Should Happen?

1) It should not have to load the entire file to make an update 2) It should not exceed 100% context use if it can't load the entire file into the history. This causes both auto and manual compacting to fail and ruins the chat.

Error Messages/Logs

● I can see that there's already a LoginDialog import at
  line 4247, but it's pointing to a different path. Let me
   replace the existing login dialog implementation:


● Update(rld-frontend/src/layouts/MainLayout.vue)
  ⎿  Updated rld-frontend/src/layouts/MainLayout.vue with
.. omitted for brevity
  ⎿  Context low · Run /compact to compact & continue

/context
 ⎿ Context Usage
     ⛁ ⛁ ⛁ ⛁   claude-sonnet-4-20250514 • 237k/200k tokens
    (119%)
     ⛁ ⛁ ⛁ ⛁
     ⛁ ⛁ ⛁ ⛁   ⛁ System prompt: 3.1k tokens (1.5%)
     ⛁ ⛁ ⛁ ⛁   ⛁ System tools: 11.5k tokens (5.7%)
     ⛁ ⛁ ⛁ ⛁   ⛁ Messages: 222.9k tokens (111.4%)

Steps to Reproduce

  1. Create a large file which exceeds the 200k token context window
  2. Ask Claude to update it without reading the entire file
  3. Context will exceed 100% when it shouldn't have read the entire file, and /compact will no longer work.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.0.120

Claude Code Version

1.0.120 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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