Skip to content

Claude Code ​

The claude-code adapter runs claude -p in three layers, from the outside in to the agent:

One run, in call order:

sh
export CLAUDE_CODE_OAUTH_TOKEN=…   # claude setup-token; never the keychain nor ~/.claude
npx proctor run suites/isolation-probe.eval.ts --agent claude-code            # srt sandbox by default
npx proctor run path/to/review.eval.ts --agent claude-code --case <case-id> --repeat 3 -j 3
LayerPage
sandbox (srt, local-temp)Sandboxes
config layer (always on)below
credentialAuth
plugins of a variantPlugins
init probe and isolation suiteIsolation probe

Config layer (always on) ​

Flag or variableEffect
CLAUDE_CONFIG_DIR=<sandbox home>/.claudeblank config; without it, the CLI would read the keychain entry of the host's default config
--setting-sources userreads only the settings.json of that temporary directory: neither the host's, nor the .claude/settings*.json of the cloned repo
--settings <json>the variant's settings (model, hooks)
--strict-mcp-config --mcp-config <json>only the declared MCP servers and the MCP stubs of the variant (stdio, node by absolute path); no claude.ai connector, no server of a loaded plugin
--allowedTools mcp__<stub>every permission level, readonly included, calls the MCP stubs without asking: a stub has no side effect
--plugin-dir <copy>directory plugin, copied into the sandbox home
--no-session-persistence, --output-format stream-json --verbosenothing to resume; the stream is the transcript
prompt on stdin, not as an argumentclaude -p reads it when no prompt is passed (checked offline: without stdin, "Input must be provided either through stdin or as a prompt argument"); no argument size limit (128 KiB on Linux), and srt does not re-quote the prompt (each ' takes 5 bytes there); srt forwards stdin, tested by srt.integration.test.ts
ENABLE_CLAUDEAI_MCP_SERVERS=false, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, DISABLE_AUTOUPDATER=1no connector, telemetry or update
CLAUDE_CODE_TMPDIR=<sandbox TMPDIR>otherwise the Bash tool writes under /tmp/claude-<uid>, shared with the host's sessions and denied under srt

Why neither --bare nor --safe-mode ​

Checked on CLI 2.1.280:

Candidate flagFindingConsequence
--safe-modeloads a --plugin-dir but without its skills or agents, and skips all hooksa plugin's slash commands (e.g. /sdlc:review) and hook-based plugins would not run
--bareskips hooks, including those from --settings, and the discovery of the repo's CLAUDE.md filessame for hook-based plugins; a review skill would lose the repo's conventions
--setting-sources ""blocks the resolution of installed pluginsa marketplace-installed plugin would not load

The chosen combination keeps plugins, skills and hooks, and exposes only what the harness wrote into the temporary directory.