Persist Claude Code Configuration
This guide explains how to keep Claude Code connected to a PaletteAI Inference Launchpad appliance after you close the terminal. The steps save the connection for new terminals, integrated development environment (IDE) extensions, and apps that you start outside a terminal.
Start with Save the Configuration in a Settings File. Use the other sections only for the cases they name. For what each method reaches, refer to Where Claude Code Reads Its Configuration. For what a session on the appliance does not include, such as your claude.ai connectors, refer to What a Session on the Appliance Does Not Include.
Prerequisites
-
Claude Code connected to the appliance in a terminal. To connect it, refer to Use PaletteAI Inference Launchpad with Claude Code.
-
The values from the Claude Code CLI tab of the Connect a coding agent panel.
-
macOS. The Set the Variables for Non-Interactive Shells section also needs
zsh, the default macOS shell.
Save the Configuration in a Settings File
To apply the configuration no matter how Claude Code starts, including from an IDE extension, save it in a Claude Code settings file.
-
Choose the settings file. For the difference between the files, refer to Claude Code Settings Files.
-
If you use Claude Code only with the appliance, use the user file,
~/.claude/settings.json. -
If you also use Claude Code with your Anthropic account, use the project file,
<project>/.claude/settings.local.json. Add.claude/settings.local.jsonto the project's.gitignorefile.
-
-
Open the file in a text editor, or create it if it does not exist. Add the following
envblock at the top level of the file, next to any other settings.{
"env": {
"ANTHROPIC_BASE_URL": "https://<appliance-host>",
"ANTHROPIC_AUTH_TOKEN": "<lpai-token>",
"NODE_EXTRA_CA_CERTS": "/Users/<username>/Downloads/palette-ai-inference-launchpad-ca.crt",
"CLAUDE_CODE_AUTO_MODE_SERVER": "0"
}
}Replace
<appliance-host>with your appliance address,<lpai-token>with your API token, and<username>with your macOS user name.-
If the file already has an
envkey, add the variables to it instead of adding a second one. -
Do not add the variables to the
environmentkey insideautoMode. -
Include the
NODE_EXTRA_CA_CERTSline only when the panel shows the CA certificate step. Use the full path to the file. -
To save another variable from the panel, such as
ANTHROPIC_MODEL, add it to theenvblock. -
Do not share or commit the file.
-
-
(Optional) If the Claude Code extension for VS Code asks you to sign in, open the VS Code settings, search for
claudeCode.disableLoginPrompt, and select its checkbox.
Set the Variables for Non-Interactive Shells
To make the variables available to every zsh shell, including scripts and the shells that an IDE starts, add them to
~/.zshenv instead of ~/.zshrc.
-
Open
~/.zshenvin a text editor, or create it if it does not exist. Add the following lines.export ANTHROPIC_BASE_URL="https://<appliance-host>"
export ANTHROPIC_AUTH_TOKEN="<lpai-token>"
export NODE_EXTRA_CA_CERTS=$HOME/Downloads/palette-ai-inference-launchpad-ca.crt
export CLAUDE_CODE_AUTO_MODE_SERVER=0Replace
<appliance-host>with your appliance address and<lpai-token>with your API token. Include theNODE_EXTRA_CA_CERTSline only when the panel shows the CA certificate step. To save another variable from the panel, add anotherexportline. Do not share the file. -
Open a new terminal, and confirm that
ANTHROPIC_BASE_URLis set.echo $ANTHROPIC_BASE_URLExpected outputhttps://<appliance-host>
Set the Variables for Apps Opened Outside a Terminal
To make the variables available to IDEs and other apps that you open from Spotlight, Finder, or the Dock, set them with
launchctl.
-
Set each variable.
launchctl setenv ANTHROPIC_BASE_URL "https://<appliance-host>"
launchctl setenv ANTHROPIC_AUTH_TOKEN "<lpai-token>"
launchctl setenv NODE_EXTRA_CA_CERTS $HOME/Downloads/palette-ai-inference-launchpad-ca.crt
launchctl setenv CLAUDE_CODE_AUTO_MODE_SERVER 0Replace
<appliance-host>with your appliance address and<lpai-token>with your API token. Include theNODE_EXTRA_CA_CERTSline only when the panel shows the CA certificate step. To save another variable from the panel, add anotherlaunchctl setenvcommand. The commands print nothing when they succeed. -
Confirm that
ANTHROPIC_BASE_URLis set.launchctl getenv ANTHROPIC_BASE_URLExpected outputhttps://<appliance-host> -
(Optional) If an IDE is already running, quit the whole app with CMD + Q, not only its windows. Then open the IDE again.
-
(Optional) To set the variables again after each restart, save the following file as
~/Library/LaunchAgents/local.launchpad-env.plist.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.launchpad-env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>launchctl setenv ANTHROPIC_BASE_URL https://<appliance-host>; launchctl setenv ANTHROPIC_AUTH_TOKEN <lpai-token>; launchctl setenv NODE_EXTRA_CA_CERTS /Users/<username>/Downloads/palette-ai-inference-launchpad-ca.crt; launchctl setenv CLAUDE_CODE_AUTO_MODE_SERVER 0</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>Replace
<appliance-host>with your appliance address,<lpai-token>with your API token, and<username>with your macOS user name. Include alaunchctl setenvcommand for each variable that you set in step 1. Remove theNODE_EXTRA_CA_CERTScommand when the panel shows no CA certificate step. Do not share the file. -
(Optional) If you created the LaunchAgent file, load it.
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/local.launchpad-env.plistThe command prints nothing when it succeeds.
Trust the Platform CA in the macOS Keychain
If the panel shows the CA certificate step and you use tools that do not read NODE_EXTRA_CA_CERTS, add the
platform Certificate Authority (CA) certificate to your login keychain.
-
Add the certificate. If macOS asks you to authenticate, approve the prompt.
security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db $HOME/Downloads/palette-ai-inference-launchpad-ca.crtThe command prints nothing when it succeeds.
-
Confirm that macOS trusts the appliance.
curl --output /dev/null --silent --show-error --write-out '%{http_code}\n' https://<appliance-host>/v1/modelsReplace
<appliance-host>with your appliance address.Expected output401A
401status code means that macOS trusts the appliance certificate. If the command prints a certificate error instead, confirm that the certificate path in step 1 points to the file that you downloaded, and run step 1 again.
Verify the Configuration
-
Open a new terminal. If you used the project file, change to the project folder.
-
Start Claude Code.
claude -
Run
/status, and check that the Anthropic base URL line shows your appliance address.Expected outputAuth token: ANTHROPIC_AUTH_TOKEN
Anthropic base URL: https://<appliance-host> -
Exit with
/exit. -
(Optional) If you use Claude Code in an IDE, open a new integrated terminal in the IDE, and repeat steps 2 - 4.
Switch Back to Your Anthropic Account
-
In the settings file that you edited, remove the variables that you added to the
envkey. If theenvkey is then empty, remove it. If the file holds nothing else, delete the file. -
(Optional) If you added the variables to
~/.zshenv, remove those lines. -
(Optional) If you set the variables with
launchctl, remove them.launchctl unsetenv ANTHROPIC_BASE_URL
launchctl unsetenv ANTHROPIC_AUTH_TOKEN
launchctl unsetenv NODE_EXTRA_CA_CERTS
launchctl unsetenv CLAUDE_CODE_AUTO_MODE_SERVERThe commands print nothing when they succeed.
-
(Optional) If you created the LaunchAgent file, remove it.
launchctl bootout gui/$UID/local.launchpad-env
rm ~/Library/LaunchAgents/local.launchpad-env.plistThe commands print nothing when they succeed.
-
(Optional) If you selected the
claudeCode.disableLoginPromptcheckbox, open the VS Code settings, search forclaudeCode.disableLoginPrompt, and clear its checkbox. -
(Optional) If you use Claude Code in an IDE, quit the IDE with CMD + Q, and open it again.
-
(Optional) If you removed
launchctlvariables, quit your terminal app with CMD + Q, and open it again. -
Open a new terminal, start Claude Code, and run
/status. Confirm that the Anthropic base URL line no longer shows your appliance address. -
(Optional) If you use Claude Code in an IDE, open a new integrated terminal in the IDE, and repeat step 8.
Next Steps
To look up each variable, refer to Claude Code Configuration.