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:
~/Library/Application Support/HongqiaoSwitch/env-backups/%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"
}
]
}varName— the environment variable name that was removedvarValue— the value at the time of removal — paste this back as-issourceType— "file" for shell rc files (macOS / Linux) or "registry" for WindowssourcePath— the original location: "path:line" on Unix, or the registry key path on Windows
Restore on macOS / Linux
- Open the backup JSON in any text editor.
- 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).
- Open that file and add a line at the end:
export VARNAME="VALUE" - Open a new terminal, or run
source ~/.zshrcin the current one.
Restore on Windows
- Open the backup JSON in any text editor.
- Open System Properties → Advanced → Environment Variables.
- Under User variables (or System variables, matching the original sourcePath), create a variable with the varName and varValue from the JSON.
- 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.