claude-code - 💡(How to fix) Fix `/model` switch warning fires after `/clear` but not on a fresh instance

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…

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

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?

After running /clear, switching models via /model triggers the warning introduced in v2.1.108:

"This conversation is cached for the current model. Switching to Opus 4.7 means the full history gets re-read on your next message."

This warning does NOT appear when switching models on a brand new session (fresh restart, no prior conversation). It only appears after /clear has been run. Since /clear is supposed to wipe conversation history entirely, the two states should be equivalent from the warning's perspective, but they are not.

What Should Happen?

After /clear, the session state relevant to the /model warning should be equivalent to a fresh instance. No warning should appear.

Error Messages/Logs

Steps to Reproduce

  1. Start a Claude Code session
  2. Have any conversation
  3. Run /clear
  4. Run /model and switch to a different model → Warning appears despite empty context

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Running on Ghostty terminal

Related Issues

  • #48087

extent analysis

TL;DR

The warning after running /clear and switching models via /model may be due to incomplete clearing of conversation history, and verifying the state after /clear can help identify the issue.

Guidance

  • Verify the conversation history is indeed cleared after running /clear by checking for any remaining context or state that could trigger the warning.
  • Investigate the difference in session state between a fresh instance and one where /clear has been run to understand why the warning appears in the latter case.
  • Check the implementation of /clear to ensure it properly resets all relevant session state, including any cached conversation history.
  • Review related issue #48087 for potential insights or fixes that may apply to this problem.

Notes

The issue seems to be related to the interaction between the /clear command and the conversation history caching mechanism, but without more information about the implementation, it's difficult to provide a definitive fix.

Recommendation

Apply workaround: Verify and potentially modify the /clear command to ensure it properly clears all relevant session state, as this seems to be the most likely cause of the issue.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix `/model` switch warning fires after `/clear` but not on a fresh instance