Skip to content

Claude common config updates do not refresh active live config during takeover #338

Description

@mydelren

Summary

When Claude proxy takeover is already active, updating Claude common config refreshes the DB snippet but does not refresh the active live config (~/.claude/settings.json).

In this state, cc-switch reports success / refreshed live config, but snippet-owned fields such as statusLine or simple env keys never appear in the active Claude live settings.

Scope

This report is specifically about the Claude takeover-active path.

I am not claiming that common config is generally broken:

  • when proxy takeover is inactive, config common set updates Claude live config as expected
  • when common config is set before proxy enable, the resulting taken-over live config also keeps the common fields
  • the stale behavior appears when takeover is already active and then common config is updated

Reproduction

Minimal repro uses a simple env key instead of statusLine, so no helper script is required.

  1. Start with a Claude provider whose commonConfigEnabled=true
  2. Enable Claude proxy takeover
  3. Run a common-config update, for example a snippet that adds:
    • env.MY_TEST_KEY = "1"
  4. Inspect both:
    • the stored common config in cc-switch
    • the active Claude live config at ~/.claude/settings.json

Expected behavior

Both should reflect the new common-config fields.

Actual behavior

  • cc-switch stores the updated Claude common config
  • but the active Claude live config remains stale
  • takeover-only fields (proxy URL / managed placeholder) stay in place, but newly added common fields do not appear

In my real-world case this showed up as statusLine existing in cc-switch common config while Claude Code never displayed it, because ~/.claude/settings.json never received the field.

Notes from local investigation

The likely problematic path seems to be the post-commit flow used when takeover is already active:

  • common-config update builds a post-commit action with takeover_active=true
  • this goes through the ProxyLiveBackup effect
  • backup/snapshot handling runs, but the active Claude live config is not refreshed through the same effective-settings path used elsewhere

I have a local patch and regression test prepared and can open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions