claude-code - 💡(How to fix) Fix Opus 4.6 regression: ignores established session patterns after context restore [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50763Fetched 2026-04-20 12:13:43
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

After a context restore (session continuation from a previous conversation that hit context limits), Opus 4.6 exhibited multiple regressions compared to behavior in the same session before the context break:

  1. Regenerated maps with matplotlib instead of using existing ArcGIS exports. User asked to recreate Figure 13 with WGS 84 coordinates. ArcGIS-exported PNGs already existed at maps/exports/CCI.png and maps/exports/MSI.png (exported same day). Instead of compositing those, the model re-rendered maps from raw rasters using matplotlib — producing inferior output without proper cartographic elements (scale bars, north arrows, graticules, district boundaries). User had to explicitly point out the exports existed.

  2. Unnecessary version increment on PermissionError. When the output DOCX was locked (open in Word), prior sessions would wait for the user to close it and retry. Instead, the model immediately incremented the filename from v5 to v6. When user pointed this out, the model had to revert.

  3. Context restore confusion. At the start of the restored session, the model called ExitPlanMode and ToolSearch before addressing the user, causing the user to think context was being compacted again.

Root Cause

After a context restore (session continuation from a previous conversation that hit context limits), Opus 4.6 exhibited multiple regressions compared to behavior in the same session before the context break:

  1. Regenerated maps with matplotlib instead of using existing ArcGIS exports. User asked to recreate Figure 13 with WGS 84 coordinates. ArcGIS-exported PNGs already existed at maps/exports/CCI.png and maps/exports/MSI.png (exported same day). Instead of compositing those, the model re-rendered maps from raw rasters using matplotlib — producing inferior output without proper cartographic elements (scale bars, north arrows, graticules, district boundaries). User had to explicitly point out the exports existed.

  2. Unnecessary version increment on PermissionError. When the output DOCX was locked (open in Word), prior sessions would wait for the user to close it and retry. Instead, the model immediately incremented the filename from v5 to v6. When user pointed this out, the model had to revert.

  3. Context restore confusion. At the start of the restored session, the model called ExitPlanMode and ToolSearch before addressing the user, causing the user to think context was being compacted again.

RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code CLI on Windows 11
  • Model: Claude Opus 4.6
  • Date: 2026-04-19

Description

After a context restore (session continuation from a previous conversation that hit context limits), Opus 4.6 exhibited multiple regressions compared to behavior in the same session before the context break:

  1. Regenerated maps with matplotlib instead of using existing ArcGIS exports. User asked to recreate Figure 13 with WGS 84 coordinates. ArcGIS-exported PNGs already existed at maps/exports/CCI.png and maps/exports/MSI.png (exported same day). Instead of compositing those, the model re-rendered maps from raw rasters using matplotlib — producing inferior output without proper cartographic elements (scale bars, north arrows, graticules, district boundaries). User had to explicitly point out the exports existed.

  2. Unnecessary version increment on PermissionError. When the output DOCX was locked (open in Word), prior sessions would wait for the user to close it and retry. Instead, the model immediately incremented the filename from v5 to v6. When user pointed this out, the model had to revert.

  3. Context restore confusion. At the start of the restored session, the model called ExitPlanMode and ToolSearch before addressing the user, causing the user to think context was being compacted again.

Expected behavior

  • Check maps/exports/ for existing ArcGIS-exported maps before generating matplotlib replacements
  • On PermissionError, ask the user to close the file and retry with the same filename
  • After context restore, resume work smoothly without unnecessary tool calls that confuse the user

User impact

Multiple round-trips wasted correcting avoidable mistakes. User describes this as "total stupidity" and feels the model was "nerfed" compared to prior sessions.

extent analysis

TL;DR

Check the context restoration logic to ensure it correctly retains previous session state and integrates with existing file checks and error handling mechanisms.

Guidance

  • Review the code handling context restoration to identify why the model is not retaining the expected behavior from previous sessions, such as checking for existing ArcGIS-exported maps and handling PermissionErrors by waiting for user action.
  • Verify that the maps/exports/ directory is being correctly checked for existing files before attempting to regenerate maps with matplotlib.
  • Investigate the ExitPlanMode and ToolSearch calls after context restore to determine why they are being triggered unnecessarily and adjust the logic to prevent this confusion.
  • Consider adding logging or debugging statements to understand the model's decision-making process during context restoration and error handling.

Example

No specific code snippet can be provided without more context, but the fix might involve modifying the context restoration function to include checks like if os.path.exists('maps/exports/CCI.png') before regenerating maps.

Notes

The issue seems to stem from a combination of problems with context restoration and integration with existing file and error handling mechanisms. Without access to the specific codebase, it's challenging to provide a precise fix. However, focusing on how the model restores context and handles files and errors should lead to a resolution.

Recommendation

Apply a workaround by manually ensuring that the context restoration logic correctly integrates with existing file checks and error handling until a more permanent fix can be implemented. This is because the issue seems to be related to how the model handles session continuation and file management, and a workaround can help mitigate the user impact while a more thorough solution is developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • Check maps/exports/ for existing ArcGIS-exported maps before generating matplotlib replacements
  • On PermissionError, ask the user to close the file and retry with the same filename
  • After context restore, resume work smoothly without unnecessary tool calls that confuse the user

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING