Run Claude Code behind a corporate launcher changedcorporate-launcher
Nearest release: v2.1.304, published 2 hours after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 19 Oct 2026 17:33 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 19 Oct 2026 17:37 UTC.
Upstream edited
Recorded here
Lines+24added
Lines−4removed
From line
106
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits10to this page, all time
### Pass arguments to the launcher
The whole hunk
from line 106, old and new numbered
/
from line 106
106106When the launcher can't run, Claude Code refuses to start the process instead of starting it unwrapped. On Windows, [the variable is ignored](#what-the-launcher-covers) and processes start unwrapped. Claude Code holds the script to these rules:
107107
108108* **End with `exec "$@"`.** A launcher that forks a child and exits leaves an orphaned Claude Code process the background service can't track. Agent view marks such a session failed with a message naming the launcher, and the service reaps what the launcher left behind.
109* **Don't reorder, absorb, or prepend arguments.** The first argument is the Claude Code binary and everything after it is its argv.
109* **Don't reorder, absorb, or add to Claude Code's arguments.** Remove the launcher's [own arguments](#pass-arguments-to-the-launcher), which come first, and pass the rest to `exec` as it arrived.
110110* **Pass every inherited environment variable through to `exec`.** Adding variables, such as injected credentials, is fine; dropping inherited ones is not.
111111 * The per-session authentication tokens, the model and provider selection, and `CLAUDE_CODE_PROCESS_WRAPPER` itself all travel on the inherited environment, so a launcher that rebuilds it from an allow list breaks the sessions it starts, and `/status` reports a launcher mismatch.
112112 * If the launcher must enter a namespace or sandbox that resets the environment, re-export the inherited environment inside it verbatim.
113* **Reach `exec` within about three seconds each time the launcher runs.** A cold background dispatch runs the launcher twice in series before the first byte of output, so do slow work such as a single sign-on exchange lazily or from a cache.
113* **Reach `exec` within about three seconds each time the launcher runs.** A background session can run the launcher three times in series before its first output. Do slow work such as a single sign-on exchange lazily or from a cache, and give any step that waits on the network its own time limit.
114114* **Tolerate being invoked from inside itself.** Claude Code applies the launcher to every nested self-spawn, so a launcher that acquires an exclusive resource must detect that it already holds it.
115* **Don't write to the terminal before Claude Code starts.** Anything printed before the `exec` is reported as the crash cause if the session dies before initializing.
115* **Don't write to the terminal or standard output before Claude Code starts.** Anything printed before the `exec` is reported as the crash cause if the session dies before initializing. Text on standard output also reaches a program that reads Claude Code's output, such as a script that parses `claude -p` results.
116116* **Don't depend on how arguments are spelled.** A flag's value can arrive as its own argument, `--flag value`, or joined to the flag, `--flag=value`. Which form a flag uses can change between versions.
117117* **Run `exec` from the directory the launcher started in.** Claude Code works in the directory it starts in, so a launcher that changes directory can start a session in the wrong project. If the launcher must enter a namespace or sandbox that resets the working directory, change back to the starting directory inside it, before the `exec`.
118* **Don't read standard input.** A command that reads it before the `exec`, such as one that asks for a password, can wait for input that doesn't come and leave the session stuck. It can also take input meant for Claude Code, and the session can then run without that input and report no error. Redirect such a command's input from `/dev/null`.
119* **Call other programs by absolute path.** The launcher can start with a `PATH` that lacks the directories your shell profile adds.
118120
119121### Format of the launcher value
120122
from line 124
122124
123125To pass your launcher arguments of its own, write them after the path. Claude Code parses the value as an argument list, not a shell command:
124126
125* Whitespace separates tokens, and double quotes group a token that contains spaces.
127* Whitespace separates tokens, and double quotes group a token that contains spaces. A single quote is an ordinary character, so `'a b'` is two tokens.
126128* A value that starts with `[` is read as a JSON string array, such as `["/opt/corp/launcher", "--profile", "cc"]`.
127129* Shell syntax doesn't work: there is no variable expansion or globbing, and an unquoted operator such as `;`, `|`, `&`, or `$(` is rejected as a configuration error rather than reinterpreted.
128130
129131When the value can't be used, Claude Code refuses to start the affected process and [reports the reason](/docs/en/errors#claude_code_process_wrapper-launcher-errors).
132
133In a settings file, write the array form inside a JSON string and escape its quotes: `"[\"/opt/corp/launcher\", \"--profile\", \"cc\"]"`.
134
135### Pass arguments to the launcher
136
137Write the launcher's own arguments after its path in [the value](#format-of-the-launcher-value), and remove them in the script before the `exec` call. They reach the script first, ahead of the Claude Code command. The following script, written for the value `/opt/corp/launcher --profile cc`, saves the profile name and then removes both arguments with `shift`:
138
139```bash theme={null}
140#!/bin/sh
141if [ "$1" = "--profile" ]; then
142 profile="$2"
143 shift 2
144fi
145# Your organization's setup for "$profile".
146exec "$@"
147```
148
149Use the [Verify step](#set-up-the-launcher) to see the launch command Claude Code resolved from the value.
130150
131151## Relationship to `CLAUDE_CODE_SHELL_PREFIX`
132152
No line in this hunk matches that.