E:/Program Files/Git/rewind overwrites settings.json env vars (model, base URL, auth token)

Open 💬 2 comments Opened Jun 28, 2026 by maoshi7

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

  1. Use a tool like cc-switch to configure a non-default model provider (e.g., DeepSeek) — this modifies the env section in ~/.claude/settings.json (setting ANTHROPIC_MODEL, ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, etc.)
  2. Start a Claude Code session — the new model configuration is active and working correctly
  3. In another session (or the same session), use /rewind to go back to a previous point in the conversation
  4. Observe that ~/.claude/settings.json has been reverted — the env block now contains the old/default model settings (e.g., mimo), and the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN have 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_MODEL
  • ANTHROPIC_BASE_URL
  • ANTHROPIC_AUTH_TOKEN
  • All ANTHROPIC_DEFAULT_*_MODEL variables

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.

View original on GitHub ↗

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