Help

Restore an env-variable backup

When HaryAI Switch's "Remove from shell config" button deletes an export, it first saves a JSON backup. If you want any of those exports back, here's how to read the backup and put them back yourself.

Where backups are saved

Each run of the fixer writes a new file under the app's data directory:

macOS~/Library/Application Support/HongqiaoSwitch/env-backups/
Windows%APPDATA%\HongqiaoSwitch\env-backups\

File names are timestamped, e.g. env-backup-20260518_124530.json.

What's inside the file

Each backup is plain JSON. The conflicts array lists every entry that was deleted:

{
  "backupPath": "...",
  "timestamp": "20260518_124530",
  "conflicts": [
    {
      "varName": "ANTHROPIC_BASE_URL",
      "varValue": "http://example.test",
      "sourceType": "file",
      "sourcePath": "/Users/you/.zshrc:3"
    }
  ]
}
  • varNamethe environment variable name that was removed
  • varValuethe value at the time of removal — paste this back as-is
  • sourceType"file" for shell rc files (macOS / Linux) or "registry" for Windows
  • sourcePaththe original location: "path:line" on Unix, or the registry key path on Windows

Restore on macOS / Linux

  1. Open the backup JSON in any text editor.
  2. For each entry you want back, look at sourcePath — the part before the colon is the shell rc file that originally had the export (e.g. ~/.zshrc).
  3. Open that file and add a line at the end: export VARNAME="VALUE"
  4. Open a new terminal, or run source ~/.zshrc in the current one.

Restore on Windows

  1. Open the backup JSON in any text editor.
  2. Open System Properties → Advanced → Environment Variables.
  3. Under User variables (or System variables, matching the original sourcePath), create a variable with the varName and varValue from the JSON.
  4. Open a fresh PowerShell or cmd window for the change to be picked up.

What happens next time you open HaryAI Switch

If you restore the same export, HaryAI Switch will flag it as a conflict again the next time it scans. That's expected — Claude Code and Codex both treat shell environment variables as the highest-precedence config source, so anything your shell exports will override what the app writes. If you want the export to coexist with the switch, point both at the same gateway.

Cleaning up old backups

Backups are not auto-deleted. Once you've confirmed the switch is working as expected, it's safe to remove any env-backup-*.json files you don't plan to restore from.

HaryAI — Claude and Codex, ready on your desktop.