Skip to main content

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​

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.

  1. 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.json to the project's .gitignore file.

  2. Open the file in a text editor, or create it if it does not exist. Add the following env block 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 env key, add the variables to it instead of adding a second one.

    • Do not add the variables to the environment key inside autoMode.

    • Include the NODE_EXTRA_CA_CERTS line 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 the env block.

    • Do not share or commit the file.

  3. (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.

  1. Open ~/.zshenv in 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=0

    Replace <appliance-host> with your appliance address and <lpai-token> with your API token. Include the NODE_EXTRA_CA_CERTS line only when the panel shows the CA certificate step. To save another variable from the panel, add another export line. Do not share the file.

  2. Open a new terminal, and confirm that ANTHROPIC_BASE_URL is set.

    echo $ANTHROPIC_BASE_URL
    Expected output
    https://<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.

  1. 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 0

    Replace <appliance-host> with your appliance address and <lpai-token> with your API token. Include the NODE_EXTRA_CA_CERTS line only when the panel shows the CA certificate step. To save another variable from the panel, add another launchctl setenv command. The commands print nothing when they succeed.

  2. Confirm that ANTHROPIC_BASE_URL is set.

    launchctl getenv ANTHROPIC_BASE_URL
    Expected output
    https://<appliance-host>
  3. (Optional) If an IDE is already running, quit the whole app with CMD + Q, not only its windows. Then open the IDE again.

  4. (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 a launchctl setenv command for each variable that you set in step 1. Remove the NODE_EXTRA_CA_CERTS command when the panel shows no CA certificate step. Do not share the file.

  5. (Optional) If you created the LaunchAgent file, load it.

    launchctl bootstrap gui/$UID ~/Library/LaunchAgents/local.launchpad-env.plist

    The 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.

  1. 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.crt

    The command prints nothing when it succeeds.

  2. Confirm that macOS trusts the appliance.

    curl --output /dev/null --silent --show-error --write-out '%{http_code}\n' https://<appliance-host>/v1/models

    Replace <appliance-host> with your appliance address.

    Expected output
    401

    A 401 status 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​

  1. Open a new terminal. If you used the project file, change to the project folder.

  2. Start Claude Code.

    claude
  3. Run /status, and check that the Anthropic base URL line shows your appliance address.

    Expected output
    Auth token:                 ANTHROPIC_AUTH_TOKEN
    Anthropic base URL: https://<appliance-host>
  4. Exit with /exit.

  5. (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​

  1. In the settings file that you edited, remove the variables that you added to the env key. If the env key is then empty, remove it. If the file holds nothing else, delete the file.

  2. (Optional) If you added the variables to ~/.zshenv, remove those lines.

  3. (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_SERVER

    The commands print nothing when they succeed.

  4. (Optional) If you created the LaunchAgent file, remove it.

    launchctl bootout gui/$UID/local.launchpad-env
    rm ~/Library/LaunchAgents/local.launchpad-env.plist

    The commands print nothing when they succeed.

  5. (Optional) If you selected the claudeCode.disableLoginPrompt checkbox, open the VS Code settings, search for claudeCode.disableLoginPrompt, and clear its checkbox.

  6. (Optional) If you use Claude Code in an IDE, quit the IDE with CMD + Q, and open it again.

  7. (Optional) If you removed launchctl variables, quit your terminal app with CMD + Q, and open it again.

  8. Open a new terminal, start Claude Code, and run /status. Confirm that the Anthropic base URL line no longer shows your appliance address.

  9. (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.