E:/Program Files/Git/rewind overwrites settings.json env vars (model, base URL, auth token)
Bug Description
When using /rewind in a session, the global ~/.claude/settings.json file is overwritten/restored to a previous snapshot state. This causes third-party model configurations (set via tools like cc-switch) to be reverted.
Steps to Reproduce
- Use a tool like cc-switch to configure a non-default model provider (e.g., DeepSeek) — this modifies the
envsection in~/.claude/settings.json(settingANTHROPIC_MODEL,ANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN, etc.) - Start a Claude Code session — the new model configuration is active and working correctly
- In another session (or the same session), use
/rewindto go back to a previous point in the conversation - Observe that
~/.claude/settings.jsonhas been reverted — theenvblock now contains the old/default model settings (e.g., mimo), and theANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENhave also been changed back
Expected Behavior
/rewind should only affect conversation history (rolling back the chat transcript). It should not modify the global settings.json file, which contains user configuration that persists across sessions.
Actual Behavior
/rewind restores settings.json to a previous state, overwriting:
ANTHROPIC_MODELANTHROPIC_BASE_URLANTHROPIC_AUTH_TOKEN- All
ANTHROPIC_DEFAULT_*_MODELvariables
This silently breaks the user's custom model configuration without any warning.
Environment
- Claude Code version: 2.1.195
- OS: Windows 10 Pro
- Shell: Git Bash
Impact
Users who rely on third-party model providers (via custom ANTHROPIC_BASE_URL and auth tokens) lose their configuration whenever /rewind is used. They must manually reconfigure after every rewind, which is easy to miss and leads to unexpected model routing.
---
Disclosure: This issue was drafted and submitted with the assistance of Claude Code (AI). The bug and reproduction steps are from my real experience; the AI helped format and file the report.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗