Skip to main content

Deploy the Claude Code Helper

Install and configure the Claude Code Helper on developer machines or deploy it fleet-wide through MDM.

Overview

Use this guide to install the Claude Code Helper so that Claude Code routes its traffic through the F5 Workforce AI Security Gateway and Model Router. The helper is a cross-platform, zero-dependency compiled binary. It replaces Claude Code's static Anthropic API key with an OAuth 2.0 device flow, and exports the OS-trusted certificate authority (CA) certificates Claude Code needs to trust TLS inspection. After you complete this guide, Claude Code authenticates through the gateway on its own, at the start of every session.

The Claude Code Model Router must already be on before the helper can route traffic. See Configure the Claude Code Model Router.


Before you begin

Before you begin, make sure you have:

  • A supported platform and architecture: Windows (x64 or ARM64), macOS (x64 or ARM64), or Linux (x64 or ARM64).

  • The Claude Code Model Router turned on: an admin turns it on for the Default Policy or a Group Policy first. See Configure the Claude Code Model Router.

  • On Linux only, a credential storage backend: the secret-tool utility or the keyctl kernel keyring. See Install Linux credential storage.

  • Administrator or root privileges, if you're deploying through MDM or fixing a permission error. Self-install on one machine doesn't need elevated privileges.

Install Linux credential storage

On Linux, the helper stores credentials using one of three backends. It tries each in this order: the secret-tool utility, the kernel keyring (keyctl), then an opt-in plaintext file for containers where neither is available.

Install at least one of the first two before you install the helper:

  • Debian / Ubuntu:sudo apt install libsecret-tools keyutils

  • Fedora:sudo dnf install libsecret keyutils

  • Arch:sudo pacman -S libsecret keyutils


Choose a deployment method

The helper is available from Workforce AI Security support as a compiled binary for Windows, macOS, and Linux. The right method depends on who installs it:

Method

Best for

Self-install (--install)

A developer installing the helper on their own machine

macOS PKG or Windows MSI installer

Fleet-wide deployment through an MDM platform such as Jamf or Intune. Signed and notarized, so no extra scripting is needed.

Manual binary and managed-settings.json

Linux fleets, or any platform where you need a custom managed configuration

The PKG and MSI installers are covered in Deploy with the macOS installer and Deploy with the Windows installer. Manual deployment for all platforms is covered in Distribute configuration to managed devices.


Install the helper

Download the compiled binary for your platform and architecture, then run it with the install flag. For example, on macOS (Apple Silicon):

./claude-code-helper-macos-arm64 --install

This authenticates the current developer and configures Claude Code. On Windows, run the matching .exe instead:

claude-code-helper-windows-x64.exe --install

The install command:

  • Copies the binary to ~/.surepath/claude-code-helper/bin/ as claude-code-helper (claude-code-helper.exe on Windows).

  • Writes these settings to ~/.claude/settings.json, and keeps all existing settings:

    • apiKeyHelper: set to the installed binary path.

    • env.ANTHROPIC_BASE_URL: set to https://gateway.surepath.ai.

    • env.NODE_EXTRA_CA_CERTS: set to ~/.surepath/claude-code-helper/certs/extra-ca-certs.pem.

    • hooks.SessionStart: appends the helper's certificate export command. It keeps existing hooks from other tools.

    • permissions.deny: appends "WebSearch" to block this tool, since it's incompatible with non-Anthropic API providers routed through the gateway. It keeps existing allow rules and other deny entries.

  • Backs up the existing ~/.claude/settings.json before writing.

  • Removes any legacy installation directories from earlier versions.

To skip confirmation prompts, add the --yes flag (short form -y):

./claude-code-helper-macos-arm64 --install --yes

This installs the helper without prompts, which is useful in scripts or provisioning workflows.

Resolve environment variable conflicts

Before installing, the helper checks for environment variables that would block correct routing through the Workforce AI Security Gateway. If it detects a conflict, it stops the install and lists the conflicts. Blocked variables include:

  • Backend bypass flags: CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, and CLAUDE_CODE_USE_FOUNDRY turn off ANTHROPIC_BASE_URL routing.

  • Provider-specific URLs: variables prefixed with ANTHROPIC_AWS_*, ANTHROPIC_BEDROCK_*, ANTHROPIC_VERTEX_*, ANTHROPIC_GCP_*, or ANTHROPIC_FOUNDRY_*.

  • Auth interference: ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN send the wrong credentials to the Workforce AI Security endpoint.

To turn off detected conflicts automatically, add the --force flag:

claude-code-helper -i --force

This renames each conflicting variable, by adding the prefix SP_DISABLE_, in the settings file where it was found. The helper can't rename a variable set in the shell environment. It shows a warning with instructions to unset that variable yourself.

To see a full diagnostic of all detected configuration issues without making changes, run claude-code-helper --report. To install without prompts while also fixing conflicts, combine both flags with --yes:

claude-code-helper -i --force --yes

Verify the installation

Run the diagnostic report to confirm the helper installed correctly:

claude-code-helper --report

The report lists the current apiKeyHelper and NODE_EXTRA_CA_CERTS settings, the authentication state, and a Permissions Audit section. That section checks runtime directory ownership and file permissions.

Then start a Claude Code session. On first use, the helper opens a browser window for a one-time device login. After that login completes, Claude Code sends requests through https://gateway.surepath.ai. Later sessions don't prompt for an API key.


Uninstall the helper

To remove the helper and revert Claude Code settings, run the installed binary:

claude-code-helper -u

The uninstall command removes the installed binary and stored credentials from the OS credential manager. It reverts only the settings keys that install wrote, and keeps user-added allow rules, other deny entries, and all other env and hooks settings. It also keeps log files, backup files, and the CA certificate file. It creates a timestamped backup of settings.json before making any changes.


Clear credentials

To delete stored credentials (access token, refresh token, and cached auth URL) without a full uninstall:

claude-code-helper --clear-credentials

This forces re-authentication on the next Claude Code session, and it keeps the installation, settings, and CA certificates in place. Use it to troubleshoot authentication issues or to switch tenant accounts. The short alias is -cc.


Collect diagnostic logs

To generate a support bundle with logs, configuration, and a diagnostic report, run:

claude-code-helper --collect-logs

The short alias is -cl. This command creates a zip file on the desktop with filtered log files, the current --report output, and configuration details. It excludes credentials. Share the bundle with Workforce AI Security support. Each file in the zip is capped at 10 MB.


Export certificates

The helper exports OS-trusted CA certificates to ~/.surepath/claude-code-helper/certs/extra-ca-certs.pem at the start of each session, using the SessionStart hook. The NODE_EXTRA_CA_CERTS environment variable points to this path. This lets Claude Code trust certificates installed at the OS level, including the Workforce AI Security CA certificate that TLS inspection needs.

The export result is cached for 24 hours. To force a refresh before the cache expires:

claude-code-helper --session-start --update-certs

If your organization handles authentication separately and only needs the CA certificate configured, use cert-only mode:

claude-code-helper --cert-only

This writes only env.NODE_EXTRA_CA_CERTS to ~/.claude/settings.json and leaves all other settings untouched. The short alias is -co.


Deploy with the macOS installer

For macOS deployments, Workforce AI Security provides pre-built PKG installer packages. These support both Apple Silicon (ARM64) and Intel (x64) architectures. The installer filenames follow this pattern:

  • claude-code-helper-<VERSION>-macos-arm64.pkg

  • claude-code-helper-<VERSION>-macos-x64.pkg

Each PKG installs two files to /Library/Application Support/ClaudeCode/:

File

Install path

Purpose

Binary

/Library/Application Support/ClaudeCode/surepath/bin/claude-code-helper-macos-<ARCH>

The compiled helper binary

Configuration

/Library/Application Support/ClaudeCode/managed-settings.json

Default managed settings for Claude Code

The installer, on its own:

  • Sets the binary as executable (chmod 755).

  • Removes the com.apple.quarantine extended attribute from the binary.

  • Sets the right permissions on managed-settings.json (chmod 644).

This means MDM admins don't need a separate post-install script for permission or quarantine handling.

The installer shows as Workforce AI Security - Claude Code Helper in the macOS Installer app. It needs administrator privileges, and it installs to the local system domain only, not to user home directories.

The macOS binaries and PKG installers are code-signed with a Developer ID Application certificate, and Apple notarizes them, so Gatekeeper doesn't block them.


Deploy with the Windows installer

For Windows deployments, Workforce AI Security provides pre-built MSI installer packages, built with the WiX Toolset. These support both x64 and ARM64 architectures. The installer filenames follow this pattern:

  • claude-code-helper-<VERSION>-windows-x64.msi

  • claude-code-helper-<VERSION>-windows-arm64.msi

Each MSI installs two files to C:\Program Files\ClaudeCode\:

File

Install path

Purpose

Binary

C:\Program Files\ClaudeCode\surepath\bin\claude-code-helper-windows-<ARCH>.exe

The compiled helper binary

Configuration

C:\Program Files\ClaudeCode\managed-settings.json

Default managed settings for Claude Code

The MSI bundles the interactive OAuth (user-authenticated) variant of managed-settings.json, which fits most desktop deployments.

MSI is the native deployment format for Microsoft Intune, Configuration Manager, and Group Policy Software Installation. To deploy through Intune:

  1. In the Intune admin center, go to Apps > Windows > Add, then select Line-of-business app.

  2. Upload the MSI file that matches the target architecture.

  3. Under Assignments, target a device group as Required.

Intune handles install, detection, and uninstall using the MSI's own ProductCode and UpgradeCode. It needs no PowerShell wrapper or repackaging. Other MDM tools that support MSI deploy it the same way.

The MSI, and the EXE binary inside it, are Authenticode-signed. This meets Windows security requirements for MDM-deployed executables, with no manual trust step.


Distribute configuration to managed devices

For enterprise or fleet-wide deployments, deploy a managed-settings.json file alongside the helper binary. Claude Code reads this file at startup and treats its values as organization-level defaults. Individual user settings can't override these defaults.

On macOS and Windows, the PKG and MSI installers described earlier handle this deployment on their own. Use the steps in this section for Linux fleets, or when you need to deploy the binary and managed settings by hand on any platform.

  1. Deploy the helper binary to a system-wide directory on each managed machine:

    • Windows:C:\Program Files\ClaudeCode\surepath\bin\

    • macOS:/Library/Application Support/ClaudeCode/surepath/bin/

    • Linux:/opt/surepath/bin/

  2. Deploy the matching managed-settings.json to the Claude Code managed settings directory:

    • Windows:C:\Program Files\ClaudeCode\

    • macOS:/Library/Application Support/ClaudeCode/

    • Linux:/etc/claude-code/

When developers start Claude Code, authentication and certificate export happen on their own. Workforce AI Security support provides pre-built managed-settings.json files for each supported platform and distribution format.

In every case, the managed-settings.json file must use absolute system paths. It doesn't support the ~ shortcut or %USERPROFILE% expansion.

Customize managed settings

The PKG and MSI installers each include a default managed-settings.json, set up for the standard Workforce AI Security gateway deployment. This default configuration fits most organizations. To change permissions, environment variables, hooks, or the gateway URL, use one of these options.

macOS

  • Change settings after PKG installation: install the standard PKG. Then deploy a customized managed-settings.json to /Library/Application Support/ClaudeCode/ using a separate MDM policy, such as a Jamf Copy File payload or a post-install script. This overwrites the default settings file the PKG delivered. The signed, notarized binary stays in place.

  • Build a custom PKG: use the standalone signed binary from the build artifacts, along with a custom managed-settings.json, to create a custom PKG with macOS pkgbuild and productbuild. Workforce AI Security support provides the build artifacts separately.

Windows

  • Change settings after MSI installation: install the standard MSI. Then deploy a customized managed-settings.json to C:\Program Files\ClaudeCode\ using a separate MDM policy, such as an Intune Win32 app set up to run a post-install script. This overwrites the default settings file the MSI delivered. The signed binary stays in place.

  • Build a custom MSI: use the standalone signed binary from the build artifacts, along with a custom managed-settings.json, to create a custom MSI with the WiX Toolset. Workforce AI Security support provides the build artifacts separately.

Set executable permissions on macOS and Linux

If you deploy through the macOS PKG installer, its post-install script sets executable permissions for you. The rest of this section applies only when you deploy the binary by hand, outside a PKG.

On macOS and Linux, the helper binary needs its executable bit set, or Claude Code can't run it. MDM deployment tools, including Jamf and Intune, typically don't keep POSIX file permissions when they copy or download files to managed machines. The binary arrives on the device with default permissions that don't include the executable bit, even when the source file was executable.

Without the executable bit, Claude Code fails to call the helper at session start. The apiKeyHelper call and the SessionStart hook both return a Permission denied error, and developers can't authenticate. Developers often see this as an API key or authentication error, with nothing pointing to a file permission problem.

To prevent this, add a chmod command to the MDM post-install script or package configuration, run right after the binary is deployed:

chmod 755 /Library/Application\ Support/ClaudeCode/surepath/bin/claude-code-helper-macos-arm64
chmod 755 /opt/surepath/bin/claude-code-helper-linux-arm64

Running chmod in the post-install step sets the permission on every managed machine, with no manual work needed. To confirm the permission is set correctly on a device, run:

ls -l /path/to/claude-code-helper

The output shows -rwxr-xr-x at the start of the line. If it shows -rw-r--r-- or similar, without the x bits, the binary isn't executable.

Remove the macOS quarantine attribute

On macOS, a binary downloaded from the internet, instead of deployed through a signed package, might carry a quarantine extended attribute (com.apple.quarantine). Gatekeeper uses this attribute to block execution. This is separate from file permissions. To check for and remove the attribute:

xattr -l /Library/Application\ Support/ClaudeCode/surepath/bin/claude-code-helper-macos-arm64
xattr -d com.apple.quarantine /Library/Application\ Support/ClaudeCode/surepath/bin/claude-code-helper-macos-arm64

Binaries deployed through the Workforce AI Security signed and notarized PKG installer don't get this attribute, and their executable bit is set for you. The PKG installer is the recommended deployment method for macOS.


Fix permission errors

A permission error when writing certificates or credentials can happen after MDM deployment, when an administrator account created the runtime directories. If the helper reports this error, run the fix-permissions command with elevated privileges.

macOS / Linux

sudo claude-code-helper --fix-permissions

Windows (run as Administrator)

claude-code-helper.exe --fix-permissions

The short alias is -fp. This command scans the affected directories, confirms the changes, and corrects ownership. Afterward, the current user can write to the required paths.

Important: The helper blocks the --install, --uninstall, --upgrade, --cert-only, --clear-credentials, and --api-key commands when run as root or Administrator. Run those commands as the target user. Use --fix-permissions with elevation only for the repair step.


Troubleshooting

Permission denied at session start

Symptom: Claude Code shows an API key or authentication error, and the helper's log shows a Permission denied error from the apiKeyHelper call or the SessionStart hook.

Cause: The helper binary's executable bit isn't set. This is common after an MDM deployment tool copies the binary without keeping POSIX permissions.

Fix: Run chmod 755 on the deployed binary path. See Set executable permissions on macOS and Linux.

Gatekeeper blocks the binary on macOS

Symptom: macOS Gatekeeper blocks the binary with a message that it can't verify the binary, or execution fails with no message.

Cause: Someone downloaded the binary by hand instead of deploying it through the signed PKG installer, so it carries the com.apple.quarantine extended attribute.

Fix: Remove the quarantine attribute, or deploy through the PKG installer instead. See Remove the macOS quarantine attribute.

Install stops and cites a conflicting environment variable

Symptom: --install stops and lists one or more conflicting environment variables instead of completing.

Cause: A variable such as ANTHROPIC_API_KEY or CLAUDE_CODE_USE_BEDROCK is already set, and it would bypass routing through the Workforce AI Security Gateway.

Fix: Unset the variable, or run install again with --force to have the helper rename it for you. See Resolve environment variable conflicts.


References

For more information, see:

Settings file location

Claude Code reads its configuration from settings.json, in the .claude directory of your home folder. The path varies by operating system:

  • macOS:~/.claude/settings.json (expands to /Users/<USERNAME>/.claude/settings.json)

  • Linux:~/.claude/settings.json (expands to /home/<USERNAME>/.claude/settings.json)

  • Windows:C:\Users\<USERNAME>\.claude\settings.json

The install command writes these settings:

{
  "apiKeyHelper": "~/.surepath/claude-code-helper/bin/claude-code-helper --api-key",
  "env": {
    "ANTHROPIC_BASE_URL": "https://gateway.surepath.ai",
    "NODE_EXTRA_CA_CERTS": "~/.surepath/claude-code-helper/certs/extra-ca-certs.pem"
  },
  "hooks": {
    "SessionStart": [
      {
        "hooks": [{ "type": "command", "command": "~/.surepath/claude-code-helper/bin/claude-code-helper --session-start" }]
      }
    ]
  },
  "permissions": {
    "deny": ["WebSearch"]
  }
}

All writes are surgical. The install command adds or updates only the specific keys listed above, and keeps your existing settings.

On Windows, paths must use backslash notation, with each backslash escaped as \\ in JSON:

{
  "apiKeyHelper": "\"C:\\Users\\<USERNAME>\\.surepath\\claude-code-helper\\bin\\claude-code-helper.exe\" --api-key",
  "env": {
    "ANTHROPIC_BASE_URL": "https://gateway.surepath.ai",
    "NODE_EXTRA_CA_CERTS": "C:\\Users\\<USERNAME>\\.surepath\\claude-code-helper\\certs\\extra-ca-certs.pem"
  }
}

The compiled binary runs natively on Windows. It needs no additional shell environment, such as Git Bash or WSL.

Did this answer your question?